Written by

Integration Developer/Architect at London North West University Healthcare NHS Trust
Question Stephen De Gabrielle · Sep 10, 2018

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

Hi,

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

Comments

Stephen De Gabrielle · Sep 10, 2018

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. 

0
Marc Mundt · Sep 13, 2018

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" ];

}

0