Written by

Question PaulSomebody · Oct 3

assign from a function in a RUL

How do you assign a property in a RUL (not a DTL or BPL) from a function value?  I've tried with the package/classname, without, with .., without and even looked all the way down to the parser but still can't see how.  There is no examples and the documentation doesn't help

So this works

<assign property="RuleActionUserData" value="&quot;A01&quot;"></assign>
 

This doesn't complile

<assign property="RuleActionUserData" value="##class(SomePackage.SomeClass).EventTypeToHL7Type(Document)"></assign>

SomePackage.SomeClass extends EnsRules and the method is a classmethod and final

Comments

Jeffrey Drumm · Oct 3

The rule parser/compiler doesn't handle calls to methods/classmethods unless they extend Ens.Rule.FunctionSet, and it doesn't recognize the ##class() keyword. If your class does extend Ens.Rule.FunctionSet, you should be able to use just the Methodname as shown below:

<assignproperty="PropertyName"value="SomeMethod(args)" />
0
PaulSomebody · Oct 8

I'm 100% sure I tried that and it didn't work, but it does now, must have been late in the day :-)  Thankyou

0