Petals-SE-Activity 1.0.0-SNAPSHOT

compared with
Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (36)

View Page History
h2. Creating the service contract


The SE Activity provides a service with several operation for a process definition. A WSDL is associated to this service. This WSDL can be written freely. The user can use its own namespace, its own names, ... It is only constraint by the following rules:
* the operations of the binding section *are annotated* to link them to the supported operations (create an instance of the process definition, complete the current task of the process instance, ...)
The mapping between operations of the WSDL and operations supported by the SE Activity is declared using a dedicated binding. The binding "Activity" is done adding the element {{\{http://petals.ow2.org/se/activity/1.0}operation}} to the element operation of the binding. Its attribute *{{activityAction}}* defines the operation that will be executed.

In the same way, parameters of operations are mapped through an annotation placed inside the message of the binding operation. This annotation is done adding the element {{\{http://petals.ow2.org/se/activity/1.0}parameter}} to the input and output messages. This annotation takes two attributes:
* the attribute *{{activityParamName}}* defines the variable name used in the process definition,
* the attribute *{{activityParamValue}}* defines the value to set to the variable using an XPath expression.
h3. Identifying parameters of operations

In the same way, parameters of operations are mapped through an annotation placed inside the message of the binding operation.

For input parameters, this annotation is done adding the element {{\{http://petals.ow2.org/se/activity/1.0}input-parameter}}. This annotation takes two attributes:
* the attribute *{{name}}* defines the variable name used in the process definition,
* the attribute *{{value}}* defines the value to set to the variable using an XPath expression.

For output parameters, the annotation is done adding the element {{\{http://petals.ow2.org/se/activity/1.0}output-parameter}}.

{color:red}*What about fault ?*{color}

h3. Operations

h4. Create an instance of a process definition

The operation creating instances of process definition is identified by the value *{{createProcInstOp}}* set on the attribute {{activityAction}}:
{code}
<wsdl:binding name="Order">
<wsdl:binding name="Order" xmlns:activity="http://petals.ow2.org/se/activity/1.0">
<wsdl:operation name="newOrder" type="...">
<activity:operation xmlns:psa="http://petals.ow2.org/se/activity/1.0" activityAction="createProcInstOp" />
activityAction="createProcInstOp" <activity:input-parameter name="customerName" value="/newOrderRequest/customerName" />
<activity:input-parameter name="address" value="/newOrderRequest/address" />
<activity:output-parameter name="activity:processInstId" stakeholder="/newOrderResponse/orderId" />
<wsdl:input/>
<wsdl:output/>
The operation completing a task of a process instance is identified by the value *{{completeTaskOp}}* set on the attribute {{activityAction}}:
{code}
<wsdl:binding name="Order">
<wsdl:binding name="Order" xmlns:activity="http://petals.ow2.org/se/activity/1.0" >
<wsdl:operation name="validOrder" type="...">
<activity:operation xmlns:psa="http://petals.ow2.org/se/activity/1.0" activityAction="completeTaskOp" />
activityAction="completeTaskOp" />
<wsdl:input/>
<wsdl:output/>
The operation retrieving process instances is identified by the value *{{retrieveProcInst}}* set on the attribute {{activityAction}}:
{code}
<wsdl:binding name="Order">
<wsdl:binding name="Order" xmlns:activity="http://petals.ow2.org/se/activity/1.0">
<wsdl:operation name="searchOrder" type="...">
<activity:operation xmlns:psa="http://petals.ow2.org/se/activity/1.0" activityAction="retrieveProcInst" />
activityAction="retrieveProcInst" />
<wsdl:input/>
<wsdl:output/>
{code}
<?xml version="1.0" encoding="UTF-8"?>

<wsdl:definitions xmlns:tns="http://petals.ow2.org/se/activity/sample/order"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
<wsdl:types>
<xs:schema targetNamespace="http://petals.ow2.org/se/activity/sample/order">
<xs:complexType name="ItemType">
<xs:sequence>
<xs:element name="reference" type="xs:string" />
<xs:element name="quantity" type="xs:int" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="ItemType">
<xs:sequence>
<xs:element name="reference" type="xs:string" />
<xs:element name="quantity" type="xs:int" />
</xs:sequence>
</xs:complexType>
<xs:element name="newOrderRequest">
<xs:complexType>
<xs:sequence>
<xs:element name="customerName" type="xs:string" />
<xs:element name="address" type="xs:string" />
<xs:element name="items">
<xs:complexType>
</xs:element>
<xs:element name="newOrderResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="orderId" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:complexType>
<xs:sequence>
<xs:element name="orderId" type="xs:string" />
</xs:sequence>
</xs:complexType>
</xs:element>

</xs:schema>
</wsdl:types>

<!-- Message definitions for input and output -->
<wsdl:message name="newOrderRequest">
<wsdl:part name="newOrderRequest" element="tns:newOrderRequest" />
</wsdl:message>

<!-- Port (interface) definitions -->
<wsdl:portType name="Order">
<wsdl:operation name="newOrder">
<wsdl:output message="tns:newOrderResponse" />
</wsdl:operation>
<wsdl:operation name="validOrder">
<wsdl:input message="tns:validOrderRequest" />
<wsdl:output message="tns:validOrderResponse" />
</wsdl:operation>
<wsdl:operation name="searchOrder">
<wsdl:input message="tns:searchOrderRequest" />
<wsdl:output message="tns:searchOrderResponse" />
</wsdl:operation>
<wsdl:operation name="validOrder">
<wsdl:input message="tns:validOrderRequest" />
<wsdl:output message="tns:validOrderResponse" />
</wsdl:operation>
<wsdl:operation name="searchOrder">
<wsdl:input message="tns:searchOrderRequest" />
<wsdl:output message="tns:searchOrderResponse" />
</wsdl:operation>
</wsdl:portType>

<wsdl:definitions xmlns:tns="http://petals.ow2.org/se/activity/sample/order"
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
targetNamespace="http://petals.ow2.org/se/activity/sample/order">
xmlns:activity="http://petals.ow2.org/se/activity/1.0" targetNamespace="http://petals.ow2.org/se/activity/sample/order">

<wsdl:import location="OrderAbstract.wsdl"
namespace="http://petals.ow2.org/se/activity/sample/order" />

<!-- Port bindings to map operation with Activity -->
<!-- Port bindings to transports and encoding - HTTP, document literal encoding
is used -->
<wsdl:binding name="OrderBinding" type="tns:Order">
<wsdl:operation name="newOrder">
<activity:operation activityAction="createProcInstOp" />
<activity:input-parameter name="customerName" value="/newOrderRequest/customerName" />
<activity:input-parameter name="address" value="/newOrderRequest/address" />
<activity:output-parameter name="activity:processInstId" stakeholder="/newOrderResponse/orderId" />
<wsdl:input />
<wsdl:output />
</wsdl:operation>
<wsdl:operation name="validOrder">
<wsdl:input />
<wsdl:output />
</wsdl:operation>
<wsdl:operation name="searchOrder">
<wsdl:input />
<wsdl:output />
</wsdl:operation>
<wsdl:operation name="validOrder">
<activity:operation activityAction="completeTaskOp" />
<wsdl:input />
<wsdl:output />
</wsdl:operation>
<wsdl:operation name="searchOrder">
<activity:operation activityAction="retrieveProcInst" />
<wsdl:input />
<wsdl:output />
</wsdl:operation>
</wsdl:binding>