Rule Input

Hi,

Anyone can explain why do we need to give rule input and when do we we need it with example?

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Lead Developer

    Rule inputs are used to:

    • pass data down and up interfaces
    • pass data into and out of a process model
    • pass inputs to expression rules

    Without rule inputs, you will not be able to save data from your interface into process variables. When creating the user input task, you will assign a rule input to an action class parameter. We can pass values into this ACP and save the ACP to a process variable. 

    Without rule inputs, you will not be able to have multiple nested interfaces using the same data. Nor can you pass parameters to your expression rules.

    For example...

    this parent rule:

    load(
      local!parentVar1: 5,
      local!parentVar2: 10,
      { 
        rule!JXI_childRule(
          inputVar1: local!parentVar1,
          inputVar2: local!parentVar2
        ),
        a!textField(
          label: "Directly accessing parentVar2 on the parent form: ",
          value: local!parentVar2,
          readOnly: true
        ),
        a!textField(
          label: "Calling an expression rule with a rule input: ",
          value: rule!JXI_expressionRuleRI(
            expressionRuleInput: local!parentVar2
          ),
          readOnly: true
        )
      }
    )

    calls this child rule, JXI_childRule:

    {
      a!textField(
        readOnly: true,
        label: "Input Variable One: ",
        value: ri!inputVar1
      ),
      a!textField(
        readOnly: true,
        label: "Input Variable Two: ",
        value: ri!inputVar2
      ),
      a!buttonArrayLayout(
        align: "START",
        buttons: a!buttonWidget(
          label: "DOUBLE VAR 2",
          saveInto: a!save(ri!inputVar2, 2*ri!inputVar2)
        )
      )
    }

    and this expression rule, JXI_expressionRuleRI:

    factdouble(ri!expressionRuleInput)

     

    Let me know if you have questions on any of this. Hope it helps.

     

    Some doc links:

    https://docs.appian.com/suite/help/17.1/Interface_Designer.html#-manage-interface-inputs

    https://docs.appian.com/suite/help/18.3/Expression_Rules.html#overview 

    https://docs.appian.com/suite/help/18.3/Process_Modeling_Tutorial.html#add-an-approval-step-with-a-user-input-node 

Reply
  • +1
    Certified Lead Developer

    Rule inputs are used to:

    • pass data down and up interfaces
    • pass data into and out of a process model
    • pass inputs to expression rules

    Without rule inputs, you will not be able to save data from your interface into process variables. When creating the user input task, you will assign a rule input to an action class parameter. We can pass values into this ACP and save the ACP to a process variable. 

    Without rule inputs, you will not be able to have multiple nested interfaces using the same data. Nor can you pass parameters to your expression rules.

    For example...

    this parent rule:

    load(
      local!parentVar1: 5,
      local!parentVar2: 10,
      { 
        rule!JXI_childRule(
          inputVar1: local!parentVar1,
          inputVar2: local!parentVar2
        ),
        a!textField(
          label: "Directly accessing parentVar2 on the parent form: ",
          value: local!parentVar2,
          readOnly: true
        ),
        a!textField(
          label: "Calling an expression rule with a rule input: ",
          value: rule!JXI_expressionRuleRI(
            expressionRuleInput: local!parentVar2
          ),
          readOnly: true
        )
      }
    )

    calls this child rule, JXI_childRule:

    {
      a!textField(
        readOnly: true,
        label: "Input Variable One: ",
        value: ri!inputVar1
      ),
      a!textField(
        readOnly: true,
        label: "Input Variable Two: ",
        value: ri!inputVar2
      ),
      a!buttonArrayLayout(
        align: "START",
        buttons: a!buttonWidget(
          label: "DOUBLE VAR 2",
          saveInto: a!save(ri!inputVar2, 2*ri!inputVar2)
        )
      )
    }

    and this expression rule, JXI_expressionRuleRI:

    factdouble(ri!expressionRuleInput)

     

    Let me know if you have questions on any of this. Hope it helps.

     

    Some doc links:

    https://docs.appian.com/suite/help/17.1/Interface_Designer.html#-manage-interface-inputs

    https://docs.appian.com/suite/help/18.3/Expression_Rules.html#overview 

    https://docs.appian.com/suite/help/18.3/Process_Modeling_Tutorial.html#add-an-approval-step-with-a-user-input-node 

Children
No Data