Trigger Reference of GS2-StateMachine Script

Reference of event triggers that call extended scripts

Trigger

start

Start state machine

Synchronous Execution Script

Script and Start state machine are executed synchronously in that order.

Request
TypeDescription
namespaceNamespaceNamespace
stateMachineMasterStateMachineMasterState machine master data
statusStatusStatus
userIdstringUser ID
parametersstringArguments to be passed to the state machine
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow start
Implementation Example
namespace = args.namespace
stateMachineMaster = args.stateMachineMaster
status = args.status
userId = args.userId
parameters = args.parameters

result = {
  permit=permit
}

Asynchronous Execution Script

The script executes asynchronously after the Start state machine.

Request
TypeDescription
namespaceNamespaceNamespace
stateMachineMasterStateMachineMasterState machine master data
statusStatusStatus
userIdstringUser ID
parametersstringArguments to be passed to the state machine
Result
TypeRequiredDefaultValue LimitsDescription
Implementation Example
namespace = args.namespace
stateMachineMaster = args.stateMachineMaster
status = args.status
userId = args.userId
parameters = args.parameters

result = {
}

pass

Pass state machine

Synchronous Execution Script

Script and Pass state machine are executed synchronously in that order.

Request
TypeDescription
namespaceNamespaceNamespace
stateMachineMasterStateMachineMasterState machine master data
statusStatusStatus
userIdstringUser ID
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow the state machine to finish normally
Implementation Example
namespace = args.namespace
stateMachineMaster = args.stateMachineMaster
status = args.status
userId = args.userId

result = {
  permit=permit
}

Asynchronous Execution Script

The script executes asynchronously after the Pass state machine.

Request
TypeDescription
namespaceNamespaceNamespace
stateMachineMasterStateMachineMasterState machine master data
statusStatusStatus
userIdstringUser ID
Result
TypeRequiredDefaultValue LimitsDescription
Implementation Example
namespace = args.namespace
stateMachineMaster = args.stateMachineMaster
status = args.status
userId = args.userId

result = {
}

error

Error state machine

Synchronous Execution Script

Script and Error state machine are executed synchronously in that order.

Request
TypeDescription
namespaceNamespaceNamespace
stateMachineMasterStateMachineMasterState machine master data
statusStatusStatus
userIdstringUser ID
Result
TypeRequiredDefaultValue LimitsDescription
permitbool
Whether to allow an error state machine termination
Implementation Example
namespace = args.namespace
stateMachineMaster = args.stateMachineMaster
status = args.status
userId = args.userId

result = {
  permit=permit
}

Asynchronous Execution Script

The script executes asynchronously after the Error state machine.

Request
TypeDescription
namespaceNamespaceNamespace
stateMachineMasterStateMachineMasterState machine master data
statusStatusStatus
userIdstringUser ID
Result
TypeRequiredDefaultValue LimitsDescription
Implementation Example
namespace = args.namespace
stateMachineMaster = args.stateMachineMaster
status = args.status
userId = args.userId

result = {
}