How do you pass process variable parameter into an expression

I am trying to pass the value of a process variable into my expression, and the expression is also used in the process model.

Please, see attached image:

The rule - drxxxxStoredProcedureDirDepAggregatedPaymentForDate looks like this:

executestoredprocedure(
  datasourceName: "jdbc/ABC",
  procedureName: "dbo.procCtePaent",
  inputs: {
    {
      name: "date_param",
      value: ""
    }
  }
).result[1]

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to nicholaso0002

    You're already setting one local variable, local!lines - you'd just create an earlier local variable within your load() statement (though i beg you to please switch this load() out for a!localVariables() for your sanity and mine), move the stored procedure call to that local variable, then refer to the local variable in the subsequent places you called the SP directly.

    This would look a little something like:

    a!localVariables(
      
      local!procedureResult: rule!mySuperLongStoredProedureExpressionRuleName("3/17/2022"),
      
      local!lines: if(
        a!isNullOrEmpty(local!procedureResult),
        {"No Data, 0.000000.123456789.0 etc"},
        
        {
          a!forEach(
            items: local!procedureResult,
            expression: {
              /* all your code here would be essentially unchanged */
            }
          )
        }
      )
    )

Children