Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

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

  • <aspect>
  •       <configuration>
  •            <lifecycle>
  •                <scxml>
  •                     <state>
  •                          <datamodel>
  •                               <data>
  •                                     <item>
  •                                           <permissions>
  •                                                 <permission>
  •                                           <validations>
  •                                                 <validation>
  •                                                       <parameter>
  •                                     <js>
  •                                           <console>
  •                                                 <script>
  •                                           <server>
  •                                                 <script>
  •                                     <execution>
  •                                           <parameter>
  •                                     <ui>
  •                          <transition>

...

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> 
Anchor
item
item

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

 

Type 
Default Value 
Fixed Values 
Mandatory/Optional 

...

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> 
Anchor
permissions
permissions

...

This element doesn't have any attributes.

Back to Top ^

...

<permission> 
Anchor
permission
permission

...

AttributeDescriptionTypeDefault ValueFixed ValuesMandatory/OptionalNotes
roles      
Sample Implementations

 

Back to Top ^

...

<validations> 
Anchor
validations
validations

...

This element doesn't have any attributes.

Back to Top ^

...

<validation> 
Anchor
validation
validation

...

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>
Anchor
parameter
parameter

...

AttributeDescriptionTypeDefault ValueFixed ValuesMandatory/OptionalNotes
name

 

     
value      
Sample Implementations

 

Back to Top ^

...

<js>
Anchor
js
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 

...

AttributeDescriptionTypeDefault ValueFixed ValuesMandatory/OptionalNotes
forEvent

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

     
Sample Implementations

 

Back to Top ^

...

<console>
Anchor
console
console

...

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>
Anchor
script
script

...

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>
Anchor
server
server

...

AttributeDescriptionTypeDefault ValueFixed ValuesMandatory/OptionalNotes
function

 

     
Sample Implementations

 

Back to Top ^

...

<Execution>
Anchor
execution
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 It gives user the flexibility to define executions for each event.

     
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.     
Sample Implementations

 

Back to Top ^

...

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.

     
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.     
Sample Implementations

...

A valid event value must be given to this attribute.

String

N/A

  • Promote - Event transits the LC state to next level.(development to QA)
  • Demote - Event transits the LC state to previous state.(QA to development)
  • Publish - Event transits the LC state from production to publish.(production to API Store).
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 Execution interface.

StringN/A
org.wso2.carbon.governance.registry.extensions.
executors.ServiceVersionExecutor
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">

 

Back to Top ^

...

<parameter>
Anchor
executionPara
executionPara

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

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.
MandatoryUser 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.
valueThe 'value' attribute is used to compute the parameter's logic.StringN/AN/AMandatorySince 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>

Back to Top ^

...

<ui>
Anchor
ui
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 

...

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>
Anchor
transition
transition

...

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 ^

Excerpt
hiddentrue

The description of lifeCycle configuration model and its elements.