|
Key
This line was removed.
This word was removed. This word was added.
This line was added.
|
Changes (11)
View Page History{section}
h1. Creating a service-unit for a process definition
h1. Using the mode "service"
h2. Creating the service contract
h2. Creating a service-unit for a process definition
h3. Creating the service contract
The SE Activiti 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 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, ...)
{tip}For a unit test purpose, an extension of JUnit is available to validate your WSDL not only in a pur WSDL point of view, but also in a SE Activiti point of view. See chapter "[Unit testing|#Unit_Testing]".{tip}
h34. Identifying operations
The mapping between operations of the WSDL and operations supported by the SE Activiti is declared using a dedicated binding. The binding "Activiti" is done adding the element {{\{http://petals.ow2.org/se/activiti/1.0}operation}} to the element operation of the binding. Its attribute *{{activitiAction}}* defines the operation that will be executed.
h34. Identifying input parameters of operations
In the same way, input parameters of operations are mapped through an annotation placed inside the message of the binding operation. Two natures of input parameters exists: the expected input parameters and variables. Each Activiti operation can require mandatory or optional input parameter and can accept to set several variables in the same time.
{color:red}*TODO. Les types ?; les arborescences*{color}
h34. Identifying output parameters of operations
Output parameters of the Activiti operation can not be set into the output reply of the service operation using a simple XPath expression as for input parameters. An XSL style-sheet is required to generated the full output reply. It is identified using the annotation adding the element {{\{http://petals.ow2.org/se/activiti/1.0}output}}. The XSL style-sheet name is set into the attribute {{*xsl*}} and loaded from the classloader. The XSL style-sheets are mainly located in the service-units, they can also be packaged as a shared library.
{color:red}*What about fault ?*{color}
h34. Associating an operation to the creation of an process definition instance
The operation creating instances of process definition is identified by the value *{{createProcInstOp}}* set on the attribute {{activitiAction}}:
It is possible to map several operations of the WSDL to the creation of process instances, but this has perhaps no sens.
h34. Associating an operation to the completion of a process instance task
The operation completing a task of a process instance is identified by the value *{{completeTaskOp}}* set on the attribute {{activitiAction}}:
{color:red}*Mapping des parametres à faire*{color}
h34. Associating an operation to retrieve process instances
The operation retrieving process instances is identified by the value *{{retrieveProcInst}}* set on the attribute {{activitiAction}}: