Rule Builder > Ruleflows > Creating a Ruleflow > Creating a Function Task

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:

  1. Add a function task by clicking the Create Function Task images/helprulebuilder-10-24-21.gif button on the Ruleflow Creation toolbar and then clicking in the Ruleflow Editor.
  2. This creates a function task:
    1. Represented by a rounded rectangle in the Ruleflow Editor.
    2. As a child of the ruleflow in the Project Explorer.
  3. 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.
  4. In the Property Sheet, rename the task to GetToday, as shown in Figure 9.12.

  5. images/example07.gif
  6. Figure 9.12    Function Task Added Example
  7. 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.
  8. Type the following text:
  9. bind now = Calendar.getInstance();
  10. today = now.get(Calendar.DAY_OF_WEEK);
  11. The GetToday tab should now look like Figure 9.13.

  12. images/example06.gif
  13. Figure 9.13    Function Task IRL Code Example

See Also

Ruleflow Editor | Repository Element Property Reference | Working With the Property Sheet


Customer Support | Copyright © 1987-2004 ILOG S.A. All rights reserved. Legal terms. PREVIOUS   NEXT