Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Note

WSO2 Enterprise Store uses the lifecycle API provided by WSO2 Governance Registry. However, ES but does not support all the lifecycle elements provided by the WSO2 Governance Registry.

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>                                     <execution>
  •                                           <parameter>
  •                          <transition>

...

...

Anchor
aspect
aspect

<aspect> 

...

AttributeDescriptionDefault ValueFixed ValuesMandatory/
Optional
Notes
name

Defines the extension point (e.g., Transition Executors) that is used in the lifecycle.

You can define only one extension point of a kind, because the underlined implementation ignores multiple elements and takes only one into consideration.

 
  • checkItems - If the user is defining check items as its child elements.
  • transitionExecution - If the data element defines programmable executions for transitions.
Mandatory 
Sample implementations
checkItems
Code Block
<data name="checkItems">
   <item name="Effective Inspection Completed" forEvent="" />
   <item name="Test Cases Passed" forEvent="" />
   <item name="Smoke Test Passed" forEvent="" />
</data>

The above code snippet based on checkItems renders as follows in the Publisher:

 

transitionExecution
Code Block
 
Code Block
languagehtml/xml

<data name="checkItemstransitionExecution">
	<item name="Code Completed"  <execution forEvent="Promote"> 	<item name="WSDL, Schema Created" forEvent="">
</data>

<dataclass="org.wso2.jaggery.scxml.generic.GenericExecutor">
      <parameter name="transitionValidationPERMISSION:get"> 	<validation forEvent="" class="">
		value="http://www.wso2.org/projects/registry/actions/get" />
      <parameter name="PERMISSION:add" value="http://www.wso2.org/projects/registry/actions/add" />
	</validation>
</data>
      <data<parameter name="transitionPermissionPERMISSION:delete"> 	<permission forEvent="" roles=""/>
</data>

<datavalue="http://www.wso2.org/projects/registry/actions/delete" />
      <parameter name="transitionScriptsPERMISSION:authorize">
    <js forEvent value="authorize" />
        <console function=""<parameter name="STATE_RULE1:Created" value="Internal/private_{asset_author}:+get,+add,+delete,+authorize" />
      <parameter      <script type="text/javascript">
  name="STATE_RULE2:Created" value="Internal/reviewer:-get,-add,-delete,-authorize" />
      <parameter name="STATE_RULE3:Created"  </script>value="Internal/everyone:-get,-add,-delete,-authorize" />
        </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> 

...

</execution>
</data>

Back to Top ^

...

Anchor
item
item

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

Mandatory/OptionalOptional
Attributes
AttributeDescriptionDefault ValueFixed ValuesMandatory/
Optional
nameDefines 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 may be needed for more than one event, in which case, you can provide a comma separated list for the forEvent attribute.

Info

The forEvent value is defined under the <transition> element with the event attribute.

Null - Keeping the forEvent attribute empty means that a specific check item is not required for any transition event. Optional
Sample implementations
Code Block
languagehtml/xml
<data name="checkItems">
   <item name="Effective Inspection Completed" forEvent="" />
   <item name="Test Cases Passed" forEvent="" />
   <item name="Smoke Test Passed" forEvent="" />
</data>

The above code snippet based on checkItems renders as follows in the Publisher:

Image Added

Back to Top ^

...

Anchor
execution
execution

<execution> 

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

An executor is business logic that is executed once a state transition takes place in a lifecycle. The execution element defines the event and the execution class that is invoked at runtime.

Mandatory/OptionalOptional
Attributes
AttributeDescriptionDefault ValueFixed ValuesMandatory/
Optional
Notes
nameforEvent

Defines the

name of the check item. ES allows you to define check items for each transition.
N/A Optional 
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. OptionalThe forEvent value is defined under the <transition> element with the event  attribute.
Sample implementations
Code Block
languagehtml/xml
<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>

 

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 is executed for different events.

