Datamanager flow JSON Schema: Conditional result

Conditional result

A conditional result object represents a result that will be chosen when it is the first in an array of conditional results whose condition evaluates to true. It is the same was as the default result object in all other regards.

Summary

result:
  id: my-conditional-result
  condition:
    # condition object
  thisStep: complete
  activateSteps: [ step1, step2 ]
  skipSteps: [ step3 ]
  completeSteps: [ step4 ]
  pendingSteps: [ step5 ]
  skipIncompleteSteps: [ step6 ]
  activateIncompleteSteps: [ step7, step8 ]
  joins: [ joinx ]
  appendState:
    # abitrary object of data to append to state (supports state variable substitution)
  preHandlers:
    # optional array of handler objects
  postHandlers:
    # optional array of handler objects

Properties

Name Required Type Description
id true string Unique ID of the result (unique to the parent action)
condition true object A condition object that must evaluate to true in order for the result to be chosen as the parent action's result.
thisStep false string Status to migrate this step to. Either, 'pending', 'skipped', 'complete' (default if not specified)
activateSteps false array Array of step IDs to transition to an active status
skipSteps false array Array of step IDs to transition to a skipped status
completeSteps false array Array of step IDs to transition to a complete status
pendingSteps false array Array of step IDs to transition to a pending status
skipIncompleteSteps false array Array of step IDs to transition to a skipped status if they are currently either active or pending
activateIncompleteSteps false array Array of step IDs to transition to a active status when they are currently in a pending status (i.e. excludes skipped and completed steps)
joins false array Array of join IDs to be evaluated with this result
appendState false array Arbitrary object of data to append to the workflow state (by default, this will append to the object's database record for any matching columns)
preHandlers false array Array of handler objects that will be executed before any steps are transitioned
postHandlers false array Array of handler objects that will be executed after any steps are transitioned

JSON schema

{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "datamanager.conditionalresult.schema.json",
    "type": "object",
    "title": "Action result",
    "additionalProperties": false,
    "required":[ "id","condition" ],
    "anyOf": [
        { "required": [ "joins"                   ]},
        { "required": [ "activateSteps"           ]},
        { "required": [ "skipSteps"               ]},
        { "required": [ "completeSteps"           ]},
        { "required": [ "pendingSteps"            ]},
        { "required": [ "skipIncompleteSteps"     ]},
        { "required": [ "activateIncompleteSteps" ]}
    ],
    "properties":{
        "id"                      : { "type":"string", "description":"Unique identifier for the conditional result (unique to the parent action)"},
        "condition"               : { "type":"object", "$ref":"datamanager.condition.schema.json"},
        "thisStep"                : { "type":"string", "description":"The status to set this state to. Default is 'complete' if not defined. Cannot be 'active'.", "enum":[ "pending","complete","skipped" ] },
        "activateSteps"           : { "type":"array" , "description":"Optional array of step IDs to transition to an active state" , "items":{"type":"string"} },
        "skipSteps"               : { "type":"array" , "description":"Optional array of step IDs to transition to a skipped state" , "items":{"type":"string"} },
        "completeSteps"           : { "type":"array" , "description":"Optional array of step IDs to transition to a complete state", "items":{"type":"string"} },
        "pendingSteps"            : { "type":"array" , "description":"Optional array of step IDs to transition to a pending state" , "items":{"type":"string"} },
        "skipIncompleteSteps"     : { "type":"array" , "description":"Optional array of step IDs to transition to a skipped state (if not already skipped or complete)" , "items":{"type":"string"} },
        "activateIncompleteSteps" : { "type":"array" , "description":"Optional array of step IDs to transition to an active state (if not already skipped or complete)" , "items":{"type":"string"} },
        "appendState"             : { "type":"object", "description":"Abitrary data to append to the flow state."},
        "joins"                   : { "type":"array" , "description":"Optional array of join IDs to execute after this result (if all join steps are complete)" , "items":{"type":"string"} },
        "preHandlers"             : { "type":"array" , "description":"Array of pre-handlers to run before steps are transitioned.", "items":{"type":"object", "$ref":"datamanager.handler.schema.json"} },
        "postHandlers"            : { "type":"array" , "description":"Array of pre-handlers to run before steps are transitioned.", "items":{"type":"object", "$ref":"datamanager.handler.schema.json"} }
    }
}