We can identify the logical conditions with a Boolean value. You will learn how to use Boolean values in the variables in this recipe.
This recipe continues the discussion of the BPEL process Manipulate1_1
from the Using mathematical calculations in the variables recipe.
In the Manipulate1_1
BPEL process, we define the Boolean variable as follows:
<variable name = "expensive_item" type = "xsd:boolean"/>
With this variable, we will check if the item is expensive or not.
The following steps explain how to assign and change a Boolean value of a variable:
Manipulate1_1
BPEL process. Boolean
.false
value as follows:<copy> <from expression = "false()"/> <to variable = "expensive_item"/> </copy>
<copy> <from expression = "bpws:getVariableData('inputVariable', 'payload', '/client:process/client:priceVAT') > 1000"/> <to variable = "expensive_item"/> </copy>
<inputVariable>
<part name = "payload" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance">
<ns1:process xmlns:ns1 = "http://xmlns.oracle.com/Variables/Global/Manipulate1_1">
<ns1:input>Jurij</ns1:input>
<ns1:item>454</ns1:item>
<ns1:priceVAT>67755</ns1:priceVAT>
</ns1:process>
</part>
</inputVariable>
Let's now check the Audit Trail. We search for the Boolean assign activity. The execution data shows that the variable expensive_item
is initialized with the value false
, and after the evaluation of the condition against the price and fixed amount criteria, it was set to true
as follows:
<expensive_item xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns:ns = "http://www.w3.org/2001/XMLSchema" xsi:type = "ns:boolean">false</expensive_item> <expensive_item xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance" xmlns:ns = "http://www.w3.org/2001/XMLSchema" xsi:type = "ns:boolean">true</expensive_item>