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
- 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
icon in
the toolbar. - Click the Add function task
icon in
the ruleflow toolbar.
The Configure function task node wizard automatically opens.
- Hover over the node or the transition after which you want to add the function task node and
click the Add function task
- 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.
- Map the input and the output of the referenced model to the ruleflow:
- Under Input mapping, you can see the list of input parameters
coming from the referenced model. Click the Edit value
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'. - Under Output mapping, click Add mapping to start mapping task model variables to output parameters from the referenced model.
- Select a task model variable in the Select a task model
variable drop-down list and click the Edit value
icon. You can enter a simple expression to map variables, for example:'insurance decision'. - 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`.pricingto access the value of pricing. - Under Input mapping, you can see the list of input parameters
coming from the referenced model. Click the Edit value
- Click Save. You can reopen the Configure function task node at any time by clicking Edit configuration.
- (Optional) Click the default name of the node to edit it.
- (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.