GS2-StateMachine Script トリガー リファレンス
拡張スクリプトを呼び出す イベントトリガー のリファレンス
トリガー
start
ステートマシンを開始
同期実行スクリプト
ステートマシンを開始処理の前に、スクリプトが同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| stateMachineMaster | StateMachineMaster | ステートマシンマスターデータ |
| status | Status | ステータス |
| userId | string | ユーザーID |
| parameters | string | ステートマシンに渡す引数 |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| permit | bool | ✓ | 開始を許可するか |
実装例
-- Request
local namespace = args.namespace
local stateMachineMaster = args.stateMachineMaster
local status = args.status
local userId = args.userId
local parameters = args.parameters
-- Business logic:
local permit = true
-- Result
result = {
permit=permit
}非同期実行スクリプト
ステートマシンを開始処理の後に、スクリプトが非同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| stateMachineMaster | StateMachineMaster | ステートマシンマスターデータ |
| status | Status | ステータス |
| userId | string | ユーザーID |
| parameters | string | ステートマシンに渡す引数 |
実装例
-- Request
local namespace = args.namespace
local stateMachineMaster = args.stateMachineMaster
local status = args.status
local userId = args.userId
local parameters = args.parameters
-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.
result = {
}pass
ステートマシンが正常終了
同期実行スクリプト
ステートマシンが正常終了処理の前に、スクリプトが同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| stateMachineMaster | StateMachineMaster | ステートマシンマスターデータ |
| status | Status | ステータス |
| userId | string | ユーザーID |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| permit | bool | ✓ | ステートマシンの正常終了を許可するか |
実装例
-- Request
local namespace = args.namespace
local stateMachineMaster = args.stateMachineMaster
local status = args.status
local userId = args.userId
-- Business logic:
local permit = true
-- Result
result = {
permit=permit
}非同期実行スクリプト
ステートマシンが正常終了処理の後に、スクリプトが非同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| stateMachineMaster | StateMachineMaster | ステートマシンマスターデータ |
| status | Status | ステータス |
| userId | string | ユーザーID |
実装例
-- Request
local namespace = args.namespace
local stateMachineMaster = args.stateMachineMaster
local status = args.status
local userId = args.userId
-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.
result = {
}error
ステートマシンが異常終了
同期実行スクリプト
ステートマシンが異常終了処理の前に、スクリプトが同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| stateMachineMaster | StateMachineMaster | ステートマシンマスターデータ |
| status | Status | ステータス |
| userId | string | ユーザーID |
Result
| 型 | 必須 | デフォルト | 値の制限 | 説明 | |
|---|---|---|---|---|---|
| permit | bool | ✓ | ステートマシンの異常終了を許可するか |
実装例
-- Request
local namespace = args.namespace
local stateMachineMaster = args.stateMachineMaster
local status = args.status
local userId = args.userId
-- Business logic:
local permit = true
-- Result
result = {
permit=permit
}非同期実行スクリプト
ステートマシンが異常終了処理の後に、スクリプトが非同期実行されます。
Request
| 型 | 説明 | |
|---|---|---|
| namespace | Namespace | ネームスペース |
| stateMachineMaster | StateMachineMaster | ステートマシンマスターデータ |
| status | Status | ステータス |
| userId | string | ユーザーID |
実装例
-- Request
local namespace = args.namespace
local stateMachineMaster = args.stateMachineMaster
local status = args.status
local userId = args.userId
-- Asynchronous scripts typically do not affect the API response.
-- Use for logging, analytics, external notifications, etc.
result = {
}