You can change the default lifecycle model configuration by editing configurationsediting the configurations.xml
file using the information given below.
...
- File Name: configurations.xml
- Location:
<ES_HOME>\repository\resources
- Purpose: Defines Allows you to define lifecycles, which are applied for asset types.
...
<aspect>
XML Syntax | <aspect name="" class=""> |
---|
Description | This element used defines lifecycles as aspects. |
---|
Type | |
Default Value | |
Fixed Values | |
the various aspects of the lifecycle. |
Mandatory/Optional | MandatorySamples | |
---|
Attributes
...
Attribute | Description | Type | Default ValueValues | Fixed Values | Mandatory/ Optional | Notes |
---|
name | Contains 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. | | org.wso2.jaggery.scxml.aspects. JaggeryTravellingPermissionLifeCycle
| | Mandatory | A user has the ability to define his/her org.wso2.carbon.governance.registry.
extensions.aspects.DefaultLifeCycle
| | Mandatory | You can define your own class as shown here, but the default class provided with the ES distribution has the capability to handle any configuration that follows the above template. |
Sample implementations
Code Block |
---|
|
<aspect name="Test" class="org.wso2.jaggery.scxml.aspects.JaggeryTravellingPermissionLifeCycle"> |
...
Anchor |
---|
| configuration |
---|
| configuration |
---|
|
<configuration>
XML Syntax | <configuration type=""> |
---|
Description | This element describes the way of lifecycle configuration is setup |
---|
Type | |
Default Value | N/A |
Fixed Values | |
in which the lifecycle configurations are setup. |
Mandatory/Optional | Mandatory |
---|
Attributes
...
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/ Optional | Notes |
---|
type | Define Defines how the lifecycle configuration optionsis configured. | | N/A | If the configuration is setup through the management console- Use this option when the lifecycle configurations are setup using the ES Management Console.
- resource -
If the configuration is setup through - Use this option when the lifecycle configurations are setup via the
registry.xml file.
| Mandatory | |
Sample implementations
Code Block |
---|
|
<configuration type="resource"> |
Back to Top ^
...
<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 elements that appear after this one contain subsequent elements are the actual SCXML configuration. |
---|
Type | |
Default Value | |
Fixed Values | |
Mandatory/Optional | Mandatory |
---|
Attributes
...
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/Optional | Notes |
---|
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. AlsoFurthermore, by changing the value of this attribute, a user you can quickly easily modify the initial state and the flow of the lifecycle. | | | | | |
Sample implementations
Code Block |
---|
|
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" initialstate=""> |
Back to Top ^
...
<state>
XML Syntax | <state id=""> |
---|
Description | The state element defines Defines the states of the lifecycle. A lifecycle can have multiple states , and in the configuration and if needed, you can define more than one state element can be given. |
---|
Type | |
Default Value | N/A |
Fixed Values | |
in the configuration. |
Mandatory/Optional | Mandatory |
---|
Attributes
...
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/ Optional | Notes |
---|
id | The ID attribute of the state element defines the Defines the name of that the lifecycle state. | | N/A | | Mandatory | |
Sample implementations
Code Block |
---|
|
<state id="Development"></state> |
Info |
---|
ES does not support multiple lifecycle states with the same name. Therefore, make sure to have unique names for all the lifecycle state names of a lifecycle. |
Back to Top ^
...
<datamodel>
XML Syntax | <datamodel> |
---|
Description | This element contains all the custom elements, which are defined in the lifecycles lifecycle model. The Based on the SCXML specification allows users to , you can define a data model to a lifecycle state and you can use this extension is used to define custom elements. Type |
---|
Mandatory/Optional | |
---|
Default Value | N/A |
Fixed Values | |
Mandatory/Optional | Optional |
...
This element has no attributes.
Back to Top ^
...
<data>
XML Syntax | <data name="" /> |
---|
Description | Custom data elements (according to the SCXML specification) serve to define check items, transition permission, transition validations, transition scripts, transition executions , and transition UIs. This element describes the data of its child elements. |
---|
Type | |
Default Value | N/A |
Fixed Values | |
Mandatory/Optional | Optional |
---|
Attributes
...
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/ Optional | Notes |
---|
name | Defines the extension point (e.g., Transition Validators, Transition Executors, Transition User Interfaces and Transition Scripts are one of many well-defined extension points supported by ES) that is used in the lifecycle. You can define only one such element extension point of each a kind as , because the underline underlined implementation ignores multiple elements and takes only one into consideration. For transitionApproval , the following rules apply regarding roles and votes: roles="" - Any user can voteroles="admin" - Only users with an admin role can vote votes="2" - Two votes are required for approval.
| | | checkItems - If the user is defining check items as its child elements.transitionValidations - If the data element defines transition validations.transitionPermission - If the data element defines transition permissions.transitionScripts - If the data element describes the transition scripts.transitionExecution - If the data element defines programmable executions for transitions.transitionUI - If the data element defines custom UIs accepting that accept user input for transitions.transitionApproval - If the data element defines lifecycle transition transitions that need user approvals.
| Mandatory | |
Sample implementations
Code Block |
---|
|
<data name="checkItems">
<item name="Code Completed" forEvent="">
<item name="WSDL, Schema Created" forEvent="">
</data>
<data name="transitionValidation">
<validation forEvent="" class="">
<parameter name="" value=""/>
</validation>
</data>
<data name="transitionPermission">
<permission forEvent="" roles=""/>
</data>
<data name="transitionScripts">
<js forEvent="">
<console function="">
<script type="text/javascript">
</script>
</console>
<server function="">
<script type="text/javascript"></script>
</server>
</js>
</data>
<data name="transitionExecution">
<execution forEvent="Promote" class="org.wso2.jaggery.scxml.generic.GenericExecutor">
</data>
<data name="transitionUI">
<ui forEvent="Promote" href="../lifecycles/pre_invoke_aspect_ajaxprocessor.jsp?currentEnvironment=/_system/governance/trunk/"/>
</data>
<data name="transitionApproval">
<approval forEvent="Promote" roles="" votes="5"/>
<approval forEvent="Demote" roles="admin" votes="5"/>
</data> |
...
Back to Top ^
...
<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. |
---|
Type | |
Default Value | N/A |
Fixed Values | |
Mandatory/Optional | Optional |
---|
Attributes
...
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/ Optional | Notes |
---|
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 can be required for more than one event, in which case, a user can give a comma (",") separated list for the forEvent attribute. | | Null : Keeping the forEvent attribute empty means that a specific check item is not required for any transition event. | | Optional | The forEvent value is defined under the <transition> element with the "event " attribute. |
Sample implementations
Code Block |
---|
|
<data name="checkItems">
<item name="Effective Inspection Completed" forEvent=""></item>
<item name="Test Cases Passed" forEvent=""></item>
<item name="Smoke Test Passed" forEvent=""></item>
</data> |
...
<permissions>
XML Syntax | <permissions> |
---|
Description | The permissions This element defines permissions for that specified action and hold holds more than one child element which that defines permissions. Under check items, the permissions element defines the users that have the capability of checking (check/uncheck) that check item. If a user does not have permissions to check a check item, then the management console will display that specific item in disabled mode. The idea behind this is to let the user know that there are some more check items in that state, but that he or she does not have permission to check them (so as to avoid user confusion). |
---|
Type | |
Default Value | |
Fixed Values | |
Thereby, this helps a user to clearly identify what items he/she has the permission to check. |
Mandatory/Optional | Optional |
---|
This element doesn't have any attributes.
...
<permission>
XML Syntax | <permission roles=""/> |
---|
Description | This element is a child element of the permissions element and will define the roles that have permissions to do the specified action. Here, the attribute roles accepts a comma (",") separated list and these roles should be present in ES. | Type | |
---|
Default Value | N/A |
Fixed Values | |
Mandatory/Optional | Optional |
---|
Attributes
...
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/ Optional | Notes |
---|
roles | Defines the name of the user role to do the specified action. | | | | Mandatory | Multiple You can define multiple user roles can be define here with as comma (",") separated. |
Sample Implementations
Code Block |
---|
|
<permission roles="admin,manager"/> |
...
<validations>
XML Syntax | <validations> |
---|
Description | Defines the validations that need to be completed ES completes for each action. This element can contain one or more validation elements. Check Item Validators validators are one of many well-defined extension points supported by ES. |
---|
Type | |
Default Value | N/A |
Fixed Values | |
Mandatory/Optional | Optional |
---|
This element doesn't does not have any attributes.
Back to Top ^
...
<validation>
XML Syntax | <validation forEvent="" class="" /> |
---|
Description | Validations are an important part of lifecycles. The validation This element defines the event and the validation class that has to be is invoked at runtime. Type | |
---|
Default Value | |
Fixed Values | |
Mandatory/Optional | Optional |
---|
Attributes
...
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/ Optional | Notes |
---|
forEvent | Defines the event for which this validation should be performed. This gives user you the flexibility to define validations for each event. The user has As you have the ability to define validations for check items, which it makes it easy to validate different things at different levels. | | N/A | | Mandatory | The forEvent value is defined under the <transition> element with the "event " attribute. |
class | Defines the class that needs to be is executed at runtime to perform the validation. A user You must give the full, qualified name of a class that implements the CustomValidations interface, as the value of for the class attribute class . | | N/A | | Mandatory | |
Sample implementations
Code Block |
---|
|
<validation forEvent="" class=""></validation> |
...
<parameter>
XML Syntax | <parameter name="" value=""/> |
---|
Description | The parameter elements are used to give pass parameters to the validation and execution classes. It is up to the user to define the name value pairs, and the parameter element has attributes to define these values. A validation element or an execution element can have more than one parameter element, and it is up to the user code to handle this. The underline implementation of the DefaultLifeCycle class will pass all the parameters in a map object. |
---|
Type | |
Default Value | |
Fixed Values | |
Mandatory/Optional | Optional |
---|
Attributes
...
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/ Optional | Notes |
---|
name | User defined value Defines the name used to identify the parameter. | | N/A | | Mandatory | |
value | Defines the value of user the defined parameter. | | N/A | | Mandatory | |
Sample implementations
Code Block |
---|
|
<parameter name="endpoint.mediatype" value="application/vnd.wso2.endpoint"/> |
Back to Top ^
...
<js>
XML Syntax | <js forEvent="">
|
---|
Description | ES lifecycle configuration has the ability to allow JavaScript functions to execute on both the server-side and the client-side. The js element defines the scripts that need to be is executed for different events. |
---|
Type | |
Default Value | N/A |
Fixed Values | |
Mandatory/Optional | Optional |
---|
Attributes
...
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/Optional | Notes |
---|
forEvent | Defines Defines the transition action where this respective transition for which the JavaScript function needs to be is executed. | | | | Mandatory | The forEvent value is defined under the <transition> element with the "event" attribute. |
Sample implementations
Code Block |
---|
|
<js forEvent="">
<console function="">....</console>
<server function="">....</server>
</js> |
...
<console>
XML Syntax | <console function=""/> |
---|
Description | Defines the JavaScript function that ES needs to be executed execute on the client-side. | Type | |
---|
Default Value | N/A |
Fixed Values | |
Mandatory/Optional | Optional |
---|
Attributes
...
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/Optional | Notes |
---|
function | Defines the name of the function which will be executed at a transition that is executed when an asset moves from one lifecycle state to another. | | | | Mandatory | |
Sample implementations
Code Block |
---|
|
<console function="">
<script type="text/javascript"> </script>
</console> |
...
<script>
XML Syntax | <script type="text/javascript" /> |
---|
Description | Contains the actual JavaScript code segment. A user has the ability You can use this section to define any code segment here. |
---|
Type | |
Default Value | N/A |
Fixed Values | |
Mandatory/Optional | Optional |
---|
Attributes
...
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/ Optional | Notes |
---|
type | ES supports The scripting language that is supported by ES. | | | Set to text/javascript because at the time of this writing, ES only supports JavaScript as a scripting language. | Mandatory | |
Sample implementations
Code Block |
---|
|
<script type="text/javascript"></script> |
...
<server>
XML Syntax | <server function="" /> |
---|
Description | This is the same as the console function and the only difference is that this element defines the scripts that need to be are executed on the server-side. |
---|
Type | |
Default Value | |
Fixed Values | |
Mandatory/Optional | Optional |
---|
Attributes
...
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/ Optional | Notes |
---|
function | Defines the name of the function which will be that is executed at a an asset transition from one state to another. | | | | Mandatory | The function should be a ES supported scripting language. |
Sample implementations
Code Block |
---|
|
<server function="">
<script type="text/javascript"></script>
</server> |
...
<Execution>
XML Syntax | <execution forEvent="" class=""/> |
---|
Description | An executor is business logic that is executed once a state transition happens takes place in a lifecycle. The execution element defines the event and the execution class that will be is invoked at runtime. |
---|
Type | |
Default Value | |
Fixed Values | |
Mandatory/Optional | Optional |
---|
Attributes
...
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/ Optional | Notes |
---|
forEvent | Defines the event for which this execution should be is performed. This gives user you the flexibility to define executions for each event. | | | | Mandatory | The forEvent value is defined under the <transition> element with the "event " attribute attribute. |
class | Defines the class that needs to be 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 class . | | | | Mandatory | This class defines the business logic that is executed when the specified event is taken takes place. This class manipulates the current and target environment of the underlying artifact when the state transition is performed on it. |
Sample implementations
Code Block |
---|
<execution forEvent="Promote" class="org.wso2.carbon.governance.registry.extensions.executors.ServiceVersionExecutor"> |
...
<parameter>
XML Syntax | <parameter name="" value=""/> |
---|
Description | The name attribute defines the name of the parameter and value attribute defines that the corresponding value hold by of the parameter. This parameter element is defined under the <execution> element <execution> element. |
---|
Type | Mandatory/Optional | Optional |
---|
Attributes
Attribute | Description | Type | Default Value | | Fixed Values | |
---|
Mandatory/Optional | Optional |
Attributes of the element
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/Optional | Notes |
---|
name | The name This attribute defines the name of the parameter. This parameter element defined under the <execution> element. | | | - currentEnvironment - This defines the fully the fully qualified path of the underlying resource at its current state (before the transition is taken takes place).
- targetEnvironment - This parameter defines the fully qualified path to which the particular resource is transitted transited when the a particular state transition is taken takes place which is defined in the "forevent" attribute of the <execution> element.
- service.mediatype - This parameter denotes the MIME mediatype of the given service under the state transition.
- wsdl.mediatype - This parameter denotes the MIME mediatype of the wsdl WSDL file for the corresponding service under the state transition.
- endpoint.mediatype - This parameter denotes the MIME mediatype of the endpoint for the given artifact(service) asset type when the particular state transition is takentakes place.
| all these parameters are mandatory. | |
value | value This attribute defines that the value hold held by the parameter. This parameter element defined under the <execution> element. | | | | | |
Sample implementations
Code Block |
---|
<data name="transitionExecution">
<execution forEvent="Promote" class="org.wso2.carbon.governance.registry.extensions.executors.ServiceVersionExecutor">
<parameter name="currentEnvironment" value="/_system/governance/trunk/{@resourcePath}/{@resourceName}"/>
<parameter name="targetEnvironment" value="/_system/governance/branches/testing/{@resourcePath}/{@version}/{@resourceName}"/>
<parameter name="service.mediatype" value="application/vnd.wso2-service+xml"/>
<parameter name="wsdl.mediatype" value="application/wsdl+xml"/>
<parameter name="endpoint.mediatype" value="application/vnd.wso2.endpoint"/>
</execution>
</data> |
...
Back to Top ^
...
<ui>
XML Syntax | <ui forEvent="" href=""/> |
---|
Description | A UI element is a mechanism to associate a user interface with a particular event during a given transition. This provides a convenient way for a user allows you to pass input inputs that would be utilized when performing a transition. Note that , for the value of href, it will not accept any you can not define an external reference link for as the href attribute value. It is required Instead you need to provide a relative path in the carbon Carbon server as the value of the href attribute. |
---|
Type | |
Default Value | N/A |
Fixed Values | |
Mandatory/Optional | Optional |
---|
Attributes
...
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/ Optional | Notes |
---|
forEvent | Defines the event for which this the UI will be presentedappears. | | N/A | | Optional | The forEvent value is defined under the <transition> element with the "event " attribute. |
href | Defines the hyperlink that will be is opened and presented to the user, when a lifecycle transition operation is performed from the ES Management Console. | | N/A | | Optional | |
Sample implementations
Code Block |
---|
|
<ui forEvent="Promote" href="../lifecycles/pre_invoke_aspect_ajaxprocessor.jsp?currentEnvironment=/_system/governance/branches/testing/"/> |
...
Back to Top ^
...
<transition>
XML Syntax | <transition event="" target=""/> |
---|
Description | Mandatory/Defines the transitions of a state. In Governance Registry 4.1.1 onwards, users are allowed to define the transitions (the name , by specifying the name of the lifecycle state and the target lifecycle state) , instead of using static transitions. Previously, the configuration did not have a direct method of defining the transition event names or, most importantly, the target of the transition. There were only two transitions that were supported by default. With the new, SCXML-based configuration model, any number of transitions from one state are supported. Also, this model has the capacity to define the target state of the transition and the name of the event as well. |
---|
Type | |
Default Value | N/A |
Fixed Values | |
Any number of transitions for one lifecycle state are supported. |
Mandatory/Optional | Mandatory |
---|
Attributes
...
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/ Optional | Notes |
---|
event | Defines the transition event name, for example, to "Promote" or "Demote" e.g., Promote, Demote or any name that the user specifies. | | N/A | | Mandatory | This event name is used in the forEvent to trigger a specific event, before this transition this going on. |
target | Defines the target state of the transition. | | N/A | | Mandatory | |
Sample
...
implementations
Code Block |
---|
|
<transition event="Promote" target="Tested"/> |
...