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

...

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

...

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

 

...

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

...

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

...