Versions Compared

Key

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

...

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

 promote

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).
  • Promote
  • Demote
  • Publish
Mandatory - valid event value must be given.

promote/demote/publish - When

invoke

this event

the LC state change

is invoked, the life cycle's state changes from its current state to the target state which is defined

within

in the

<transition> element by 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

, as the value of the attribute class

.

 String  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

...

N/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/Optional Optional
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.
If the user hasn't defined a value here, does it get a default value?

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.
Is the name attribute mandatory?
  • 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. value The 'value' attribute is used to compute the parameter's logic.     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>

...