Create a workflow to provide the VehicleReg Web Service
- In Process Designer start a new workflow definition.
- On the Workflow Properties >> General tab, provide a name and subject (RegisterVehicles).
- Define the Web Service.
- On Web Services >> Partner Links, create the Web Service.
Name: VRegistration
Receive/Reply: select this check box
Invoke: clear this check box
Process Port Type: VRegPort
TIP Click Receive/Reply in the Type field to update the data. A new blank line will display in the Partner Links table.
- On the XML Schema tab, define two schemas, one for the incoming data, and one for the reply message.
NOTE These two XML schemas are simple enough to be interpreted as parameters by Process Designer, but they are used here as examples of using XML messages.
Incoming |
Outgoing |
Name: VehicleReceiveSchema
Schema Definition : click here for definition text |
Name: VehicleReplySchema
Schema Definition : click here for definition text |
TIP If the text does not display on separate lines in the schema definition, click Check Well Formed XML.
- On the XML data fields tab, specify XMLVehicleData to hold the incoming vehicle data message.
Name: XMLVehicleData
Schema: VehicleReceiveSchema
Element: VehicleReg
- On Web Services >> General tab, Finalize existing web services should not be selected—we want to be able to modify the web service input and output parameters as many times as we want.
- By examining the XML schemas (Web Services >> XML Schema tab), you can see that you will need the workflow fields listed below to hold the data for the incoming and outgoing messages. Specify the following data fields in Workflow Properties >> Data Fields.
Incoming
Name (type) |
Outgoing
Name (type) |
OwnerName (String) |
ReplyRegNum (String) |
VehicleNumber (String) |
Fee (Float) |
VehicleValue (Float) |
|
- Create a step to provide the vehicle registration web service.
- From the BPM palette, place a System step, and specify a Receive system function.
Name: Receive
NOTE The step must be the first step after the Launch step and Receive must be the first function in the step in order to launch this workflow automatically in response to a request for this Web Service.

Partner Link: VRegistration
Operation: VRegOp
Message Type: XML
Incoming XML Data Field: XMLVehicleData
Schema: VehicleReceiveSchema
Element: VehicleReg
- In the same system step, add an Assign system function to extract data from the incoming XML message into the corresponding data fields.
Field |
Expression |
OwnerName |
xmlstringexpr(XMLVehicleData, "/", "/*[local-name()=""VehicleReg""]/*[local-name()=""Owner""]") |
VehicleNumber |
xmlstringexpr(XMLVehicleData, "/", "/*[local-name()=""VehicleReg""]/*[local-name()=""Vehicle""]/*[local-name()=""VIN""]") |
VehicleValue |
convert(xmlstringexpr(XMLVehicleData, "/", "/*[local-name()=""VehicleReg""]/*[local-name()=""Vehicle""]/*[local-name()=""Value""]"),float) |
Fee |
VehicleValue * 0.01 (This is a calculated value for the reply message.) |
- From the BPM step palette,
create a step that will allow the registration worker to examine the vehicle data and enter a registration number for the reply.
- Drag an Activity step to the workflow map.
Name: AssignReg
- Choose a specific user (you can assign it to yourself) as the participant for the step.
NOTE Since the workflow system will launch this workflow automatically when the Web Service is invoked, you must not assign F_Originator for any step in this workflow because the system is not considered a valid user with an inbox.
- Specify the registration information as parameters for this step so the registration worker can examine the vehicle data and enter a registration number for the reply.
(You can also specify the XML data field, XMLVehicleData, as a parameter if you want to see the actual invoking message.)
Parameter Name: OwnerName
Parameter Name: ReplyRegNum
Parameter Name: VehicleNumber
Parameter Name: VehicleValue
Parameter Name: XMLVehicleData
- From the Web Services step palette, place a Reply step on the workflow map—or use a System step with Reply system function. This step provides a reply message to the process that invokes the web service.

- In the Properties pane, select the same partner link and operation you defined in the Receive step.
- Select Message.
- For Schema, select VehicleReplySchema, and VehicleReply element.
- Click the Create Message template button to display the outgoing message in template format.
- Edit the outgoing message to substitute the appropriate data fields for the placeholders, as indicated above.
NOTE The Fee data must be converted from float to string for the message.
- Validate, save, and transfer this workflow definition.
|