Stephen De Gabrielle · Sep 10, 2018

Can a BPL context variable reference the request object for the 'default value'?


Can I reference the 'request' object when setting default values for context variables?

1 2 186 2


I'm getting an error when I try this but as the documentation explicitly states the default value can be an expression, I don't know if this is a bug in the system or an omission in the documentation?

FWIW using default values would be better than a series of 'assign' statements. 

Looking at the generated code, this is probably not possible.

Each context variable becomes a standard property in an auto-generated context class. The "Default Value" becomes the "InitialExpression" attribute of the property. This means the default is assigned by the underlying object framework upon instantiation of the context object rather than by the BPL engine itself.

Class Test2.NewProcess1.Context Extends Ens.BP.Context [ ClassType = persistent, CompileAfter = Test2.NewProcess1, GeneratedBy = Ens.BPL.Compiler.CLS, ProcedureBlock ]

Property testvar1 As %String(MAXLEN = 50) [ InitialExpression = "blah" ];