Lifecycle Configuration Definitions
Make sure to go through the following lifecycle configuration definitions when adding a new custom lifecycle via the ES Management Console.
WSO2 Enterprise Store uses the lifecycle API provided by WSO2 Governance Registry, but does not support all the lifecycle elements provided by the WSO2 Governance Registry.
XML elements
Click on an element to view its details along with sub-element details if any.
- <aspect>
- <configuration>
- <lifecycle>
- <scxml>
- <state>
- <datamodel>
- <data>
- <item>
- <execution>
- <parameter>
- <transition>
<aspect>
XML Syntax | <aspect name="" class=""> |
---|---|
Description | This element defines the various aspects of the lifecycle. |
Mandatory/Optional | Mandatory |
Attributes
Attribute | Description | Default Values | Fixed Values | Mandatory/ Optional |
---|---|---|---|---|
name | Defines the name of the lifecycle. As ES does not allow you to create two lifecycles with the same name, the name of the lifecycle should be unique. | N/A | Mandatory | |
class | Defines the class that is associated with the lifecycle.
|
| Mandatory |
Sample implementations
<aspect name="Test" class="org.wso2.jaggery.scxml.aspects.JaggeryTravellingPermissionLifeCycle">
<configuration>
XML Syntax | <configuration type=""> |
---|---|
Description | This element describes the way in which the lifecycle configurations are setup. |
Mandatory/Optional | Mandatory |
Attributes
Attribute | Description | Default Value | Fixed Values | Mandatory/ Optional |
---|---|---|---|---|
type | Defines how the lifecycle is configured. | N/A | literal - This option depicts that the lifecycle configurations are setup using the ES Management Console. | Mandatory |
Sample implementations
<configuration type="literal">
<scxml>
XML Syntax | <scxml xmlns="" version="" initialstate=""> |
---|---|
Description | This is the element that contains the new, SCXML-based configuration. State Chart XML (SCXML) is an open standard that ES supports. Up to this point of the configuration, there can be only one of each of the elements described above. They all provide metadata about the lifecycle (name, class, and other information). The subsequent elements are the actual SCXML configuration. |
Mandatory/Optional | Mandatory |
Attributes
Attribute | Description | Default Value | Fixed Values | Mandatory/Optional |
---|---|---|---|---|
xmlns | State Chart XML (SCXML) specification. | http://www.w3.org/2005/07/scxml | Mandatory | |
version | Version number of the State Chart XML (SCXML). | 1.0 | Optional | |
initialstate | Defines the initial state of the lifecycle. The initial state does not have to be the first state of the configuration. Furthermore, by changing the value of this attribute, you can easily modify the initial state and the flow of your lifecycle. |
Sample implementations
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" initialstate="">
<state>
XML Syntax | <state id=""> |
---|---|
Description | Defines the states of the lifecycle. A lifecycle can have multiple states and if needed, you can define more than one state element in the configuration. |
Mandatory/Optional | Mandatory |
Attributes
Attribute | Description | Default Value | Fixed Values | Mandatory/ Optional |
---|---|---|---|---|
id | Defines the name of the lifecycle state. ES does not support multiple lifecycle states with the same name. Therefore, make sure to have unique names for all the state names within a lifecycle. | N/A | Mandatory |
Sample implementations
<state id="Development"></state>
<datamodel>
XML Syntax | <datamodel> |
---|---|
Description | This element contains all the custom elements, which are defined in the lifecycle model. Based on the SCXML specification, you can define a data model to a lifecycle state and you can use this extension to define custom elements. |
Mandatory/Optional | Optional |
This element has no attributes.
<data>
XML Syntax | <data name=""> |
---|---|
Description | Custom |
Mandatory/Optional | Optional |
Attributes
Attribute | Description | Default Value | Fixed Values | Mandatory/ Optional |
---|---|---|---|---|
name | Defines the extension point (e.g., Transition Executors) that is used in the lifecycle. You can define only one extension point of a kind, because the underlined implementation ignores multiple elements and takes only one into consideration. |
| Mandatory |
Sample implementations
<data name="checkItems"> <item name="Effective Inspection Completed" forEvent="" /> <item name="Test Cases Passed" forEvent="" /> <item name="Smoke Test Passed" forEvent="" /> </data> <data name="transitionExecution"> <execution forEvent="Promote" class="org.wso2.jaggery.scxml.generic.GenericExecutor"> <parameter name="PERMISSION:get" value="http://www.wso2.org/projects/registry/actions/get" /> <parameter name="PERMISSION:add" value="http://www.wso2.org/projects/registry/actions/add" /> <parameter name="PERMISSION:delete" value="http://www.wso2.org/projects/registry/actions/delete" /> <parameter name="PERMISSION:authorize" value="authorize" /> <parameter name="STATE_RULE1:Created" value="Internal/private_{asset_author}:+get,+add,+delete,+authorize" /> <parameter name="STATE_RULE2:Created" value="Internal/reviewer:-get,-add,-delete,-authorize" /> <parameter name="STATE_RULE3:Created" value="Internal/everyone:-get,-add,-delete,-authorize" /> </execution> </data>
<item>
XML Syntax | <item name="" forEvent=""> |
---|---|
Description | These elements contain the check items for each state. There can be more than one of these elements. |
Mandatory/Optional | Optional |
Attributes
Attribute | Description | Default Value | Fixed Values | Mandatory/ Optional |
---|---|---|---|---|
name | Defines the name of the check item. ES allows you to define check items for each transition. | N/A | Optional | |
forEvent | Defines whether the check item is required for a specific transition. A check item may be needed for more than one event, in which case, you can provide a comma separated list for the The | Null - Keeping the forEvent attribute empty means that a specific check item is not required for any transition event. | Optional |
Sample implementations
<data name="checkItems"> <item name="Effective Inspection Completed" forEvent="" /> <item name="Test Cases Passed" forEvent="" /> <item name="Smoke Test Passed" forEvent="" /> </data>
The above code snippet based on checkItems renders as follows in the Publisher:
<execution>
XML Syntax | <execution forEvent="" class=""/> |
---|---|
Description | An executor is business logic that is executed once a state transition takes place in a lifecycle. The |
Mandatory/Optional | Optional |
Attributes
Attribute | Description | Default Value | Fixed Values | Mandatory/ Optional |
---|---|---|---|---|
forEvent | Defines the event for which this execution is performed. This gives you the flexibility to define executions for each event. | Mandatory | ||
class | Defines the class that is executed at runtime. A user must give the full, qualified name of a class that implements the Execution interface, as the value of the class attribute. This class defines the business logic that is executed when the specified event takes place. This class manipulates the current and target environment of the underlying artifact when the state transition is performed on it. | Mandatory |
Sample implementations
<execution forEvent="Promote" class="org.wso2.jaggery.scxml.generic.GenericExecutor">
<parameter>
XML Syntax | <parameter name="" value=""/> |
---|---|
Description | The |
Mandatory/Optional | Optional |
Attributes
Attribute | Description | Default Value | Fixed Values | Mandatory/ Optional |
---|---|---|---|---|
name | This attribute defines the name of the parameter.
|
| The first four parameters are mandatory. | |
value | This attribute defines the value held by the parameter.
For example:
|
|
Sample implementations
<data name="transitionExecution"> <execution forEvent="Promote" class="org.wso2.jaggery.scxml.generic.GenericExecutor"> <parameter name="PERMISSION:get" value="http://www.wso2.org/projects/registry/actions/get" /> <parameter name="PERMISSION:add" value="http://www.wso2.org/projects/registry/actions/add" /> <parameter name="PERMISSION:delete" value="http://www.wso2.org/projects/registry/actions/delete" /> <parameter name="PERMISSION:authorize" value="authorize" /> <parameter name="STATE_RULE1:Created" value="Internal/private_{asset_author}:+get,+add,+delete,+authorize" /> <parameter name="STATE_RULE2:Created" value="Internal/reviewer:-get,-add,-delete,-authorize" /> <parameter name="STATE_RULE3:Created" value="Internal/everyone:-get,-add,-delete,-authorize" /> </execution> </data>
<transition>
XML Syntax | <transition event="" target=""/> |
---|---|
Description | Defines the transitions, by specifying the name of the lifecycle state and the target lifecycle state. Any number of transitions for one lifecycle state are supported. |
Mandatory/Optional | Mandatory |
Attributes
Attribute | Description | Default Value | Fixed Values | Mandatory/ Optional |
---|---|---|---|---|
event | Defines the transition event name (e.g., Promote, Demote or any name that you wish to specify). This event name is used in the | N/A | Mandatory | |
target | Defines the target state of the transition. | N/A | Mandatory |
Sample implementations
<transition event="Promote" target="Tested"/>