The Lifecycle tool lets you visualize and construct a lifecycle.
The Lifecycle tool is available from version 4.8 onwards.
There are several types of life cycle:
To access the "Lifecycles" button, the user must have the right to"View all lifecycles" (to view all lifecycles) or"View user lifecycles" (to view only lifecycles created by a user).
The tool is displayed as follows:
To access the create, modify, duplicate and save functions, the user must have the right to"Manage all lifecycles" (to modify all lifecycles) or"Manage user lifecycles" (to modify only the lifecycles created by a user).
To create a new life cycle, click on the "New" button.
A dialog box appears, in which you must enter the label and identifier of the new life cycle.
The identifier accepts only alphanumeric characters and the hyphen "-".
To create a lifecycle for forms, the identifier must begin with "entry-form-"
A lifecycle containing changes will appear with a red banner. You need to save these changes to make them permanent, so that you can use the lifecycle.
Please note that these changes can only be saved once the lifecycle is valid, i.e. usable by Ametys. If this is not the case, an error message will appear and the changes will not be saved.
When the new life cycle is created, it appears with an initial state. This state is fictitious and serves as a starting point for the initial transitions.
At least one transition from the initial state is required to start the cycle, and each state must be joined by a transition.
To create a transition starting from a state, select the state and use the button New transition button:
As with states, the identifier is a unique integer among transitions, and the label is translatable into several languages.
The target state corresponds to the transition's default arrival state, while the options correspond to all states in the cycle, plus the "same state" option.
A transition can be added to several different states, so you need to think carefully about the default target state. Adding several conditional target states to the same transition is described below.
If you have created a transition that you want to start from more than one state, you can add them by going to the New transition menu:
A dialog box will then propose the transitions available to add to the selected state, and it is possible to add several transitions at once:
Functions are actions performed at different times in the cycle:
In most cases, functions already have a predefined order of execution, which must be taken into account when deciding whether to add them to a transition or a state
Functions are executed in the order in which they are displayed in the action grid (first at the top of the list), and this order can be changed using the forward and backward buttons.
A function can be added by clicking on the "New function" button.New function "
The dialog box lets you select the action to be performed.
For user lifecycles, the list is reduced.
When a function is selected, parameter fields may appear.
This function is coupled with the "need-comment" property and stores the comment in JCR.
This function is used to configure a email to be sent on transition/state, and therefore expects several parameters:
Conditions are used to restrict the use of a transition.
To use conditions, there are 2 types of elements:
In the example above, an OR operator is present at the root of the tree:
For the transition to run, the user must have the right to "Add content" or to create content , or the current content must belong to the user and not be locked.
By default, conditions created at the root of the tree will be linked by an AND condition.
To add a condition, use the New condition :
As with functions, when a condition is selected, the related parameter fields appear.
When nothing is selected, newly added elements will be added under the root operator. Otherwise, elements are added under the selection.
If the root is not visible ( AND operator), a condition is selected and you want to add an element to the root, simply click on the selected element to deselect it, then add the new element.
Before saving, check that there are no unconditional operators below.
Target states are the arrival states after a transition, and there are 2 types:
To add a conditional target state, select a transition in the tree on the left, then click on New conditional target state, and the available states will be displayed. If the "same state" option is selected, the transition will loop on the same state, whatever its original state.
As its name suggests, a target state expects conditions, which work in the same way as conditions for a transition. The difference is that a conditional target state (or child element) must be selected before clicking on the button, otherwise it will be added to the conditions column.
Please note that if a conditional target state has no conditions, it cannot be saved.
Properties are variables that require additional development in order to be used.
A property has a unique name within the same element (you can't have two properties named "status" in the Modify transition).
In the case of form lifecycles, there are associated core properties:
Access to lifecycle duplication is linked to the "Manage all lifecycles" or "Manage user lifecycles" right (depending on the type of lifecycle to be duplicated).
After selecting an existing lifecycle, click on the Duplicate button to open the following window for selecting the label and identifier of the duplicated lifecycle.
After clicking on Validate, a new life cycle is available, copying the initial one.