Initializing a variable with an inline from-spec
In the previous recipe, we explored how variables are initialized in a BPEL process. The recipe explained the initialization of variables using XML literals. This recipe explains the alternative way of initializing variables with an inline from-spec. The difference between the two mentioned recipes is that the initialization of a variable over an XML literal is performed from the assign activity, while initialization over an inline from-spec is performed at the variable definition.
Tip
The initialization of variables using an inline from-spec is only supported for BPEL 2.0 processes!
Getting ready
For this recipe, we will create an empty synchronous BPEL 2.0 process. We will reuse the request and response messages from the VarInit.bpel
BPEL process we created in the previous recipe.
How to do it…
In the following steps, we will show you how to initialize a variable using an inline from-spec:
We open the BPEL process and click on the variables icon...