So today I was working through code and I saw a function that was being called multiple times however with only one single differing variable. I assume that saving this into a local variable like this is exactly why advanced evaluation exists.
load( local!allReviewOutcomeTypes: rule!LE2E_getAllReviewOutcomeTypes(), local!grabCaption: displayvalue( _, local!allReviewOutcomeTypes.outcomeTypeId, local!allReviewOutcomeTypes.outcomeType, "Error Invalid Outcome Type Id" ), { a!documentImage( document: a!iconIndicator( "WAIT_CLOCK" ), altText: local!grabCaption(cons!LE2E_REVIEW_OUTCOME_TYPE_REQUESTED), caption: local!grabCaption(cons!LE2E_REVIEW_OUTCOME_TYPE_REQUESTED) ), . . .
However I'm curious about another case that I'm wondering if I can use this.
I have a large interface which uses queries to create a psuedo real-time grid. However because this uses the query in so many places I'm concerned about keeping them all up to date. What I'm looking at is adding a useless input with no effect, then I can save the query as a function rather than allowing it to evaluate at the time its saved and then pass that local variable around to guarantee that they are all identical.
I just have a few problems, first of all, the query doesn't seem to work unless its a with variable whereas the first example (displayvalue) worked in a load, why is this? It is returning null so my first instinct is that its losing track of the parameters I previously passed.What is Appians stance on this, is this recommended/discouraged? Are functions meant to be able to be passed as rule inputs and if they are why can't I select a 'Rule or Function Reference' value for my rule inputs? Or was this behavior meant to be reserved for Appian functions like reject or any which expect to be passed a function, or for functions like sum which can accept unlimited parameters?
Discussion posts and replies are publicly visible
You can pass a function reference as rule input using "Any Type"