Published on InterSystems Developer Community (https://community.intersystems.com)

Home > Ens.Rule.FunctionSet without parameter?

Question
Scott Beeson · Feb 11, 2016

Ens.Rule.FunctionSet without parameter?

I'm writing some custom functions for use in a routing rule.  I have a few that are working, but right now I'm trying to use one that has no parameters.  Typically this would be a sub instead of a function, but I'm not familiar enough with Cache to know what I need to do here. 

Here is the code:

Class Custom.MHC.Common.CustomFunctions Extends Ens.Rule.FunctionSet
{

   /// Location and Revision of this file in Perforce (Auto-updating)
   Parameter SrcVer = "$Id$";

   /// Returns the current environment code,
   /// DEVELOPMENT, TEST, LIVE
   ClassMethod getEnvironment() As %String [ Final ]
   {
    q ^%SYS("SystemMode")
   }
}

And here is what happens in the Rule Editor UI:

What should I do?  

#Code Snippet #Debugging #Perforce #Ensemble

Source URL:https://community.intersystems.com/post/ensrulefunctionset%C2%A0without-parameter