Process Model Node Custom Output Explicit Casting Requirement?

Hi,

I have a custom output node in a process model which is calling an expression rule which takes one rule input of type Map list.    The expression rule generically updates some fields within the map.    We are able to pass a list of any custom data types into this expression rule and Appian happily cast from CDT list  to Map list.   The output node  target process variable is defined as a list type of CDT (same process variable value passed to the expression rule is being updated).   

Appian process model will not implicitly cast the expression rule return value back into list of CDT and in fact magically wipes out the process variable completely.   If I add an explicit cast function call in the custom output expression it works fine.   With the expression world is good and getting correct results. 

cast(
'type!{urn:com:florencehc:types:SC}SC_Request?list',
rule!SC_setAuditFields(request: pv!request, actor: pv!actor)
)

Without the explicit cast  the process variable value list , pv!request,  is being cleared out.    I wanted to use a Map list rule input so I can apply it to any of our many CTDs which contain same set of common named audit fields.

So the question of the day is should an explicit cast be required or have I hit a bug in Appian which I should report?

Thanks,

Bob

  Discussion posts and replies are publicly visible

Parents Reply
  • 0
    Certified Lead Developer
    in reply to bobt

    OK. I did a small test and can replicate this behaviour. Assigning a list of maps results in an empty variable. Assigning a single map works, as well as a list of dictionaries.

    When I understand your use case correctly, your expression take a list of CDTs and modifies some field in each. The output should be of the same type as the input. Is that correct? Is yes, why do you create a list of maps?

Children
No Data