zava
Elite Observer

read #global.context("PAGE")["XXX"] in script

Hi,

I'm tryng to read global.context("PAGE")["stTestVar"] in a script.

I got this direction, but I'm not sure is the rigth one Smiley Happy.


PreviewProduction evaluator = new PreviewProduction(null, us, falseus.getProject().getMasterLanguage(), us.getProject().getTemplateSets().get(0), se, null);

Context ctxevaluator.getContext();

Object vars = ctx.getVariableNames();


// vars = [#global, inherit_format_conversion, #classloader, #startdate, #mathContext]

Best regards,

Antonio

0 Kudos
3 Replies
gockel
Crownpeak employee

Hi,

what do you want to achieve?

Which kind of script are we talking about?

Why do you instanciate PreviewProduction (internal non API class)?

Gockel

0 Kudos

Hi Sebastian,

I want to get the value of #global.context("PAGE")["stTestVar"] in a workflow script.

Like $CMS_VALUE(#global.context("PAGE")["stTestVar"])$ do in a template.

regards,

Antonio

0 Kudos
feddersen
Community Manager

If you're within a script, there's a predefined variable called "context" that represents the current context. In this case, you'll get a WorkflowScriptContext http://www.e-spirit.com/odfs50/access/de/espirit/firstspirit/access/store/templatestore/WorkflowScri...

0 Kudos