Script Trigger Reference of GS2-StateMachine
Reference of event triggers that call extended scripts
Trigger
start
Start state machine
Synchronous Execution Script
The script is executed synchronously before the start state machine process.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| stateMachineMaster | StateMachineMaster | State machine master data |
| status | Status | Status |
| userId | string | User ID |
| parameters | string | Arguments to be passed to the state machine |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | 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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| stateMachineMaster | StateMachineMaster | State machine master data |
| status | Status | Status |
| userId | string | User ID |
| parameters | string | Arguments to be passed to the state machine |
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
The script is executed synchronously before the pass state machine process.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| stateMachineMaster | StateMachineMaster | State machine master data |
| status | Status | Status |
| userId | string | User ID |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | 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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| stateMachineMaster | StateMachineMaster | State machine master data |
| status | Status | Status |
| userId | string | User ID |
Implementation Example
namespace = args.namespace
stateMachineMaster = args.stateMachineMaster
status = args.status
userId = args.userId
result = {
}error
Error state machine
Synchronous Execution Script
The script is executed synchronously before the error state machine process.
Request
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| stateMachineMaster | StateMachineMaster | State machine master data |
| status | Status | Status |
| userId | string | User ID |
Result
| Type | Required | Default | Value Limits | Description | |
|---|---|---|---|---|---|
| permit | bool | ✓ | 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
| Type | Description | |
|---|---|---|
| namespace | Namespace | Namespace |
| stateMachineMaster | StateMachineMaster | State machine master data |
| status | Status | Status |
| userId | string | User ID |
Implementation Example
namespace = args.namespace
stateMachineMaster = args.stateMachineMaster
status = args.status
userId = args.userId
result = {
}