Adding a function task node

A function task references another model to be executed. The referenced model can be any other model in the decision service.

Procedure

  1. Add a function task node to the ruleflow in one of the following ways:
    • Hover over the node or the transition after which you want to add the function task node and click the Add function task Add function task icon icon in the toolbar.
    • Click the Add function task Add function task icon icon in the ruleflow toolbar.

    The Configure function task node wizard automatically opens.

  2. In the Select function pane, select the model that you want to reference and click Next.
    A function contains all the information that is needed to run a model. Functions are created automatically for decision models and predictive models. You need to create functions manually for task models. For more information, see Creating functions.
  3. Map the input and the output of the referenced model to the ruleflow:
    1. Under Input mapping, you can see the list of input parameters coming from the referenced model. Click the Edit value Edit value icon icon next to each parameter to map it to task model variables.
      You can enter a simple expression to map input parameters, for example: the score of 'the borrower'.
    2. Under Output mapping, click Add mapping to start mapping task model variables to output parameters from the referenced model.
    3. Select a task model variable in the Select a task model variable drop-down list and click the Edit value Edit value icon icon.
      You can enter a simple expression to map variables, for example: 'insurance decision'.
    4. Repeat steps b and c for each task model variable that needs to be mapped to output parameters.
    You can use the rule language or the advanced rule language (ARL) to map the parameters.
    Note: There is no completion menu for output mapping in ARL. To access the value returned by a function, you must use the verbalized name of the function in backquotes. Take the example of a function compute pricing and category that returns an object with an attribute pricing. You should enter `computePricingAndCategory`.pricing to access the value of pricing.
  4. Click Save.
    You can reopen the Configure function task node at any time by clicking Edit configuration.
  5. (Optional) Click the default name of the node to edit it.
  6. (Optional) Define initial actions and final actions for the function task node.
    Initial actions apply before the rule task is processed and final actions apply after the rule task is processed. You define initial and final actions in the same way as you define actions for an action task.