Member Junction
    Preparing search index...

    Action that executes different actions based on a condition

    // Simple condition with action execution
    await runAction({
    ActionName: 'Conditional',
    Params: [{
    Name: 'Condition',
    Value: 'value > 100'
    }, {
    Name: 'Context',
    Value: { value: 150 }
    }, {
    Name: 'TrueAction',
    Value: {
    ActionName: 'Send Single Message',
    Params: {
    MessageTypeID: 'alert-id',
    To: 'admin@example.com',
    Subject: 'High Value Alert'
    }
    }
    }, {
    Name: 'FalseAction',
    Value: {
    ActionName: 'Calculate Expression',
    Params: { Expression: 'value * 0.9', value: 150 }
    }
    }]
    });

    // With passthrough context
    await runAction({
    ActionName: 'Conditional',
    Params: [{
    Name: 'Condition',
    Value: 'user.role === "admin"'
    }, {
    Name: 'Context',
    Value: { user: { role: 'admin', id: 123 } }
    }, {
    Name: 'PassthroughContext',
    Value: true
    }, {
    Name: 'TrueAction',
    Value: {
    ActionName: 'Get Record',
    Params: { EntityName: 'Admin Settings' }
    }
    }]
    });

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    AuthorizesCaller: boolean

    True when the action authorizes its caller itself, so a public entry point such as the RunAction mutation may run it for an authenticated user without an MJ: Action Authorizations link. Set it only on an action that either checks an authorization the caller must hold, or reads and writes only with the caller's own permissions. Leave it false for an action that acts with more authority than its caller, or that reaches data or sends messages the caller chooses but could not otherwise reach.

    The engine reads the marker only from the class that runs, never from its parent classes. A subclass that overrides a marked action must declare the marker again.

    Methods

    • Executes actions based on a condition

      Parameters

      • params: RunActionParams

        The action parameters containing:

        • Condition: JavaScript expression string to evaluate (required)
        • Context: Object with variables for condition evaluation (optional)
        • TrueAction: Action configuration to run if condition is true (optional)
        • FalseAction: Action configuration to run if condition is false (optional)
        • PassthroughContext: Boolean - pass context to child actions (default: false)
        • StrictMode: ignored; kept so existing callers still validate

      Returns Promise<ActionResultSimple>

      Result from executed action or condition result