> For the complete documentation index, see [llms.txt](https://docs.aligned.ch/installing-aligned-elements-web-server/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aligned.ch/installing-aligned-elements-web-server/attribute-workflows.md).

# Attribute Workflows

Code example of a Workflow:

```xml
<EnumAttribute Name="Status" >
   <Items DefaultItem="Open">
      <Item value="Open"/>
      <Item value="In Progress"/>
      <Item value="Closed"/>
   </Items>
   <Workflow>
      <Transition Value="Open" NextValue="In Progress"/>
      <Transition Value="In Progress" NextValue="Closed"/>
    </Workflow>
</EnumAttribute>
```

In this example it is possible to go from **Open** to **In Progress** and from **In Progress** to **Closed**. No other transitions such as from **Open** directly to **Closed** or from **Closed** back to any other value are possible.&#x20;

As can be seen in this example, that every transition possibility must be defined explicitly. It is therefore advised to define these transitions carefully.

What about start value when the object is created?

### Conditions

State transitions can also be controlled via Conditions, where the transition to the target value can only take place if the Document Object is consistent according to one or more inconsistency checks configured in a so called Condition.

Code Example of a workflow transition guarded by Conditions (the transition from "In Progress" to "Closed" can only occur (i.e. the Document Object can only saved) if the Document Object does not have a "Not Reviewed" inconsistency.

```xml
<EnumAttribute Name="Status" >
   <Items DefaultItem="Open">
      <Item value="Open"/>
      <Item value ="In Progress"/>
      <Item value ="Closed"/>
   </Items>
   <Workflow>
      <Transition Value="Open" NextValue ="In Progress"/>
      <Transition Value="In Progress" NextValue ="Closed">
         <Conditions>
            <NotReviewedRule ReviewTypeName="Review" />
         </Conditions>
       </Transition>
    </Workflow>
</EnumAttribute>
```

### Workflow Actions

Each Workflow transition can be associated with one or more actions that are executed when the Document Object is saved.

{% hint style="info" %}
Note that the action is executed when the Document Object is saved, not when the attribute value transition occurs in the UI.
{% endhint %}

Example of Action types are:

* Creating an electronic signature for the Document Object.
* Copy a File (or a PDF version of the file) to a location on the network.
* Set an Attribute in the Document object to a predefined value.
* Send an email about the change to a particular User Group.
* Lock the Document Objects to prevent users from updating it.
* Unlock the Document Objects that has been previously automatically locked.
* Start an external process.
* Add a PDF footer to a PDF document (exclusively valid for signature scenarios)

Each of these action types come with a range of configuration possibilities.

### Post Workflow UI Tasks

Since the workflow actions are performed automatically during the commit/Save procedure, it is not always obvious to the user that these actions are taking place/have taken place.&#x20;

Post Workflow UI Tasks are therefore used to communicate to the user about the performed actions or automatically perform tasks that make the user experience more agreeable.

Example of Post UI Actions are:

* Displaying a message to the user
* Prompt the User to sign a Signature (only applicable in Signature situations)
* Display a Document Object to the user&#x20;

Displaying a message to the user

Code

In UI

Prompt User to sign a Signature

Code

In UI

Display a Document Object

Code

In UI

### Dependent Transitions

Dependent Transition definitions are used to automatically perform a Transition between two values based on changes made to *other attributes* or by evaluating the state of other attributes.

Examples.... &#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aligned.ch/installing-aligned-elements-web-server/attribute-workflows.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
