|
Key
This line was removed.
This word was removed. This word was added.
This line was added.
|
Changes (19)
View Page History|| value of {{bpmnAction}} || operation executed on the process engine ||
| {{startEvent}} | Only one input parameter is expected: the user identifier. See [Associating an operation to the creation of an process definition instance|#associating_startEvent] for more information on the declaration of this parameter. |
| {{startEvent}} | Only one input parameter is expected: the user identifier. See [Associating an operation to the creation of an process definition instance|#associating_startEvent] for more information on the declaration of this parameter. |
| {{userTask}} | Expected input parameters are: the process instance identifier and the user identifier. See [Associating an operation to the completion of a process instance task|#associating_userTask] for more information on the declaration of this parameter.n. these parameters. |
Variables are identified by a generic annotation composed of the element {{\{http://petals.ow2.org/se/bpmn2.0/1.0}input-parameter}}. This annotation takes also two attributes:
* the attribute *{{name}}* defines the variable name expected of an expected input parameter of the BPMN 2.0 engine API operation,
* the attribute *{{value}}* defines the value to set to the expected input parameter using an XPath expression or a constant value.
See operation details to know the expected input parameters.
* the attribute *{{name}}* defines the variable name expected of an expected input parameter of the BPMN 2.0 engine API operation,
* the attribute *{{value}}* defines the value to set to the expected input parameter using an XPath expression or a constant value.
See operation details to know the expected input parameters.
Variables are identified by the annotation adding the element {{\{http://petals.ow2.org/se/bpmn2.0/1.0}variable}}. This annotation takes also two attributes:
* the attribute *{{name}}* defines the variable name used in the process definition.
* the attribute *{{name}}* defines the variable name used in the process definition.
h4. Identifying output parameters of operations
Output parameters of the BPMN 2.0 engine API operation can not be set into mapped to 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/bpmn2.0/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.
According to the operation executed by the BPMN 2.0 engine, its output parameters are transmitted to the XSL style-sheet through XSL parameters. You will use these XSL parameters to generate your service reply from your service request payload. See operation details to know the available XSL parameters.
h4. Associating an operation to the creation of an process definition instance
The operation creating instances of process definition is identified by the value *{{startEvent}}* set on the attribute {{bpmnAction}}.
The operation creating instances of process definition is identified by the value *{{startEvent}}* set on the attribute {{bpmnAction}} of the annotation {{\{http://petals.ow2.org/se/bpmn2.0/1.0}operation}}. As a process definition can include several start events, the right start event to use to create the new process instance is clarified with the attribute *{{id}}*.
This operation accepts variables and requires the following input parameters:
|| Input parameter name || Type || Description || Required ||
| processId | String constant | The process identifier of the process definition for which an instance must be created. | If more than one process definition exist in the service-unit, this input parameter is required. |
| startEventId | String constant | The identifier of the start event task of the process definition to use to create the new process definition instance. | If more than one start event task exist in the process definition, this input parameter is required. |
| processId | String constant | The process identifier of the process definition for which an instance must be created. | If more than one process definition exist in the service-unit, this input parameter is required. |
| startEventId | String constant | The identifier of the start event task of the process definition to use to create the new process definition instance. | If more than one start event task exist in the process definition, this input parameter is required. |
* user identifier, declared using the annotation {{\{http://petals.ow2.org/se/bpmn2.0/1.0}userId}} containing an XPath expression that is applied on incoming XML payload to get the value of the user identifier to use on the BPMN engine side.
The XSL parameters available to generate the service output reply are:
|| XSL parameter name || Type || Description ||
| processInstanceId | String | Identifier of the process instance created |
| userId | String | The user identifier used to create the process instance |
It is possible to map several operations of the WSDL to the creation of process instances, but this has perhaps no sens.
<wsdl:binding name="Order" xmlns:bpmn="http://petals.ow2.org/se/bpmn2.0/1.0">
<wsdl:operation name="newOrder" type="...">
<wsdl:operation name="newOrder" type="...">
<bpmn:operation bpmnAction="startEvent" id="default"/>
<bpmn:input-parameter name="processId" value="newOrder" /> <bpmn:userId>/*[local-name()='newOrderRequest']/*[local-name()='userName']</bpmn:userId>
<bpmn:input-parameter name="startEvent" value="default" />
<bpmn:variable name="customerName" value="/newOrderRequest/customerName" />
<bpmn:variable name="customerName" value="/newOrderRequest/customerName" />
<bpmn:variable name="address" value="/newOrderRequest/address" />
<bpmn:output xsl="newOrderOutput.xsl" />
<bpmn:output xsl="newOrderOutput.xsl" />
{code:title=Associated input request}
<newOrderRequest>
<newOrderRequest>
<userName>Jean Zé</userName>
<customerName>Mr Dupont Martin</customerName>
<address>23, rue de la Paie, 75000 Paris</address>
<address>23, rue de la Paie, 75000 Paris</address>
h4. 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 *{{userTask}}* set on the attribute {{bpmnAction}} of the annotation {{\{http://petals.ow2.org/se/bpmn2.0/1.0}operation}}. To guarantee that the expect user task is the right one, the identifier of the expected user task is clarified with the attribute *{{id}}*.
This operation accepts variables and requires the following input parameters:
|| Input parameter name || Type || Description || Required ||
| processInstanceId | XPath expression result as String | Identifier of the process instance created | Yes |
| taskDefinitionKey | String constant | Name of the task in the process definition. | Yes |
| processInstanceId | XPath expression result as String | Identifier of the process instance created | Yes |
| taskDefinitionKey | String constant | Name of the task in the process definition. | Yes |
* process instance identifier, declared using the annotation {{\{http://petals.ow2.org/se/bpmn2.0/1.0}processId}} containing an XPath expression that is applied on incoming XML payload to get the value of the process instance identifier to use on the BPMN engine side.
* user identifier, declared using the annotation {{\{http://petals.ow2.org/se/bpmn2.0/1.0}userId}} containing an XPath expression that is applied on incoming XML payload to get the value of the user identifier to use on the BPMN engine side.
* user identifier, declared using the annotation {{\{http://petals.ow2.org/se/bpmn2.0/1.0}userId}} containing an XPath expression that is applied on incoming XML payload to get the value of the user identifier to use on the BPMN engine side.
Note: The completion status of the task is a variable and so it takes any form.
<wsdl:binding name="Order" xmlns:bpmn="http://petals.ow2.org/se/bpmn2.0/1.0" >
<wsdl:operation name="validOrder">
<wsdl:operation name="validOrder">
<bpmn:operation bpmnAction="userTask" id="validOrder"/>
<bpmn:input-parameter name="processInstanceId" value="/validOrderRequest/orderId" /> <bpmn:processId>/*[local-name()='validOrderRequest']/*[local-name()='orderId']</bpmn:processId>
<bpmn:input-parameter name="taskDefinitionKey" value="validOrder" /> <bpmn:userId>/*[local-name()='validOrderRequest']/*[local-name()='userName']</bpmn:userId>
<bpmn:variable name="validationApproved" value="/validOrderRequest/isValidated" />
<bpmn:variable name="creditCardNumber" value="/validOrderRequest/creditCardNumber" />
<bpmn:variable name="creditCardNumber" value="/validOrderRequest/creditCardNumber" />
<isValidated>true</isValidated>
<creditCardNumber>1234567890123</customerName>
<creditCardNumber>1234567890123</customerName>
<userName>Robert Té</userName>
</validOrderRequest>
{code}
{code}