Users can change the default lifecycle model configuration by editing configurations.xml file using the information given below.
File Details
- File Name: configurations.xml
- Location: $CARBON_HOME\repository\resources
- Purpose:
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>
- <permissions>
- <permission>
- <validations>
- <validation>
- <parameter>
- <js>
- <console>
- <script>
- <server>
- <script>
- <execution>
- <parameter>
- <ui>
- <transition>
<aspect>
XML Syntax | <aspect name="" class=""> |
---|---|
Description | This element used defines lifeCycles as aspects. |
Type | |
Default Value | |
Fixed Values | |
Mandatory/Optional | Mandatory |
Samples |
Attributes of the Element
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/Optional | Notes |
---|---|---|---|---|---|---|
name | Contains the name of the lifeCycle. Governance Registry does not allow you to create two lifeCycles with the same name. | N/A | Mandatory | |||
class | Defines the class that is associated with the lifeCycle. |
| Mandatory | A user has the ability to define his/her own class as shown here , but the default class provided with the Governance Registry distribution has the capability to handle any configuration that follows the above template. |
Sample Implementations
<aspect name="Test" class="org.wso2.carbon.governance.registry.extensions.aspects.DefaultLifeCycle">
<configuration>
XML Syntax | <configuration type=""> |
---|---|
Description | This element describes the way of lifecycle configuration is setup |
Type | |
Default Value | N/A |
Fixed Values | |
Mandatory/Optional | Mandatory |
Attributes of the Element
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/Optional | Notes |
---|---|---|---|---|---|---|
type | Define the lifecycle configuration options | N/A | literal - If the configuration is setup through the management console resource - If the configuration is setup through registry.xml | Mandatory |
Sample Implementations
<configuration type="resource">
<scxml>
XML Syntax | <scxml xmlns="" version="" initialstate=""/> |
---|---|
Description | This is the element that contains the new, SCXML-based configuration. SCXML is one of many standards supported by the WSO2 Governance Registry. Read more on Supported APIs & Standards for a complete list of standards supported by WSO2 Governance Registry. Up to this point of the configuration, there can be only one of each of the elements described above. They all provide meta data about the lifecycle (name, class, and other information). The elements that appear after this one contain the actual configuration. |
Type | |
Default Value | |
Fixed Values | |
Mandatory/Optional | Mandatory |
Attributes of the Element
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/Optional | Notes |
---|---|---|---|---|---|---|
xmlns | State Chart XML specification. | http://www.w3.org/2005/07/scxml | Mandatory | |||
version | Version number of the State Chart XML. | 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. Also, by changing the value of this attribute, a user can quickly modify the initial state and the flow of the lifeCycle. |
Sample Implementations
<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0" initialstate="">
<state>
XML Syntax | <state id=""> |
---|---|
Description | The |
Type | |
Default Value | N/A |
Fixed Values | |
Mandatory/Optional | Mandatory |
Attributes of the Element
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/Optional | Notes |
---|---|---|---|---|---|---|
id | The id attribute of the state element defines the name of that state. | N/A | Mandatory |
Sample Implementations
<state id="Development"></state>
Governance Registry does not support multiple states with the same name and, therefore, all the state names of a lifecycle should be unique.
<datamodel>
XML Syntax | <datamodel> |
---|---|
Description | This element contains all the custom elements which are defined in the lifeCycles model. The SCXML specification allows users to define a data model to a state and this extension is used to define custom elements. |
Type | |
Default Value | N/A |
Fixed Values | |
Mandatory/Optional | Optional |
This element has no attributes.
<data>
XML Syntax | <data name=""/> |
---|---|
Description | Custom |
Type | |
Default Value | N/A |
Fixed Values | |
Mandatory/Optional | Optional |
Attributes of the Element
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/Optional | Notes |
---|---|---|---|---|---|---|
name | Transition Validators, Transition Executors, Transition User Interfaces and Transition Scripts are one of many well-defined extension points supported by the WSO2 Governance Registry. Read more on Supported Extension Points for a complete list of extension points supported by WSO2 Governance Registry. The user can define only one such element of each kind, since the underline implementation will ignore multiple elements and take only one into consideration. For
|
| Mandatory |
Sample Implementations
<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.carbon.governance.registry.extensions.executors.ServiceVersionExecutor"> </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>
<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 of the Element
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/Optional | Notes |
---|---|---|---|---|---|---|
name | Defines the name of the check item. Governance Registry allows 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
<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 |
Type | |
Default Value | |
Fixed Values | |
Mandatory/Optional | Optional |
This element doesn't have any attributes.
<permission>
XML Syntax | <permission roles=""/> |
---|---|
Description | This element is a child element of the |
Type | |
Default Value | N/A |
Fixed Values | |
Mandatory/Optional | Optional |
Attributes of the Element
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 user roles can be define here with comma (",") separated |
Sample Implementations
<permission roles="admin,manager"/>
<validations>
XML Syntax | |
---|---|
Description | Defines the validations that need to be completed for each action. This element can contain one or more |
Type | |
Default Value | N/A |
Fixed Values | |
Mandatory/Optional | Optional |
This element doesn't have any attributes.
<validation>
XML Syntax | <validation forEvent="" class=""/> |
---|---|
Description | Validations are an important part of lifeCycles. The |
Type | |
Default Value | |
Fixed Values | |
Mandatory/Optional | Optional |
Attributes of the Element
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/Optional | Notes |
---|---|---|---|---|---|---|
forEvent | Defines the event for which this validation should be performed. This gives user the flexibility to define validations for each event. The user has the ability to define validations for check items, which 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 executed at runtime to perform the validation. A user must give the full, qualified name of a class that implements the CustomValidations interface, as the value of the attribute class . | N/A | Mandatory |
Sample Implementations
<validation forEvent="" class=""></validation>
<parameter>
XML Syntax | <parameter name="" value=""/> |
---|---|
Description | The |
Type | |
Default Value | |
Fixed Values | |
Mandatory/Optional | Optional |
Attributes of the Element
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/Optional | Notes |
---|---|---|---|---|---|---|
name | User defined value to identify the parameter. | N/A | Mandatory | |||
value | Defines the value of user defined parameter. | N/A | Mandatory |
Sample Implementations
<parameter name="endpoint.mediatype" value="application/vnd.wso2.endpoint"/>
<js>
XML Syntax | |
---|---|
Description | Governance Registry lifeCycle configuration has the ability to allow JavaScript functions to execute on both the server side and the client side. The |
Type | |
Default Value | N/A |
Fixed Values | |
Mandatory/Optional | Optional |
Attributes of the Element
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/Optional | Notes |
---|---|---|---|---|---|---|
forEvent | Defines the transition action where this JavaScript function needs to be executed. | Mandatory | The forEvent value is defined under the <transition> element with the "event" attribute. |
Sample Implementations
<js forEvent=""> <console function="">....</console> <server function="">....</server> </js>
<console>
XML Syntax | <console function=""/> |
---|---|
Description | Defines the JavaScript function that needs to be executed on the client side. |
Type | |
Default Value | N/A |
Fixed Values | |
Mandatory/Optional | Optional |
Attributes of the Element
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/Optional | Notes |
---|---|---|---|---|---|---|
function | Defines the name of the function which will be executed at a transition from one state to another. | Mandatory |
Sample Implementations
<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 to define any code segment here. |
Type | |
Default Value | N/A |
Fixed Values | |
Mandatory/Optional | Optional |
Attributes of the Element
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/Optional | Notes |
---|---|---|---|---|---|---|
type | Governance Registry supports scripting language. | Set to text/javascript because, at the time of this writing, Governance Registry only supports JavaScript as a scripting language. | Mandatory |
Sample Implementations
<script type="text/javascript"></script>
<server>
XML Syntax | <server function=""/> |
---|---|
Description | This is the same as the |
Type | |
Default Value | |
Fixed Values | |
Mandatory/Optional | Optional |
Attributes of the Element
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/Optional | Notes |
---|---|---|---|---|---|---|
function | Defines the name of the function which will be executed at a transition from one state to another. | Mandatory | Fucntion should be Governance Registry supports scripting language. |
Sample Implementations
<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 in a lifecycle. The |
Type | |
Default Value | |
Fixed Values | |
Mandatory/Optional | Optional |
Attributes of the Element
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/Optional | Notes |
---|---|---|---|---|---|---|
forEvent | Defines the event for which this execution should be performed. This gives user the flexibility to define executions for each event. | Mandatory | The forEvent value is defined under the <transition> element with the "event" attribute. | |||
class | Defines the class that needs to be executed at runtime. A user must give the full, qualified name of a class that implements the Execution interface, as the value of the attribute class . | Mandatory | This class defines the business logic that is executed when the specified event is taken place. This class manipulates the current and target environment of the underlying artifact when the state transition is performed on it. |
Sample Implementations
<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 value hold by the parameter. This parameter element defined under the <execution> element. |
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 attribute defines the name of the parameter. This parameter element defined under the <execution> element. |
| all these parameters are mandatory. | |||
value | value attribute defines that the value hold by the parameter. This parameter element defined under the <execution> element. |
Sample Implementations
<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>
<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 to pass input that would be utilized when performing a transition. Note that, for the value of href, it will not accept any external reference link for the value. It is required to provide a relative path in the carbon server as the value of href. |
Type | |
Default Value | N/A |
Fixed Values | |
Mandatory/Optional | Optional |
Attributes of the Element
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/Optional | Notes |
---|---|---|---|---|---|---|
forEvent | Defines the event for which this UI will be presented. | N/A | Optional | The forEvent value is defined under the <transition> element with the "event" attribute. | ||
href | Defines the hyperlink that will be opened and presented to the user, when a lifecycle transition operation is performed from the Management Console. | N/A | Optional |
Sample Implementations
<ui forEvent="Promote" href="../lifecycles/pre_invoke_aspect_ajaxprocessor.jsp?currentEnvironment=/_system/governance/branches/testing/"/>
See also Transition UI Sample.
<transition>
XML Syntax | <transition event="" target=""/> |
---|---|
Description | Defines the transitions of a state. In Governance Registry 4.1.1 onwards, users are allowed to define the transitions (the name and the target 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 | |
Mandatory/Optional | Mandatory |
Attributes of the Element
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/Optional | Notes |
---|---|---|---|---|---|---|
event | Defines the transition event name, for example, to "Promote" or "Demote" or any name that the user specifies. | N/A | Mandatory | This event name is used in 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
<transition event="Promote" target="Tested"/>