Skip to content

ScriptHandler

ralphhanna edited this page Dec 18, 2023 · 1 revision

bpmn-server / ScriptHandler

Class: ScriptHandler

Table of contents

Constructors

Methods

Constructors

constructor

new ScriptHandler(): ScriptHandler

Returns

ScriptHandler

Methods

evaluateExpression

evaluateExpression(scope, expression): any

Parameters

Name Type
scope any
expression any

Returns

any

Defined in

engine/ScriptHandler.ts:46


evaluateInputExpression

evaluateInputExpression(item, exp, dateFormat?): Promise<any>

  • these expression are strings with $
  • scenarios:
  •   String          =>as is
    
  •   $javaScript     =>evaulated
    
  •   a , b , c       =>array
    
  •   dateString      =>convert to date
    
  • Examples:
  •     ['T', `user1`],
    
    ['T', $(appServices.test1(100))], ['T', $(appServices.getSupervisorUser('user1'))], ['T', abc,xyz,user group], ['TD', 2022-10-11],
    • appDelegate.scopeEval -->evaluateExpression
      
    • appDelegate.scopeJS   -->executeScript
      

Parameters

Name Type Default value
item any undefined
exp any undefined
dateFormat boolean false

Returns

Promise<any>

Defined in

engine/ScriptHandler.ts:24


executeScript

executeScript(scope, script): Promise<any>

Parameters

Name Type
scope any
script any

Returns

Promise<any>

Defined in

engine/ScriptHandler.ts:75


getJSvars

getJSvars(scope): "\n var data=this.data;\n var input=this.input;\n var output=this.output;\n var appDelegate=this.execution.appDelegate;\n var appServices=this.execution.servicesProvider;\n var appUtils=appDelegate.appUtils;\n var item=this; // for backward support only\n " | "\n var item=this;\n var data=this.data;\n var input=this.input;\n var output=this.output;\n var appDelegate=this.token.execution.appDelegate;\n var appServices=this.token.execution.servicesProvider;\n var appUtils=appDelegate.appUtils;\n "

Parameters

Name Type
scope any

Returns

"\n var data=this.data;\n var input=this.input;\n var output=this.output;\n var appDelegate=this.execution.appDelegate;\n var appServices=this.execution.servicesProvider;\n var appUtils=appDelegate.appUtils;\n var item=this; // for backward support only\n " | "\n var item=this;\n var data=this.data;\n var input=this.input;\n var output=this.output;\n var appDelegate=this.token.execution.appDelegate;\n var appServices=this.token.execution.servicesProvider;\n var appUtils=appDelegate.appUtils;\n "

Defined in

engine/ScriptHandler.ts:116

Clone this wiki locally