filter() context

I'm trying to implement an expression rule that iterates over a list and returns a filtered list, and struggling to figure out how to do this.  It seems like filter() would be the way to go, but I don't see any examples of what the context parameter is supposed to look like.  What I want to do is something like:

rule input: fromDate (a Date)

rule:

filter(

rule!shouldItemBeIncluded(),

rule!getItemList(),

context: /* I'm lost here - I need to pass two parameters to shouldItemBeIncluded(), the item, and the fromDate */

)

How do I pass those parameters to the supplied predicate?

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to Brad J Horstkotte

    Surprisingly, I don't see it documented and I'm not aware of Appian deprecating it. I've always called it a "deferred" parameter, and basically it just acts as a placeholder for each item in your list.

    I did a few quick tests, and you might be able to avoid its use with this altered version of your second example:

    filter(
    rule!OTM_ShouldTaskBeCreated, <---I just removed the parens for this initial function reference
    rule!OTM_GetTaskDefinitions(),
    fromDate
    )

Children