In Process Designer,
you must initialize all complex variables and all lists (arrays) before
you can use them in a BPD or service.
About this task
The Coach framework requires that all variables that a Coach
or Heritage Coach references are initialized. If the human service
does not initialize these variables, the framework does it when the
Coach runs. This initialization occurs even if the Coach does not
use these variables. Because of this initialization, ensure that service
level code does not require variables to be in an undefined state
if a Coach references these variables.
Procedure
- In the Variables tab of your BPD or
service diagram, declare
a variable that is a complex business object or a list. For
example, a variable named myVariable of type Requisition or
a variable named myList that is a list of string
variables.
- In the diagram area, drag a script task from the palette
to the canvas.
- In the Implementation tab, initialize your variable using
the a JavaScript text area:
Note: If your complex business object or list includes elements
that are complex variables, they also must be initialized.
What to do next
You have initialized your complex variable or list. The variable
can now store data.