Difference between revisions of "Workflow getGlobal"

From Catglobe Wiki
Jump to: navigation, search
(Created page with "== Workflow_getGlobal== Get values for scripts invoked from workflow class ==Syntax== Workflow_getGlobal(string parameterName) == Return type == AnyType == Examples == <sourc...")
 
(Examples)
Line 8: Line 8:
  
 
<source lang="javascript">
 
<source lang="javascript">
//Use on dynamic script  
+
Workflow_setGlobal("x", 1000);
 +
//Get global value on dynamic script  
 
string script = "
 
string script = "
 
number a = 1;
 
number a = 1;
Line 14: Line 15:
 
";
 
";
 
WorkflowScript wf = new WorkflowScript (script, false);
 
WorkflowScript wf = new WorkflowScript (script, false);
Workflow_setGlobal("x", 10);
+
print(wf.Call());//1001
wf.Call();//11
+
//Get global value on existing wokflow
</source>
+
wf = new WorkflowScript (wf);
 +
print(wf.Call());//1002
  
 
+
/*
<source lang="javascript">
+
script on the above wf:
//Use on existing wokflow
+
number a = 2;
WorkflowScript wf = new WorkflowScript (wf);
 
Workflow_setGlobal("x", 10);
 
print(wf.Call());//11
 
 
 
// script get global value on the above wf:
 
number a = 1;
 
 
return a + Workflow_getGlobal("x");
 
return a + Workflow_getGlobal("x");
 +
*/
 
</source>
 
</source>
  
 
[[Category:General_Functions]]
 
[[Category:General_Functions]]

Revision as of 04:07, 31 December 2024

Workflow_getGlobal

Get values for scripts invoked from workflow class

Syntax

Workflow_getGlobal(string parameterName)

Return type

AnyType

Examples

Workflow_setGlobal("x", 1000);
//Get global value on dynamic script 
string script = "
	number a = 1;
	return a + Workflow_getGlobal(\"x\");
";
WorkflowScript wf = new WorkflowScript (script, false);
print(wf.Call());//1001
//Get global value on existing wokflow
wf = new WorkflowScript (wf);
print(wf.Call());//1002

/*
script on the above wf:
number a = 2;
return a + Workflow_getGlobal("x");
*/