This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 39 Next »

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 
Description 
Type 
Default Value 
Fixed Values 
Mandatory/Optional 
Samples 
Attributes of the Element
AttributeDescriptionTypeDefault ValueFixed ValuesMandatory/OptionalNotes
nameContains the name of the lifeCycle. Governance Registry does not allow you to create two lifeCycles with the same name. N/A   
classDefines the class that is associated with the lifeCycle. 

org.wso2.carbon.governance.

registry.extensions.aspects.

DefaultLifeCycle

  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">

Back to Top ^


<configuration> 

XML Syntax 
Description 
Type 
Default Value 
Fixed Values 
Mandatory/Optional 
Attributes of the Element
AttributeDescriptionTypeDefault ValueFixed ValuesMandatory/OptionalNotes
type   

literal - If the configuration is setup through the management console

resource - If the configuration is setup through registry.xml

  
Sample Implementations
<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. 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 
Attributes of the Element
AttributeDescriptionTypeDefault ValueFixed ValuesMandatory/OptionalNotes
xmlns      
version      
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="">

Back to Top ^


<state> 

XML Syntax 
Description

The state element defines the states of the lifecycle. A lifecycle can have multiple states, and in the configuration, more than one state element can be given.

Type 
Default Value 
Fixed Values 
Mandatory/Optional 
Attributes of the Element
AttributeDescriptionTypeDefault ValueFixed ValuesMandatory/OptionalNotes
id      
Sample Implementations

 

Note

Governance Registry does not support multiple states with the same name and, therefore, all the state names of a lifecycle should be unique.

Back to Top ^


<datamodel> 

XML Syntax 
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 
Fixed Values 
Mandatory/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 
Fixed Values 
Mandatory/Optional 
Attributes of the Element
AttributeDescriptionTypeDefault ValueFixed ValuesMandatory/OptionalNotes
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.

  
  • 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 user input for transitions.
  
Sample Implementations

 

Back to Top ^


<item> 

XML Syntax<item name="" forEvent=""/>
Description

 

Type 
Default Value 
Fixed Values 
Mandatory/Optional 
Attributes of the Element
AttributeDescriptionTypeDefault ValueFixed ValuesMandatory/OptionalNotes
nameDefines the name of the check item.

Governance Registry allows to define check items for each transition.

     
forEventDefines 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

 

Back to Top ^


<permissions> 

XML Syntax 
Description

The permissions element defines permissions for that specified action and hold more than one child element which 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 
Mandatory/Optional 

This element doesn't have any attributes.

Back to Top ^


<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 Governance Registry.

Type 
Default Value 
Fixed Values 
Mandatory/Optional 
Attributes of the Element
AttributeDescriptionTypeDefault ValueFixed ValuesMandatory/OptionalNotes
roles      
Sample Implementations

 

Back to Top ^


<validations> 

XML Syntax 
Description

Defines the validations that need to be completed for each action. This element can contain one or more validation elements. 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.

Back to Top ^


<validation> 

XML Syntax<validation forEvent="" class=""/>
Description

Validations are an important part of lifeCycles. The validation element defines the event and the validation class that has to be invoked at runtime.

Type 
Default Value 
Fixed Values 
Mandatory/Optional 
Attributes of the Element
AttributeDescriptionTypeDefault ValueFixed ValuesMandatory/OptionalNotes
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.

     
classDefines 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

 

Back to Top ^


<parameter>

XML Syntax<parameter name="" value=""/>
Description

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.

Type 
Default Value 
Fixed Values 
Mandatory/Optional 
Attributes of the Element
AttributeDescriptionTypeDefault ValueFixed ValuesMandatory/OptionalNotes
name

 

     
value      
Sample Implementations

 

Back to Top ^


<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 js element defines the scripts that need to be executed for different events.

Type 
Default Value 
Fixed Values 
Mandatory/Optional 
Attributes of the Element
AttributeDescriptionTypeDefault ValueFixed ValuesMandatory/OptionalNotes
forEvent

 Defines the transition action where this JavaScript function needs to be executed.

     
