You can create a function task either by selecting the Edit action of the task instance or by double-clicking one of its instances in a flow.
To create a simple function task that computes the value of the today
parameter:
-
Add a function task by clicking the Create Function Task
button on the Ruleflow Creation toolbar and then clicking in the Ruleflow Editor.
- This creates a function task:
- Represented by a rounded rectangle in the Ruleflow Editor.
- As a child of the ruleflow in the Project Explorer.
-
Click the newly created function task to select it in the Ruleflow Editor.
Tip |
Selecting a task in the Ruleflow Editor also selects the task in the Property Sheet. |
-
In the Property Sheet, rename the task to
GetToday
, as shown in Figure 9.12.
-
Figure 9.12 Function Task Added Example
-
Double-click the
GetToday
function task. This displays a tab for editing the function, which is a text area where you can type a piece of IRL code.
-
Type the following text:
bind now = Calendar.getInstance();
today = now.get(Calendar.DAY_OF_WEEK);
- The
GetToday
tab should now look like Figure 9.13.
-
Figure 9.13 Function Task IRL Code Example
See Also
Ruleflow Editor | Repository Element Property Reference | Working With the Property Sheet
|