Users can change the default lifecycle model configuration by editing file editing configurations.xml file using the information given below.
File Details
- File Name: configurations.xml
- Location: $CARBON_HOME\repository\confresources
- Purpose:
XML Elements
Click on an element to view its details along with sub element details if any.
Anchor | ||||
---|---|---|---|---|
|
- <aspect>
- <configuration>
- <lifecycle>
- <scxml>
- <state>
- <datamodel>
- <data>
- <item name="" forEvent=""> <item>
- <permissions>
- <permission roles=""/> <permission>
- <validations>
- <validation forEvent="" class=""> <validation>
- <parameter>
- <js forEvent=""> <js>
- <console function=""> <console>
- <script type="text/javascript"> <script>
- <server function=""> <server>
- <script type="text/javascript"> <execution forEvent="" class=""> <script>
- <execution>
- <parameter name="" value=""/>
- <ui forEvent="" href=""/>
- <transition event="" target=""/><parameter>
- <ui>
- <transition>
...
<aspect>
Anchor | ||||
---|---|---|---|---|
|
...
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 |
...
<data>
Anchor | ||||
---|---|---|---|---|
|
XML Syntax | <data name=""/> |
---|---|
Description | Custom |
Type | |
Default Value | |
Fixed Values | |
Mandatory/Optional |
...
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. |
|
Sample Implementations
...
<item>
Anchor | ||||
---|---|---|---|---|
|
XML Syntax | <item name="" forEvent="" |
---|
...
These elements contain the check items for each state. There can be more than one of these elements.
...
/> | |
---|---|
Description |
|
Type | |
Default Value | |
Fixed Values | |
Mandatory/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. |
...
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. |
...
Sample Implementations
...
<permissions>
Anchor | ||||
---|---|---|---|---|
|
XML Syntax | |
---|---|
Description | The |
...
and hold more than one child element which defines permissions. Under check items, the | |
Type | |
Default Value | |
Fixed Values | |
Mandatory/Optional |
This element doesn't have any attributes.
...
<permission>
Anchor | ||||
---|---|---|---|---|
|
XML Syntax | <permission roles=""/> |
---|---|
Description | This element is a child element of the |
...
Type |
Info | ||
---|---|---|
| ||
Check Item Validators 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. |
...
Default Value | |
Fixed Values | |
Mandatory/Optional |
Attributes of the Element
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/Optional | Notes |
---|---|---|---|---|---|---|
roles |
Sample Implementations
...
<validations>
Anchor | ||||
---|---|---|---|---|
|
XML Syntax | |
---|---|
Description | Defines the validations that need to be completed for each action. This element can contain one or more |
...
<validation forEvent="" class="">
Validations are an important part of lifeCycles. The validation
element defines the event and the validation class that has to be invoked at runtime.
- The
forEvent
attribute - 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. - The
class
attribute - 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 theCustomValidations
interface, as the value of the attributeclass
.
<execution forEvent="" class="">
An executor is business logic that is executed once a state transition happens in a lifecycle. The execution
element defines the event and the execution class that will be invoked at runtime.
- The
forEvent
attribute - Defines the event for which this execution should be performed. This gives user the flexibility to define executions for each event. - The
class
attribute - Defines the class that needs to be executed at runtime. A user must give the full, qualified name of a class that implements theExecution
interface, as the value of the attributeclass
.
<parameter name="" value=""/>
The parameter
elements are used to give 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.
<ui forEvent="" href=""/>
A UI element is a mechanism to associate a user interface with a particular event during a given transition. This provides a convinient way for a user to pass input
that would be utilized when performing a transition.
- The
forEvent
attribute - Defines the event for which this UI will be presented. - The
href
attribute - Defines the hyperlink that will be opened and presented to the user, when a lifecycle operation is performed from the Management Console.
<js forEvent="">
Governance Registry 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 executed for different events.
The forEvent
attribute defines the transition action where this JavaScript function needs to be executed.
<console function="">
The console
element defines the JavaScript function that needs to be executed on the client side.
The function
attribute defines the name of the function which will be executed at a transition of one state to another.
<script type="text/javascript">
This element contains the actual JavaScript code segment. A user has the ability to define any code segment here.
The type
attribute is set to text/javascript
because, at the time of this writing, Governance Registry only supports JavaScript as a scripting language.
<server function="">
This is the same as the console
function and the only difference is that this element defines the scripts that need to be executed on the server side.
...
. Check Item Validators 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. | |
Type | |
Default Value | |
Fixed Values | |
Mandatory/Optional |
This element doesn't have any attributes.
...
<validation>
Anchor | ||||
---|---|---|---|---|
|
XML Syntax | <validation forEvent="" class=""/> |
---|---|
Description | Validations are an important part of lifeCycles. The |
Type | |
Default Value | |
Fixed Values | |
Mandatory/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. | |||||
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 . |
Sample Implementations
...
<parameter>
Anchor | ||||
---|---|---|---|---|
|
XML Syntax | <parameter name="" value=""/> |
---|---|
Description | The |
Type | |
Default Value | |
Fixed Values | |
Mandatory/Optional |
Attributes of the Element
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/Optional | Notes |
---|---|---|---|---|---|---|
name |
| |||||
value |
Sample Implementations
...
<js>
Anchor | ||||
---|---|---|---|---|
|
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 | |
Fixed Values | |
Mandatory/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. |
Sample Implementations
...
<console>
Anchor | ||||
---|---|---|---|---|
|
XML Syntax | <console function=""/> |
---|---|
Description | Defines the JavaScript function that needs to be executed on the client side. |
Type | |
Default Value | |
Fixed Values | |
Mandatory/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. |
Sample Implementations
...
<script>
Anchor | ||||
---|---|---|---|---|
|
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 | |
Fixed Values | |
Mandatory/Optional |
Attributes of the Element
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/Optional | Notes |
---|---|---|---|---|---|---|
type |
| Set to text/javascript because, at the time of this writing, Governance Registry only supports JavaScript as a scripting language. |
Sample Implementations
...
<server>
Anchor | ||||
---|---|---|---|---|
|
XML Syntax | <server function=""/> |
---|---|
Description | This is the same as the |
Type | |
Default Value | |
Fixed Values | |
Mandatory/Optional |
Attributes of the Element
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/Optional | Notes |
---|---|---|---|---|---|---|
function |
|
Sample Implementations
...
<Execution>
Anchor | ||||
---|---|---|---|---|
|
XML Syntax | <execution forEvent="" class=""/> |
---|---|
Description | An executor is business logic that is executed once a state transition happens in a lifecycle. The |
Mandatory/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. It gives user the flexibility to define executions for each event. A valid event value must be given to this attribute. | String | N/A |
| Mandatory | promote/demote/publish - When this event is invoked, the life cycle's state changes from its current state to the target state which is defined in the "target" attribute of the <transition> element. |
class | Defines the class that needs to be executed at runtime, when the user invokes the corresponding event within a given state. This class consists of business logic to be executed and facilitates environment changes during state transitions. A user must give the full, qualified name of a class that implements the | String | N/A | org.wso2.carbon.governance.registry.extensions. | Mandatory | The class named "org.wso2.carbon.governance .registry.extensions.executors.ServiceVersionExecutor" does provide the necessary business logic for the complete default lifecycle configuration model. |
Sample Implementations
Code Block |
---|
<execution forEvent="Promote" class="org.wso2.carbon.governance.registry.extensions.executors.ServiceVersionExecutor"> |
...
<parameter>
Anchor | ||||
---|---|---|---|---|
|
XML Syntax | <parameter name="" value=""/> |
---|---|
Description | The parameter elements incorporate the transition of the underlying resource by changing the environment during the state transition by providing the necessary arguments for the methods defined in the business class which is declared by the class attribute within the <execution> element. The value of the name attribute can be given any name, but it has to be referred by the given name at the back end class defined within the <execution> element. If we omit the <parameter> element under the <execution> element during the state transition, the underlying resource does not move its environment(its storage path). |
Mandatory/Optional | Optional |
Attributes of the Element
Attribute | Description | Type | Default Value | Fixed Values | Mandatory/Optional | Notes |
---|---|---|---|---|---|---|
name | The 'name' attribute is referred by the business logic defined in the 'class' attribute of the <execution> element. | String | N/A |
| Mandatory | User should define a name for the given name attribute of the <parameter> element. It does not have any default values. Parameter will be referred later on by its name. |
value | The 'value' attribute is used to compute the parameter's logic. | String | N/A | N/A | Mandatory | Since the artifacts are to be governed, the current and target environment have to start with "/_system/governance". In other words, the artifacts that are governed must be stored under "/_system/governance/" directory at any state transition. The value of the media types are predefined. Those values can't be changed. |
Sample Implementations
Code Block |
---|
<execution forEvent="Promote" class="org.wso2.carbon.governance.registry.extensions.executors.ServiceVersionExecutor">
<parameter name="currentEnvironment" value="/_system/governance/branches/testing/{@resourcePath}/{@version}/{@resourceName}"/>
<parameter name="targetEnvironment" value="/_system/governance/branches/production/{@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> |
...
<ui>
Anchor | ||||
---|---|---|---|---|
|
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. |
Type | |
Default Value | |
Fixed Values | |
Mandatory/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. | |||||
href | Defines the hyperlink that will be opened and presented to the user, when a lifecycle operation is performed from the Management Console. |
Sample Implementations
...
<transition>
Anchor | ||||
---|---|---|---|---|
|
XML Syntax | <transition event="" target=""/> |
---|---|
Description |
...
Defines the transitions of a state. In Governance Registry 4.1.1, 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 | |
Fixed Values | |
Mandatory/Optional |
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. |
...
target | Defines the target state of the transition. |
Sample Implementations
Excerpt | ||
---|---|---|
| ||
The description of lifeCycle configuration model and its elements. |