I am having problems writing an expression rule that uses displayvalue() functio

I am having problems writing an expression rule that uses displayvalue() function.

I have an array CDT called BusinessRulesCDT. It keeps erroring out complaining about the 4th argument to displayvalue() which is the default value.

At run time, it gives the error message:

Details: ERROR:An error occurred while evaluating expression: businessRule:rule!findBusinessRuleCDT(pv!businessRuleArray, pv!ruleName,pv!defaultBusinessRule) (Expression evaluation error in rule 'findbusinessrulecdt' at function 'displayvalue' parameter 4: ) (Data Outputs)

My BusinessRuleCDT is:
- id (integer)
- name (text)
- value (text)

my expression rule is:

findBusinessRuleCDT(businessRuleArray (Any Type), ruleName (Text), defaultBusinessRule (Any Type))
which calls ==> displayvalue(ri!ruleName, ri!businessRuleArray.name, ri!businessRuleArray, ri!defaultBusinessRule)

For the 4th parameter, I tried {}, "", and even the example above where I pass ...

OriginalPostID-170427

OriginalPostID-170427

  Discussion posts and replies are publicly visible

Parents
  • My expression body already looks like that.

    So, in essence, I can't use displayvalue() inside an expression rule when passing my own CDT types because I'll get the type mismatching error resulting in what looks like bad 4th argument to displayvalue(). That mean's I'll always have to rely on script tasks to search through a CDT typed array variable. Do you have any java plug-in source code examples of searching or looping through a CDT array typed pv? It looks like I may have to resort to that.

    Would it be possible for Appian to incorporate same logic into the expression rule as you do in the SAIL forms? That way I can do exactly what I am trying to do here. In SAIL forms, you can declare a parameter as Any Type and pass in your own CDT typed pv's and at run time it figures it out type when dereferencing a member of the CDT parameter. That would open up so much more functionality and make expression rules even more useful. I hope Appian would consider this.

Reply
  • My expression body already looks like that.

    So, in essence, I can't use displayvalue() inside an expression rule when passing my own CDT types because I'll get the type mismatching error resulting in what looks like bad 4th argument to displayvalue(). That mean's I'll always have to rely on script tasks to search through a CDT typed array variable. Do you have any java plug-in source code examples of searching or looping through a CDT array typed pv? It looks like I may have to resort to that.

    Would it be possible for Appian to incorporate same logic into the expression rule as you do in the SAIL forms? That way I can do exactly what I am trying to do here. In SAIL forms, you can declare a parameter as Any Type and pass in your own CDT typed pv's and at run time it figures it out type when dereferencing a member of the CDT parameter. That would open up so much more functionality and make expression rules even more useful. I hope Appian would consider this.

Children
No Data