Sample Flow Service: Setting a Context Variable Value
This flow service sets the value of a custom context variable to be used in a response.
This flow service declares a pipeline variable named customName, which is set to the value mx:COMP_TEST.
This flow service will retrieve the context variable for customName and create an element for its context variable value in the response message return to the consumer.
Step 1. Declaring customName
We define the customName variable value to be mx:COMP_TEST so we can use this variable to lookup the custom variable name that was seeded in the previous example.
Step 2. Setting customName to mx:COMP_TEST
Clicking on the customName pipeline variable will display the name.
Step 3. Displaying the value of customName
The call to pub.mediator.ctxvar:getContextVariable retrieves the value of the custom context variable from the context variable map.
Step 4. Calling meditor.ctxvar:getContextVariable
This is just a sample Java service that takes the context variable and creates a top-level element in the response message using the same name and value.
Step 5. Sample service using the context variable