Forum Discussion

FICO's avatar
FICO
Community Manager
16 years ago

HOW TO ASSIGN Value to a variable?

HOW TO ASSIGN Value to a variable?

Hi friends,

                  I have an decision table instance with me. i need to assign the action cell value to a variable by passing the input value( condition cell).

Can any one tell me how to assign it ? tell me in detail please..

2 Replies

  • FICO's avatar
    FICO
    Community Manager

    No one can tell you in more detail without more detail information from you. However you can do pretty much anything by having your own code templates in the action cell. All you need to do is to specify the assignment in the statement of the code template.

  • FICO's avatar
    FICO
    Community Manager

    Assuming that the action needs a variable and not just a hardcoded condition value somebody entered in the condition cell, you will need to create or modify code template that represents this action. In the SRL section of that code template you can put any code you want, including the reference to the variable that was used in the condition. Please take a close look at how decision table templates are structured and you will see that for each action there is an action row or column in the template, and in each such row you can have one or more code templates. Each code template is to generate a small snippet of code that will be executed in the generated rule's "then" section if this action gets triggered. You can modify this snippet of code to do whatever you want it to do.