Create the ApproveExpenses workflow to receive a Web Service request
TIP We create the workflow with a Receive step first because the Receive Web Service defines the parameters and WSDL of the service.
- In Process Designer, start a new workflow definition.
- On the Workflow Properties >> General tab, provide a name and subject for the new workflow definition (ApproveExpenses).
- Define the Web Service.
- In Workflow Properties >> Web Services, on the General tab specify a folder on your object store where incoming attachments (the expense report) will be stored.
- Be sure that Finalize existing web services is not selected.
We want to be able to modify the web service input and output parameters as many times as we wish.
- On the Partner Links tab, enter a name (ApproveExp) for the Web Service, then select Receive/Reply.
- In Process Port Type , enter a name (ExpPort) for the port.
TIP Click Receive/Reply in the Type field to update the data. A new blank line will display in the Partner Links table.
- In Workflow Properties >> Data Fields, specify a data field, ReplyMsg (string), that will be used to hold the reply message.
We will create other data fields and an attachment automatically as we define the parameters for the Web Services.
- From the Web Services step palette, drag a Receive step to the workflow map and specify the properties as follows.
NOTE The Receive step must be the first step after the Launch step in order to launch this workflow automatically in response to an invoke of this Web Service.
- In the Properties pane, select the Partner Link for this Web Service (ApproveExp)
- For Operation, enter a name (ExpOp).
- Select Parameters, specify each input parameter, and automatically create the corresponding data fields and attachment.
Note that you can also create the data fields in the usual way in the Workflow Properties >> Data Fields dialog box, and the field names do not need to match the parameter names.
Parameter Name |
Type |
Data field |
EmpName |
String |
<Create> EmpName |
TotalAmount |
Float |
<Create> TotalAmount |
ExpenseRpt |
Attachment by Value
(This means that the actual file will be attached to the message, not referenced in an object store. We could use either option in this workflow since both workflows are in the same isolated region and have access to the same object store.) |
<Create> ExpenseRpt |
- From the BPM step palette, drag an Activity step to the workflow map and name it Review. At this step, a 'Reviewer of expense reports' checks the attached expense report and enters a reply message.
- From the Web Services step palette, place a Reply step on the workflow map, and define the parameters.
- In the Properties pane, select the same partner link and operation you defined in the Receive step (ApproveExp).
- Under Message Type, select Message.
- Specify the parameter for the reply message.
Parameter Name |
Type |
Data field |
ReplyParam |
String |
EmpName+ReplyMsg |
- Add routes between the steps.
- Validate, save, and transfer this workflow definition.
|