Databases Reference
In-Depth Information
Here we simply specify the
Name
of the variable (for example,
tradeFulilled
) and
its
Type
. In our case, we want an
xsd:Boolean
, so select
Simple Type
and click the
magnifying glass to the right of it.
This will bring up the
Type Chooser
, which will list all the simple built-in data types
defined by XML Schema. Select
Boolean
and click
OK
.
We need to initialize the variable to false, so drag an
<assign>
statement on to your
process just before the while loop. Use the function
false()
, under the category
Logical Functions
, to achieve this.
Next, we need to set the condition on the while loop, so that it will execute only
while
tradeFulfilled
equals false. Double-click on the while loop. This will open
the
While
activity window, as shown in the following screenshot:
We must now specify an XPath expression, which will evaluate to either true
or false. If you click on the expression builder icon, which is circled in the
preceding screenshot, this will launch the
Expression Builder
. Use this to
build the following expression:
bpws:getVariableData('tradeFullfilled')=false()
Once we are happy with this, click
OK
.
Checking the price
The first activity we need to perform within the while loop is to get a quote for the
stock that we are trading. For this, we will need to invoke the stock quote process we
created earlier. As both of these processes are in the same composite, the simplest
way to do this is to wire them together.