Mandatory/OptionalOptional
Attributes
AttributeDescriptionDefault ValueFixed ValuesMandatory/OptionalNotes
forEvent

Defines the respective transition for which the JavaScript function is executed.

  MandatoryThe forEvent value is defined under the <transition> element with the event  attribute.
Sample implementations
Code Block
languagehtml/xml
<js forEvent="">
     <console function="">....</console>
     <server function="">....</server>
</js>

 

Back to Top ^

...

<console> 

XML Syntax<console function=""/>
Description

Defines the JavaScript function that ES needs to execute on the client-side.

Mandatory/OptionalOptional
Attributes
AttributeDescriptionDefault ValueFixed ValuesMandatory/OptionalNotes
function

Defines the name of the function that is executed when an asset moves from one lifecycle state to another.

  Mandatory 
Sample implementations
Code Block
languagehtml/xml
<console function="">
	<script type="text/javascript"> </script>
</console>

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

Mandatory/OptionalOptional
Attributes
AttributeDescriptionDefault ValueFixed ValuesMandatory/
Optional
Notes
function

Defines the name of the function that is executed at an asset transition from one state to another.

  MandatoryThe function should be a ES supported scripting language.
Sample implementations
Code Block
languagehtml/xml
<server function="">
	<script type="text/javascript"></script>
</server>

 

Back to Top ^

...

<Execution> 

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

An executor is business logic that is executed once a state transition takes place in a lifecycle. The execution element defines the event and the execution class that is invoked at runtime.

Mandatory/OptionalOptional
Attributes
AttributeDescriptionDefault ValueFixed ValuesMandatory/
Optional
Notes
forEvent

Defines the event for which this execution is performed. This gives you the flexibility to define executions for each event.

  MandatoryThe forEvent value is defined under the <transition> element with the event attribute.
classDefines the class that 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.   MandatoryThis class defines the business logic that is executed when the specified event 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">

 

Back to Top ^

...

<parameter> 

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

The name attribute defines the name of the parameter and value attribute defines the corresponding value of the parameter. This parameter element is defined under the <execution> element.

Mandatory/OptionalOptional
Attributes

...

This attribute defines the name of the parameter. 

...

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 allows you to pass inputs that would be utilized when performing a transition. Note that you can not define an external reference link as the href attribute value. Instead you need to provide a relative path in the Carbon server as the value of the href attribute.

Mandatory/OptionalOptional
Attributes
AttributeDescriptionDefault ValueFixed ValuesMandatory/
Optional
Notes
forEvent

Defines the event for which the UI appears.

N/A OptionalThe forEvent value is defined under the <transition> element with the event  attribute.
hrefDefines the hyperlink that 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
languagehtml/xml
<ui forEvent="Promote" href="../lifecycles/pre_invoke_aspect_ajaxprocessor.jsp?currentEnvironment=/_system/governance/branches/testing/"/>

...

event for which this execution is performed. This gives you the flexibility to define executions for each event.
The forEvent value is defined under the <transition> element using the event attribute. 

  Mandatory
classDefines the class that 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.
This class defines the business logic that is executed when the specified event takes place. This class manipulates the current and target environment of the underlying artifact when the state transition is performed on it. 
  Mandatory
Sample implementations
Code Block
<execution forEvent="Promote" class="org.wso2.jaggery.scxml.generic.GenericExecutor">

 

Back to Top ^

...

Anchor
parameter
parameter

<parameter> 

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

The name attribute defines the name of the parameter and value attribute defines the corresponding value of the parameter. This parameter element is defined under the <execution> element.

Mandatory/OptionalOptional
Attributes
AttributeDescriptionDefault ValueFixed ValuesMandatory/
Optional
name