Sample Implementations

 

Back to Top ^


<console>

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
AttributeDescriptionTypeDefault ValueFixed ValuesMandatory/OptionalNotes
function

Defines the name of the function which will be executed at a transition from one state to another.

     
Sample Implementations

 

Back to Top ^


<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 
Fixed Values 
Mandatory/Optional 
Attributes of the Element
AttributeDescriptionTypeDefault ValueFixed ValuesMandatory/OptionalNotes
type

 

  Set to text/javascript because, at the time of this writing, Governance Registry only supports JavaScript as a scripting language.  
Sample Implementations

 

Back to Top ^


<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 executed on the server side.

Type 
Default Value 
Fixed Values 
Mandatory/Optional 
Attributes of the Element
AttributeDescriptionTypeDefault ValueFixed ValuesMandatory/OptionalNotes
function

 

     
Sample Implementations

 

Back to Top ^


<Execution>

XML Syntax<execution forEvent="" class=""/>
Description

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.

Type 
Default Value 
Fixed Values 
Mandatory/Optional 
Attributes of the Element
AttributeDescriptionTypeDefault ValueFixed ValuesMandatory/OptionalNotes
forEvent

Defines the event for which this execution should be performed. This gives user the flexibility to define executions for each event.

 
  1. promote - Event transits the LC state to next level.(development to QA)
  2. demote - Event transits the LC state to previous state.(QA to development)
  3. publish - Event transits the LC state from production to publish.(production to API Store).
  • Promote
  • Demote
  • Publish
Mandatory - valid event value must be given.
  • promote/demote/publish - When invoke this event the LC state change from its current state to target state which is defined within the <transition> element by the "target" attribute.
classDefines 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.   mandatoryThis class consists of business logic which will be executed when the user invoke the corresponding event within a given state. This class facilitates the environment changes during the state transition
Sample Implementations
<execution forEvent="Promote" class="org.wso2.carbon.governance.registry.extensions.executors.ServiceVersionExecutor">

 

Back to Top ^


<parameter>

XML Syntax<parameter name="" value=""/>
Description

 

Mandatory/OptionalOptional
Attributes of the Element
AttributeDescriptionTypeDefault ValueFixed ValuesMandatory/OptionalNotes
name

The 'name' attribute is referred by the business logic defined in the 'class' attribute of the <execution> element.

  • String Literal: The values 'currentEnvironment' and 'targetEnvironment' are of String Literal type.
  • MIME Media Type: The values 'service.mediatype', 'wsdl.mediatype' and 'endpoint.mediatype' denote the  parameters.
N/A
  • currentEnvironment - Denotes the fully-qualified path of the resource under the current state, which is the state in which the resource is currently in.
  • targetEnvironment - Denotes the path to which the resource has to move during state transition. 
  • service.mediatype - Points out the MIME mediatype of the service artifact.
  • wsdl.mediatype - Points out the MIME mediatype of the WSDL artifact.
  • endpoint.mediatype - Points out the MIME mediatype of the artifact name Endpoint.
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.

valueThe 'value' attribute is used to compute the parameter's logic. N/AN/AMandatory 
Sample Implementations
<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>

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 to pass input that would be utilized when performing a transition.

Type 
Default Value 
Fixed Values 
Mandatory/Optional 
Attributes of the Element
AttributeDescriptionTypeDefault ValueFixed ValuesMandatory/OptionalNotes
forEvent

Defines the event for which this UI will be presented.

     
hrefDefines the hyperlink that will be opened and presented to the user, when a lifecycle operation is performed from the Management Console.     
Sample Implementations

 

Back to Top ^


<transition>

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
AttributeDescriptionTypeDefault ValueFixed ValuesMandatory/OptionalNotes
event

Defines the transition event name, for example, to "Promote" or "Demote" or any name that the user specifies.

     
targetDefines the target state of the transition.     
Sample Implementations

 

Back to Top ^

  • No labels