...
- <aspect>
- <configuration>
- <lifecycle>
- <scxml>
- <state>
- <datamodel>
- <data>
- <item>
- <permissions>
- <permission>
- <validations>
- <validation>
- <parameter>
- <js>
- <console>
- <script>
- <server>
- <script>
- <execution>
- <parameter>
- <ui>
- <transition>
...
XML Syntax | <execution forEvent="" class=""/> |
---|---|
Description | An executor is business logic that is executed once a state transition happens in a lifecycle. 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 execution should be performed. This It gives user the flexibility to define executions for each event. A valid event value must be given to this attribute. | String | N/A promote |
| demote
|
| Mandatory - valid event value must be given.
| Mandatory | promote/demote/publish - When invokethis event the LC state changeis invoked, the life cycle's state changes from its current state to the target state which is defined within the <transition> element byin the "target" attribute of the <transition> element. | ||
class | 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 attribute class . | mandatory | This 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 , 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 element is defined under the <execution> element. The parameter element contains the name and value attributes itself. The parameter will be referred by its name attribute by the business logic that has been defined by the "class" attribute defined within the "<execution>" element and the corresponding parameter's value which is denoted by the value attribute will be used to compute the logic. |
Type | |
Default Value | |
Fixed Values | |
Mandatory/Optional |
Attributes of the Element
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 parameter will be referred by its name attribute 'name' attribute is referred by the business logic that has been defined by in the "'class" ' attribute defined within 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". | |
value | parameter's value which is denoted by the value attribute will be used to compute the logic. |
Sample Implementations
...
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 | ||||
---|---|---|---|---|
|
...