GS2-Distributor Transaction Actions

Specification of verify/consume/acquire transaction actions

VerifyAction

Gs2Distributor:IfExpressionByUserId

Validate the condition and switch the contents of the Consume Action

Evaluates a verify action as a condition, and executes either the trueActions or falseActions list of consume actions based on the result. This enables conditional branching within a transaction, allowing different consume actions to be executed depending on the verification outcome. When multiplyValueSpecifyingQuantity is enabled, the values used for verification are also multiplied by the specified quantity.

Whether the action allows quantity specification: NO

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
Set #{userId} to replace the currently logged in user ID.
conditionVerifyAction
Condition
trueActionsList<ConsumeAction>0 ~ 10 itemsList of Consume Actions to be executed when the condition is true
falseActionsList<ConsumeAction>0 ~ 10 itemsList of Consume Actions to be executed when the condition is false
multiplyValueSpecifyingQuantitybooltrueWhether to multiply the value used for verification when specifying the quantity
timeOffsetTokenstring~ 1024 charsTime offset token
{
    "action": "Gs2Distributor:IfExpressionByUserId",
    "request": {
        "namespaceName": "[string]Namespace name",
        "userId": "[string]User ID",
        "condition": {
            "action": "[string]Type of action to be executed in the Verify Action",
            "request": "[string]JSON string of the request used when executing the action"
        },
        "trueActions": [
            {
                "action": "[string]Type of action to be executed in the Consume Action",
                "request": "[string]JSON string of the request used when executing the action"
            }
        ],
        "falseActions": [
            {
                "action": "[string]Type of action to be executed in the Consume Action",
                "request": "[string]JSON string of the request used when executing the action"
            }
        ],
        "multiplyValueSpecifyingQuantity": "[bool]Whether to multiply the value used for verification when specifying the quantity",
        "timeOffsetToken": "[string]Time offset token"
    }
}
action: Gs2Distributor:IfExpressionByUserId
request:
  namespaceName: "[string]Namespace name"
  userId: "[string]User ID"
  condition: 
  action: "[string]Type of action to be executed in the Verify Action"
  request: "[string]JSON string of the request used when executing the action"
  trueActions: 
  - action: "[string]Type of action to be executed in the Consume Action"
    request: "[string]JSON string of the request used when executing the action"
  falseActions: 
  - action: "[string]Type of action to be executed in the Consume Action"
    request: "[string]JSON string of the request used when executing the action"
  multiplyValueSpecifyingQuantity: "[bool]Whether to multiply the value used for verification when specifying the quantity"
  timeOffsetToken: "[string]Time offset token"
transaction.service("distributor").verify.if_expression_by_user_id({
    namespaceName="[string]Namespace name",
    userId="[string]User ID",
    condition={
        action="[string]Type of action to be executed in the Verify Action",
        request="[string]JSON string of the request used when executing the action"
    },
    trueActions={
        {
            action="[string]Type of action to be executed in the Consume Action",
            request="[string]JSON string of the request used when executing the action"
        }
    },
    falseActions={
        {
            action="[string]Type of action to be executed in the Consume Action",
            request="[string]JSON string of the request used when executing the action"
        }
    },
    multiplyValueSpecifyingQuantity="[bool]Whether to multiply the value used for verification when specifying the quantity",
    timeOffsetToken="[string]Time offset token",
})

Gs2Distributor:AndExpressionByUserId

Perform multiple verification actions and determine if all are true

Executes multiple verify actions and succeeds only if all of them evaluate to true (AND logic). If any verify action fails, the entire expression fails. This is useful for combining multiple preconditions that must all be satisfied before proceeding with a transaction.

Whether the action allows quantity specification: NO

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
Set #{userId} to replace the currently logged in user ID.
actionsList<VerifyAction>0 ~ 10 itemsList of Verify Actions
timeOffsetTokenstring~ 1024 charsTime offset token
{
    "action": "Gs2Distributor:AndExpressionByUserId",
    "request": {
        "namespaceName": "[string]Namespace name",
        "userId": "[string]User ID",
        "actions": [
            {
                "action": "[string]Type of action to be executed in the Verify Action",
                "request": "[string]JSON string of the request used when executing the action"
            }
        ],
        "timeOffsetToken": "[string]Time offset token"
    }
}
action: Gs2Distributor:AndExpressionByUserId
request:
  namespaceName: "[string]Namespace name"
  userId: "[string]User ID"
  actions: 
  - action: "[string]Type of action to be executed in the Verify Action"
    request: "[string]JSON string of the request used when executing the action"
  timeOffsetToken: "[string]Time offset token"
transaction.service("distributor").verify.and_expression_by_user_id({
    namespaceName="[string]Namespace name",
    userId="[string]User ID",
    actions={
        {
            action="[string]Type of action to be executed in the Verify Action",
            request="[string]JSON string of the request used when executing the action"
        }
    },
    timeOffsetToken="[string]Time offset token",
})

Gs2Distributor:OrExpressionByUserId

Perform multiple verification actions and determine if any are true

Executes multiple verify actions and succeeds if at least one of them evaluates to true (OR logic). The expression fails only if all verify actions fail. This is useful for defining alternative conditions where satisfying any one of them is sufficient to proceed.

Whether the action allows quantity specification: NO

TypeConditionRequiredDefaultValue LimitsDescription
namespaceNamestring
~ 128 charsNamespace name
Namespace-specific name. Specified using alphanumeric characters, hyphens (-), underscores (_), and periods (.).
userIdstring
~ 128 charsUser ID
Set #{userId} to replace the currently logged in user ID.
actionsList<VerifyAction>0 ~ 10 itemsList of Verify Actions
timeOffsetTokenstring~ 1024 charsTime offset token
{
    "action": "Gs2Distributor:OrExpressionByUserId",
    "request": {
        "namespaceName": "[string]Namespace name",
        "userId": "[string]User ID",
        "actions": [
            {
                "action": "[string]Type of action to be executed in the Verify Action",
                "request": "[string]JSON string of the request used when executing the action"
            }
        ],
        "timeOffsetToken": "[string]Time offset token"
    }
}
action: Gs2Distributor:OrExpressionByUserId
request:
  namespaceName: "[string]Namespace name"
  userId: "[string]User ID"
  actions: 
  - action: "[string]Type of action to be executed in the Verify Action"
    request: "[string]JSON string of the request used when executing the action"
  timeOffsetToken: "[string]Time offset token"
transaction.service("distributor").verify.or_expression_by_user_id({
    namespaceName="[string]Namespace name",
    userId="[string]User ID",
    actions={
        {
            action="[string]Type of action to be executed in the Verify Action",
            request="[string]JSON string of the request used when executing the action"
        }
    },
    timeOffsetToken="[string]Time offset token",
})