GS2-StateMachine Script トリガー リファレンス

拡張スクリプトを呼び出す イベントトリガー のリファレンス

トリガー

start

ステートマシンを開始

同期実行スクリプト

ステートマシンを開始処理の前に、スクリプトが同期実行されます。

Request
説明
namespaceNamespaceネームスペース
stateMachineMasterStateMachineMasterステートマシンマスターデータ
statusStatusステータス
userIdstringユーザーID
parametersstringステートマシンに渡す引数
Result
必須デフォルト値の制限説明
permitbool
開始を許可するか
実装例
-- 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
説明
namespaceNamespaceネームスペース
stateMachineMasterStateMachineMasterステートマシンマスターデータ
statusStatusステータス
userIdstringユーザーID
parametersstringステートマシンに渡す引数
実装例
-- 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
説明
namespaceNamespaceネームスペース
stateMachineMasterStateMachineMasterステートマシンマスターデータ
statusStatusステータス
userIdstringユーザーID
Result
必須デフォルト値の制限説明
permitbool
ステートマシンの正常終了を許可するか
実装例
-- 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
説明
namespaceNamespaceネームスペース
stateMachineMasterStateMachineMasterステートマシンマスターデータ
statusStatusステータス
userIdstringユーザー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
説明
namespaceNamespaceネームスペース
stateMachineMasterStateMachineMasterステートマシンマスターデータ
statusStatusステータス
userIdstringユーザーID
Result
必須デフォルト値の制限説明
permitbool
ステートマシンの異常終了を許可するか
実装例
-- 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
説明
namespaceNamespaceネームスペース
stateMachineMasterStateMachineMasterステートマシンマスターデータ
statusStatusステータス
userIdstringユーザー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 = {
}