This attribute defines the name of the parameter. 

  • If you use the org.wso2.jaggery.scxml.generic.GenericExecutor executor, it is mandatory to specify the following default permissions as it is needed for the ES permission model.
    • PERMISSION:get
    • PERMISSION:add

    • PERMISSION:delete

    • PERMISSION:authorize

  • In addition, you can specify custom rules for specific user roles that are executed when various state transitions take place.
 
  • ES permission model related values
    • PERMISSION:get
    • PERMISSION:add

    • PERMISSION:delete

    • PERMISSION:authorize

The first four parameters are mandatory.
valueThis attribute defines the value held by the parameter.
  • If you use the org.wso2.jaggery.scxml.generic.GenericExecutor executor, it is mandatory to specify the following default permissions names together with their corresponding values as it is needed for the ES permission model.
    • PERMISSION:get
    • PERMISSION:add

    • PERMISSION:delete

    • PERMISSION:authorize

  • In addition, you can specify custom rules for specific user roles that are executed when various state transitions take place. In each of these rules you can specify as to which permission is added or removed when the state transition takes place. Permissions are added and removed in the following manner:
    • + <PERMISSION>
      For example,  + delete means that the delete permission is added when the lifecycle state transition occurs.
    • - <PERMISSION>
      For example,  - delete means that the delete permission is removed when the lifecycle state transition occurs.  

 For example:

    • Code Block
      <parameter name="STATE_RULE1:Created" value="Internal/private_{asset_author}:+get,+add,+delete,+authorize" />

      This means that when the lifecycle state changes to Created, the get, add, delete and authorize permissions are added to the private_{asset_author} user permission.

    • Code Block
      <parameter name="STATE_RULE2:Created" value="Internal/reviewer:-get,-add,-delete,-authorize" />

      This means that when the lifecycle state changes to Created, the get, add, delete and authorize permissions are removed from the Internal/reviewer user permission.

    • Code Block
      <parameter name="STATE_RULE3:Created" value="Internal/everyone:-get,-add,-delete,-authorize" />

      This means that when the lifecycle state changes to Created, the get, add, delete and authorize permissions are removed from the Internal/everyone user permission.

 
 
  • ES permission model related values

    • http://www.wso2.org/projects/registry/actions/get

    • http://www.wso2.org/projects/registry/actions/add

    • http://www.wso2.org/projects/registry/actions/delete

    • authorize

 
Sample implementations
Code Block
<data name="transitionExecution">
   <execution forEvent="Promote" class="org.wso2.jaggery.scxml.generic.GenericExecutor">
      <parameter name="PERMISSION:get" value="http://www.wso2.org/projects/registry/actions/get" />
      <parameter name="PERMISSION:add" value="http://www.wso2.org/projects/registry/actions/add" />
      <parameter name="PERMISSION:delete" value="http://www.wso2.org/projects/registry/actions/delete" />
      <parameter name="PERMISSION:authorize" value="authorize" />
      <parameter name="STATE_RULE1:Created" value="Internal/private_{asset_author}:+get,+add,+delete,+authorize" />
      <parameter name="STATE_RULE2:Created" value="Internal/reviewer:-get,-add,-delete,-authorize" />
      <parameter name="STATE_RULE3:Created" value="Internal/everyone:-get,-add,-delete,-authorize" />
   </execution>
</data>

Back to Top ^

...

Anchor
transition
transition

...

XML Syntax<transition event="" target=""/>
Description

Defines the transitions, by specifying the name of the lifecycle state and the target lifecycle state, instead of using static transitions. Any number of transitions for one lifecycle state are supported.

Mandatory/OptionalMandatory
Attributes
AttributeDescriptionDefault ValueFixed ValuesMandatory/
Optional
Notes
event

Defines the transition event name , (e.g., Promote, Demote or any name that the user specifies.

N/A Mandatory

you wish to specify).

This event name is used in the forEvent to trigger a specific event, before this transition this going on.

N/A Mandatory
targetDefines the target state of the transition.N/A Mandatory 
Sample implementations
Code Block
languagehtml/xml
<transition event="Promote" target="Tested"/>

...