In this lesson, you add an invocation of printMyInt to SalesBPService to log the value of a variable returned from another service invocation.
In the preceding lesson you created a Java service with two operations:
printMyInt writes the value of an int type variable and a label to the Unwired Orchestrator server log file.
printMyString writes the value of a string type variable and a label to the Unwired Orchestrator server log file.
In the WorkSpace Navigator, expand MySybStore_Tutorials/Services/BP and double-click MySalesBPService.svc_bpmn to open the service in the editor.
Double-click the ValidateSalesItem activity, then maximize that operation’s canvas.
Open the Service Explorer, and expand Private/MyDebugJavaService/debugClass and select printMyInt.
Drag printMyInt onto the business process canvas.
Right-click in the canvas and select Show Tool Palette, select the Activities category, then drag an Assign activity from the Tool Palette onto the canvas.
Select the Assign activity
on the editor canvas, expand the Properties pane,
and rename the Assign activity to setPrintMyIntParams
.
In the Properties pane, click New to add a second Assign variable in the Assign Overview table.
Set the Source and Target properties of the first Assign variable:
Click the ellipsis button in the Source column of the first Assign variable.
In the Variable Reference Dialog, select the Literal option and enter:
MySybStore_Tutorials: validateReturn
after Validate is:
Click OK.
Click the ellipsis button in the Target column of the first Assign variable.
In the Variables Reference Dialog box, select Invoked Services Variables/MyDebugJavaService/debugClass/printMyInt/label and click OK.
Set the Source and Target properties of the second Assign variable:
Click the ellipsis button in the Source column of the second Assign.
In the Variables Reference Dialog window, select Invoked Services Variables/SalesValidate/SalesItem/Validate/ValidateReturn and click OK.
Click the ellipsis button in the Target column of the second Assign variable.
In the Variables Reference Dialog box, select Invoked Services Variables/MyDebugJavaService/debugClass/printMyInt/variable and click OK.
Connect the setPrintMyIntParams activity and printMyInt service invocation into the activity flow. Rearrange the object as necessary to achieve the look of the graphic that follows.
Move setprintMyIntParams to the left of the printMyInt object in the editor canvas.
Click the right arrow on setprintMyIntParams and drag to and click the left arrow of printMyInt to connect those objects.
In the diagram, right-click the line between Validate and ifInvalid and select Delete.
Drag your cursor around setprintMyIntParams and printMyInt on the canvas to select those objects and their connection and move them between Validate and ifInvalid.
Click the right arrow of Validate and drag to and click the left arrow of setprintMyIntParams to connect those objects.
Click the right arrow of printMyInt and drag to and click the left arrow of ifInvalid to connect those objects.
Select File|Save from the WorkSpace main menu, then select File|Close All.
Use “Packaging, deploying, and testing a business process service” to repackage and deploy MySybStore_Tutorials/Services/BP/MySalesBPService.svcpkgdef.
See Chapter 4, “Unwired Orchestrator Logging Tutorials,” for additional logging tutorials.