Java Reference
In-Depth Information
Concatenating Values
Problem
You want to merge two values together within a BPEL variable. Perhaps you want your result
to be a combination of runtime values and literals.
Solution
Use the concat() function, and comma-separate the values you want to concatenate.
Discussion
This function is very straightforward. This example highlights how to combine a literal value
with a runtime value that is extracted using XPath expressions:
<copy>
<from>
concat('The application received an error message:',
' AUTH-NUMBER=', $ProcessAppIn.app/authNumber,
' STATUS-MESSAGE=', $ProcessAppOut.appResponse/status/statusName,
' STATUS-CODE=', $ProcessAppOut.appResponse/status/statusCode)
</from>
<to>$SendEmailIn.emailMsg/body</to>
</copy>
Here you are creating the body of an email message using literal values, as represented inside
the tick marks, combined with values extracted from variables at runtime. The $ represents the
variable of some schema type, and the . represents the path to its element. The / represents
the path down the XML data tree to the value you're interested in extracting.
At the end of the execution of this <copy> block, the body of the email will look something
like this, depending on runtime values (and without the line breaks):
The application received an error message:
AUTH-NUMBER=605516
STATUS-MESSAGE=OUT OF STOCK
STATUS-CODE=SC404
Search WWH ::




Custom Search