JSON test cases
You can write your process tests in a JSON format instead of coding the test logic in Java. The JSON file describes the test cases with instructions that align with CPT's assertions and utilities.
CPT's JSON test cases are not compatible with the Test scenario files from the Web Modeler/Play.
Write a JSON test case
The JSON format is defined in the JSON schema. It defines the following structure:
testCases: An array of test cases to be executed.name: The name of the test case.description: A description of the test case.instructions: An array of instructions to execute the test case.- Each instruction has a
typethat defines the action to be performed (e.g.,CREATE_PROCESS_INSTANCE). - Additional properties depend on the instruction type (e.g., process definition ID, variables, etc.).
- Each instruction has a
How to start:
- Create a new JSON file in your test resources folder (e.g.,
src/test/resources/test-cases/invoice-approval.json) - Refer to the JSON schema
https://camunda.com/json-schema/cpt-test-cases/8.9/schema.jsonin the$schemaproperty. Use the same schema version as the CPT version you are using to ensure compatibility. - Add your test cases and use the available instructions to define the behavior of your process test.
The basic structure of the JSON file looks like this:
{
"$schema": "https://camunda.com/json-schema/cpt-test-cases/8.9/schema.json",
"testCases": [
{
"name": "My first test case",
"description": "A human readable description of the test case.",
"instructions": [
]
}
]
}
You can find a full example of a JSON test case file in the Examples section below.
Use AI to support the generation of your JSON files. Refer to the documentation, provide a description of your test case, and your BPMN processes to get a first draft of your test cases.
Or, use an IDE with JSON schema support to get auto-completion and validation while writing your test cases, for example IntelliJ IDEA.
Run a JSON test case
You can run your JSON test case files as a parameterized JUnit test. Add the @TestCaseSource annotation to your
test method to read the files and provide their test cases as arguments. Then, execute the test cases using the
TestCaseRunner provided by CPT.
The runner executes the test case instructions by leveraging CPT's assertions and utilities. If an assertion instruction fails, the runner throws an assertion error, causing the test to fail. If all instructions pass, the test case is considered successful.
- Camunda Spring Boot Starter
- Java client
@SpringBootTest
@CamundaSpringProcessTest
public class MyProcessTest {
@Autowired private TestCaseRunner testCaseRunner;
@ParameterizedTest
@TestCaseSource
void shouldPass(final TestCase testCase, final String fileName) {
// given: the process definitions are deployed
// when/then: run and verify the test case
testCaseRunner.run(testCase);
}
}
@CamundaProcessTest
public class MyProcessTest {
private TestCaseRunner testCaseRunner;
@ParameterizedTest
@TestCaseSource
void shouldPass(final TestCase testCase, final String fileName) {
// given: the process definitions are deployed
// when/then: run and verify the test case
testCaseRunner.run(testCase);
}
}
You can set the following fields in the @TestCaseSource annotation to configure which files to load:
directory: The classpath directory to scan for test cases JSON files. Defaults to/test-cases.fileNames: An array of specific file names to load from the directory. If not set, all files in the directory are loaded.fileExtension: The file extension to filter files in the directory. Defaults tojson. The filter is ignored iffileNamesis set.
Connect your process application
The TestCaseRunner integrates seamlessly with CPT's test lifecycle and connects
to your process application and starts the job workers, if enabled.
You can add additional steps before and after running the test case, for example to deploy additional resources, or to mock external services of your process application.
- Camunda Spring Boot Starter
- Java client
@SpringBootTest
@CamundaSpringProcessTest
public class MyProcessTest {
@Autowired private CamundaClient client;
@Autowired private CamundaProcessTestContext processTestContext;
@Autowired private TestCaseRunner testCaseRunner;
@MockitoBean private AccountingService accountingService;
@ParameterizedTest
@TestCaseSource
void shouldPass(final TestCase testCase, final String fileName) {
// given: the process definitions are deployed via @Deployment on the process application
// optionally: set up mocks, job workers, etc.
// when/then: run and verify the test case
testCaseRunner.run(testCase);
// optionally: verify mock invocations, external resources, etc.
Mockito.verify(accountingService).addInvoiceToAccount("0815", "INV-1001");
}
}
@CamundaProcessTest
@ExtendWith(MockitoExtension.class)
public class MyProcessTest {
private CamundaClient client;
private CamundaProcessTestContext processTestContext;
private TestCaseRunner testCaseRunner;
// Inject the mock in the process application
@Mock private AccountingService accountingService;
@ParameterizedTest
@TestCaseSource
@TestDeployment(resources = "invoice-approval.bpmn")
void shouldPass(final TestCase testCase, final String fileName) {
// given: the process definitions are deployed via @TestDeployment
// optionally: set up mocks, job workers, etc.
// when/then: run and verify the test case
testCaseRunner.run(testCase);
// optionally: verify mock invocations, external resources, etc.
Mockito.verify(accountingService).addInvoiceToAccount("0815", "INV-1001");
}
}
Examples
You can find some example process tests using the JSON test cases on GitHub, like the following one:
loading...
Reference: Instructions
Instructions define the actions and assertions to be performed in a test case. Each instruction has a type property that identifies the instruction, along with additional properties specific to that instruction type.
ASSERT_DECISION
An instruction to assert the evaluation of a decision. See the assertions documentation for more details.
| Property | Description | Type | Required | Default |
|---|---|---|---|---|
| type | Instruction type, must be "ASSERT_DECISION" | string | Yes | |
| decisionSelector | The selector to identify the decision. | DecisionSelector | Yes | |
| output | Expected output of the decision (any JSON type) | any | No | |
| matchedRules | Expected matched rule indexes | array of integer | No | |
| notMatchedRules | Expected not matched rule indexes | array of integer | No | |
| noMatchedRules | Assert that no rules were matched | boolean | No | false |
Example:
{
"type": "ASSERT_DECISION",
"decisionSelector": {
"decisionDefinitionId": "ChooseRocket"
},
"output": {
"rocket": "Ariane 6"
},
"matchedRules": [3]
}
ASSERT_ELEMENT_INSTANCE
An instruction to assert the state of an element instance. See the assertions documentation for more details.
| Property | Description | Type | Required | Default |
|---|---|---|---|---|
| type | Instruction type, must be "ASSERT_ELEMENT_INSTANCE" | string | Yes | |
| processInstanceSelector | The selector to identify the process instance. | ProcessInstanceSelector | Yes | |
| elementSelector | The selector to identify the element. | ElementSelector | Yes | |
| state | The expected state of the element instance. | enum: IS_ACTIVE, IS_COMPLETED, IS_TERMINATED | Yes | |
| amount | The expected amount of element instances in the given state. | integer (minimum: 1) | No | 1 |
Example:
{
"type": "ASSERT_ELEMENT_INSTANCE",
"processInstanceSelector": {
"processDefinitionId": "MoonExplorationProcess"
},
"elementSelector": {
"elementId": "LaunchRocket"
},
"state": "IS_COMPLETED"
}
ASSERT_ELEMENT_INSTANCES
An instruction to assert the state of multiple element instances. See the assertions documentation for more details.
| Property | Description | Type | Required | Default |
|---|---|---|---|---|
| type | Instruction type, must be "ASSERT_ELEMENT_INSTANCES" | string | Yes | |
| processInstanceSelector | The selector to identify the process instance. | ProcessInstanceSelector | Yes | |
| elementSelectors | The selectors to identify the elements. | array of ElementSelector | Yes | |
| state | The expected state of the element instances. | enum: IS_ACTIVE, IS_COMPLETED, IS_TERMINATED, IS_NOT_ACTIVE, IS_NOT_ACTIVATED, IS_ACTIVE_EXACTLY, IS_COMPLETED_IN_ORDER | Yes |
Example:
{
"type": "ASSERT_ELEMENT_INSTANCES",
"processInstanceSelector": {
"processDefinitionId": "MoonExplorationProcess"
},
"elementSelectors": [
{ "elementId": "PrepareMission" },
{ "elementId": "LaunchRocket" },
{ "elementId": "LandOnMoon" }
],
"state": "IS_COMPLETED_IN_ORDER"
}
ASSERT_PROCESS_INSTANCE
An instruction to assert the state of a process instance. See the assertions documentation for more details.
| Property | Description | Type | Required | Default |
|---|---|---|---|---|
| type | Instruction type, must be "ASSERT_PROCESS_INSTANCE" | string | Yes | |
| processInstanceSelector | The selector to identify the process instance. | ProcessInstanceSelector | Yes | |
| state | The expected state of the process instance. | enum: IS_ACTIVE, IS_COMPLETED, IS_CREATED, IS_TERMINATED | No | |
| hasActiveIncidents | Whether the process instance has active incidents. | boolean | No |
Example:
{
"type": "ASSERT_PROCESS_INSTANCE",
"processInstanceSelector": {
"processDefinitionId": "MoonExplorationProcess"
},
"state": "IS_COMPLETED"
}
ASSERT_PROCESS_INSTANCE_MESSAGE_SUBSCRIPTION
An instruction to assert the state of a process instance message subscription. See the assertions documentation for more details.
| Property | Description | Type | Required | Default |
|---|---|---|---|---|
| type | Instruction type, must be "ASSERT_PROCESS_INSTANCE_MESSAGE_SUBSCRIPTION" | string | Yes | |
| processInstanceSelector | The selector to identify the process instance. | ProcessInstanceSelector | Yes | |
| messageSelector | The selector to identify the message. | MessageSelector | Yes | |
| state | The expected state of the message subscription. | enum: IS_WAITING, IS_NOT_WAITING, IS_CORRELATED | Yes |
Example:
{
"type": "ASSERT_PROCESS_INSTANCE_MESSAGE_SUBSCRIPTION",
"processInstanceSelector": {
"processDefinitionId": "MoonExplorationProcess"
},
"messageSelector": {
"messageName": "AstronautReady"
},
"state": "IS_CORRELATED"
}
ASSERT_USER_TASK
An instruction to assert the state of a user task. See the assertions documentation for more details.
| Property | Description | Type | Required | Default |
|---|---|---|---|---|
| type | Instruction type, must be "ASSERT_USER_TASK" | string | Yes | |
| userTaskSelector | The selector to identify the user task. | UserTaskSelector | Yes | |
| state | The expected state of the user task. | enum: IS_CREATED, IS_COMPLETED, IS_CANCELED, IS_FAILED | No | |
| assignee | The expected assignee of the user task. | string | No | |
| candidateGroups | The expected candidate groups of the user task. | array of string | No | |
| priority | The expected priority of the user task. | integer | No | |
| elementId | The expected element ID of the user task. | string | No | |
| name | The expected name of the user task. | string | No | |
| dueDate | The expected due date of the user task in ISO-8601 format. | string | No | |
| followUpDate | The expected follow-up date of the user task in ISO-8601 format. | string | No |
Example:
{
"type": "ASSERT_USER_TASK",
"userTaskSelector": {
"elementId": "ReviewMissionPlan"
},
"state": "IS_CREATED",
"assignee": "zee-astronaut",
"priority": 100
}
ASSERT_VARIABLES
An instruction to assert the variables of a process instance. See the assertions documentation for more details.
| Property | Description | Type | Required | Default |
|---|---|---|---|---|
| type | Instruction type, must be "ASSERT_VARIABLES" | string | Yes | |
| processInstanceSelector | The selector to identify the process instance. | ProcessInstanceSelector | Yes | |
| elementSelector | The selector to identify the element for local variables. | ElementSelector | No | |
| variableNames | The expected variable names. | array of string | No | |
| variables | The expected variables with their values. | object | No |
Example:
{
"type": "ASSERT_VARIABLES",
"processInstanceSelector": {
"processDefinitionId": "MoonExplorationProcess"
},
"variables": {
"missionStatus": "completed",
"astronautName": "Zee"
}
}
BROADCAST_SIGNAL
An instruction to broadcast a signal.
| Property | Description | Type | Required | Default |
|---|---|---|---|---|
| type | Instruction type, must be "BROADCAST_SIGNAL" | string | Yes | |
| signalName | The name of the signal to broadcast. | string | Yes | |
| variables | The variables to broadcast with the signal. | object | No |
Example:
{
"type": "BROADCAST_SIGNAL",
"signalName": "EmergencyEvacuation",
"variables": {
"reason": "meteor-shower",
"destination": "space-station"
}
}
COMPLETE_JOB
An instruction to complete a job. See the utilities documentation for more details.
| Property | Description | Type | Required | Default |
|---|---|---|---|---|
| type | Instruction type, must be "COMPLETE_JOB" | string | Yes | |
| jobSelector | The selector to identify the job to complete. | JobSelector | Yes | |
| variables | The variables to complete the job with. | object | No | |
| useExampleData | Whether to complete the job with example data from the BPMN element. This property has precedence over variables. | boolean | No | false |
Example:
{
"type": "COMPLETE_JOB",
"jobSelector": {
"jobType": "analyze-moon-samples"
},
"variables": {
"analysisResult": "high-mineral-content"
}
}
COMPLETE_JOB_AD_HOC_SUB_PROCESS
An instruction to complete a job of an ad-hoc sub-process. See the utilities documentation for more details.
| Property | Description | Type | Required | Default |
|---|---|---|---|---|
| type | Instruction type, must be "COMPLETE_JOB_AD_HOC_SUB_PROCESS" | string | Yes | |
| jobSelector | The selector to identify the job to complete. | JobSelector | Yes | |
| variables | The variables to complete the job with. | object | No | |
| activateElements | The elements to activate in the ad-hoc sub-process. | array of ActivateElementInstruction | No | |
| cancelRemainingInstances | Whether to cancel remaining instances of the ad-hoc sub-process. | boolean | No | false |
| completionConditionFulfilled | Whether the completion condition of the ad-hoc sub-process is fulfilled. | boolean | No | false |
Activate Element Instruction
An instruction to activate an element in an ad-hoc sub-process.
| Property | Description | Type | Required |
|---|---|---|---|
| elementId | The ID of the element to activate. | string | Yes |
| variables | The variables to set when activating the element. | object | No |
Example:
{
"type": "COMPLETE_JOB_AD_HOC_SUB_PROCESS",
"jobSelector": {
"jobType": "conduct-experiment"
},
"variables": {
"experimentResult": "success"
},
"activateElements": [
{
"elementId": "CollectMoonSamples",
"variables": {
"sampleType": "regolith"
}
}
]
}
COMPLETE_JOB_USER_TASK_LISTENER
An instruction to complete a job of a user task listener. See the utilities documentation for more details.
| Property | Description | Type | Required | Default |
|---|---|---|---|---|
| type | Instruction type, must be "COMPLETE_JOB_USER_TASK_LISTENER" | string | Yes | |
| jobSelector | The selector to identify the job to complete. | JobSelector | Yes | |
| denied | Whether the worker denies the work. | boolean | No | false |
| deniedReason | The reason for denying the job. | string | No | |
| corrections | The corrections to apply to the user task. Only applicable if denied is false. | UserTaskCorrections | No |
User Task Corrections
The corrections to apply to a user task.
| Property | Description | Type | Required |
|---|---|---|---|
| assignee | The assignee of the task. | string | No |
| dueDate | The due date of the task. | string | No |
| followUpDate | The follow up date of the task. | string | No |
| candidateUsers | The candidate users of the task. | array of string | No |
| candidateGroups | The candidate groups of the task. | array of string | No |
| priority | The priority of the task. | integer | No |
Example:
{
"type": "COMPLETE_JOB_USER_TASK_LISTENER",
"jobSelector": {
"jobType": "validate-astronaut-assignment"
},
"corrections": {
"assignee": "zee-senior-astronaut",
"priority": 50
}
}
COMPLETE_USER_TASK
An instruction to complete a user task.See the utilities documentation for more details.
| Property | Description | Type | Required | Default |
|---|---|---|---|---|
| type | Instruction type, must be "COMPLETE_USER_TASK" | string | Yes | |
| userTaskSelector | The selector to identify the user task to complete. | UserTaskSelector | Yes | |
| variables | The variables to set when completing the user task. Ignored if useExampleData is true. | object | No | |
| useExampleData | Whether to complete the user task with example data from the BPMN element. If true, the variables property is ignored. | boolean | No | false |
Example:
{
"type": "COMPLETE_USER_TASK",
"userTaskSelector": {
"elementId": "ReviewMissionPlan"
},
"variables": {
"approved": true,
"comments": "Mission plan looks good for moon exploration"
}
}
CORRELATE_MESSAGE
An instruction to correlate a message.
| Property | Description | Type | Required | Default |
|---|---|---|---|---|
| type | Instruction type, must be "CORRELATE_MESSAGE" | string | Yes | |
| name | The name of the message. | string | Yes | |
| correlationKey | The correlation key of the message. | string | No | |
| variables | The variables to correlate with the message. | object | No |
Example:
{
"type": "CORRELATE_MESSAGE",
"name": "AstronautReady",
"correlationKey": "mission-001",
"variables": {
"astronautName": "Zee",
"status": "ready-for-launch"
}
}
CREATE_PROCESS_INSTANCE
An instruction to create a new process instance.
| Property | Description | Type | Required | Default |
|---|---|---|---|---|
| type | Instruction type, must be "CREATE_PROCESS_INSTANCE" | string | Yes | |
| processDefinitionSelector | The selector to identify the process definition to create the process instance for. | ProcessDefinitionSelector | Yes | |
| variables | The variables to create the process instance with. | object | No | |
| startInstructions | The instructions to execute when starting the process instance. | array of StartInstruction | No | |
| runtimeInstructions | The instructions to affect the runtime behavior of the process instance. | array of RuntimeInstruction | No |
Start Instruction
An instruction to execute when starting a process instance.
| Property | Description | Type | Required |
|---|---|---|---|
| elementId | The ID of the element to start the process instance at. | string | Yes |
Runtime Instruction
An instruction to affect the runtime behavior of a process instance.
| Property | Description | Type | Required |
|---|---|---|---|
| type | The type of the runtime instruction. Currently supports "TERMINATE_PROCESS_INSTANCE". | string | Yes |
| afterElementId | The ID of the element after which to terminate the process instance. Required when type is "TERMINATE_PROCESS_INSTANCE". | string | Yes |
Example:
{
"type": "CREATE_PROCESS_INSTANCE",
"processDefinitionSelector": {
"processDefinitionId": "MoonExplorationProcess"
},
"variables": {
"missionName": "Artemis-Zee",
"destination": "Moon",
"astronautCount": 4
}
}
EVALUATE_CONDITIONAL_START_EVENT
An instruction to evaluate conditional start events.
| Property | Description | Type | Required | Default |
|---|---|---|---|---|
| type | Instruction type, must be "EVALUATE_CONDITIONAL_START_EVENT" | string | Yes | |
| variables | The variables to evaluate the conditional start events with. | object | Yes |
Example:
{
"type": "EVALUATE_CONDITIONAL_START_EVENT",
"variables": {
"weatherCondition": "clear",
"fuelLevel": 100
}
}
EVALUATE_DECISION
An instruction to evaluate a DMN decision.
| Property | Description | Type | Required | Default |
|---|---|---|---|---|
| type | Instruction type, must be "EVALUATE_DECISION" | string | Yes | |
| decisionDefinitionSelector | The selector to identify the decision definition to evaluate. | DecisionDefinitionSelector | Yes | |
| variables | The variables to evaluate the decision with. | object | No |
Example:
{
"type": "EVALUATE_DECISION",
"decisionDefinitionSelector": {
"decisionDefinitionId": "ChooseRocket"
},
"variables": {
"payload": 5000,
"destination": "Moon"
}
}
INCREASE_TIME
An instruction to increase the time. See the utilities documentation for more details.
| Property | Description | Type | Required | Default |
|---|---|---|---|---|
| type | Instruction type, must be "INCREASE_TIME" | string | Yes | |
| duration | The duration to increase the time by, in ISO 8601 duration format (e.g., "PT1H", "P2D"). | string | Yes |
Example:
{
"type": "INCREASE_TIME",
"duration": "P3D"
}
MOCK_CHILD_PROCESS
An instruction to mock a child process. See the utilities documentation for more details.
| Property | Description | Type | Required | Default |
|---|---|---|---|---|
| type | Instruction type, must be "MOCK_CHILD_PROCESS" | string | Yes | |
| processDefinitionId | The ID of the child process to mock. | string | Yes | |
| variables | The variables to set for the mocked child process. | object | No |
Example:
{
"type": "MOCK_CHILD_PROCESS",
"processDefinitionId": "AstronautTrainingProcess",
"variables": {
"trainingCompleted": true,
"grade": "excellent"
}
}
MOCK_DMN_DECISION
An instruction to mock a DMN decision. See the utilities documentation for more details.
| Property | Description | Type | Required | Default |
|---|---|---|---|---|
| type | Instruction type, must be "MOCK_DMN_DECISION" | string | Yes | |
| decisionDefinitionId | The decision definition ID to mock. | string | Yes | |
| variables | The variables to set as the decision output. | object | No |
Example:
{
"type": "MOCK_DMN_DECISION",
"decisionDefinitionId": "ChooseRocket",
"variables": {
"rocket": "Falcon Heavy"
}
}
MOCK_JOB_WORKER_COMPLETE_JOB
An instruction to mock a job worker who completes jobs. See the utilities documentation for more details.
| Property | Description | Type | Required | Default |
|---|---|---|---|---|
| type | Instruction type, must be "MOCK_JOB_WORKER_COMPLETE_JOB" | string | Yes | |
| jobType | The job type to mock. This should match the zeebeJobType in the BPMN model. | string | Yes | |
| variables | The variables to complete the job with. | object | No | |
| useExampleData | Whether to use example data from the BPMN element. If true, the variables property is ignored. | boolean | No | false |
Example:
{
"type": "MOCK_JOB_WORKER_COMPLETE_JOB",
"jobType": "calculate-trajectory",
"variables": {
"trajectory": "optimal",
"fuelConsumption": 450
}
}
MOCK_JOB_WORKER_THROW_BPMN_ERROR
An instruction to mock a job worker who throws BPMN errors. See the utilities documentation for more details.
| Property | Description | Type | Required | Default |
|---|---|---|---|---|
| type | Instruction type, must be "MOCK_JOB_WORKER_THROW_BPMN_ERROR" | string | Yes | |
| jobType | The job type to mock. This should match the zeebeJobType in the BPMN model. | string | Yes | |
| errorCode | The error code to throw. This should match the error code in an error catch event. | string | Yes | |
| errorMessage | The error message to include when throwing the error. | string | No | |
| variables | The variables to include when throwing the error. | object | No |
Example:
{
"type": "MOCK_JOB_WORKER_THROW_BPMN_ERROR",
"jobType": "launch-rocket",
"errorCode": "WEATHER_UNSUITABLE",
"errorMessage": "High winds detected"
}
PUBLISH_MESSAGE
An instruction to publish a message.
| Property | Description | Type | Required | Default |
|---|---|---|---|---|
| type | Instruction type, must be "PUBLISH_MESSAGE" | string | Yes | |
| name | The name of the message. | string | Yes | |
| correlationKey | The correlation key of the message. | string | No | |
| variables | The variables to publish with the message. | object | No | |
| timeToLive | The time-to-live of the message in milliseconds. | integer | No | |
| messageId | The message ID for uniqueness. | string | No |
Example:
{
"type": "PUBLISH_MESSAGE",
"name": "LaunchApproved",
"correlationKey": "mission-001",
"variables": {
"approvedBy": "mission-control",
"launchWindow": "2026-03-15T10:00:00Z"
}
}
RESOLVE_INCIDENT
An instruction to resolve an incident. See the utilities documentation for more details.
| Property | Description | Type | Required | Default |
|---|---|---|---|---|
| type | Instruction type, must be "RESOLVE_INCIDENT" | string | Yes | |
| incidentSelector | The selector to identify the incident to resolve. | IncidentSelector | Yes |
Example:
{
"type": "RESOLVE_INCIDENT",
"incidentSelector": {
"elementId": "LaunchRocket"
}
}
SET_TIME
An instruction to set the time. See the utilities documentation for more details.
| Property | Description | Type | Required | Default |
|---|---|---|---|---|
| type | Instruction type, must be "SET_TIME" | string | Yes | |
| time | The time to set, in ISO 8601 instant format (e.g., "2026-01-19T13:00:00Z"). | string | Yes |
Example:
{
"type": "SET_TIME",
"time": "2026-03-15T10:00:00Z"
}
THROW_BPMN_ERROR_FROM_JOB
An instruction to throw a BPMN error from a job. See the utilities documentation for more details.
| Property | Description | Type | Required | Default |
|---|---|---|---|---|
| type | Instruction type, must be "THROW_BPMN_ERROR_FROM_JOB" | string | Yes | |
| jobSelector | The selector to identify the job to throw the error from. | JobSelector | Yes | |
| errorCode | The error code to throw. | string | Yes | |
| errorMessage | The error message to throw. | string | No | |
| variables | The variables to set when throwing the error. | object | No |
Example:
{
"type": "THROW_BPMN_ERROR_FROM_JOB",
"jobSelector": {
"jobType": "deploy-satellite"
},
"errorCode": "DEPLOYMENT_FAILED",
"errorMessage": "Insufficient orbital velocity"
}
UPDATE_VARIABLES
An instruction to create or update process instance variables. See the utilities documentation for more details.
| Property | Description | Type | Required | Default |
|---|---|---|---|---|
| type | Instruction type, must be "UPDATE_VARIABLES" | string | Yes | |
| processInstanceSelector | The selector to identify the process instance. | ProcessInstanceSelector | Yes | |
| variables | The variables to create or update. | object | Yes | |
| elementSelector | The selector to identify the element for local variables. | ElementSelector | No |
Example:
{
"type": "UPDATE_VARIABLES",
"processInstanceSelector": {
"processDefinitionId": "MoonExplorationProcess"
},
"variables": {
"currentPhase": "landing",
"fuelRemaining": 75
}
}
Reference: Selectors
Selectors are used to identify specific resources in your process tests. Each selector must contain at least one of the specified properties.
Decision Definition Selector
A selector to identify a decision definition.
| Property | Description | Type | Required |
|---|---|---|---|
| decisionDefinitionId | ID of the decision definition | string | Yes |
Example:
{
"decisionDefinitionId": "ChooseRocket"
}
Decision Selector
A selector to identify a decision. The selector must contain at least one of the following properties:
| Property | Description | Type | Required |
|---|---|---|---|
| decisionDefinitionId | ID of the decision definition | string | No |
| decisionDefinitionName | Name of the decision definition | string | No |
Example:
{
"decisionDefinitionId": "ChooseRocket"
}
Element Selector
A selector to identify a BPMN element. The selector must contain at least one of the following properties:
| Property | Description | Type | Required |
|---|---|---|---|
| elementId | ID of the BPMN element | string | No |
| elementName | Name of the BPMN element | string | No |
Example:
{
"elementId": "LaunchRocket"
}
Incident Selector
A selector to identify an incident. The selector must contain at least one of the following properties:
| Property | Description | Type | Required |
|---|---|---|---|
| elementId | ID of the BPMN element where the incident occurred | string | No |
| processDefinitionId | Process definition ID of the incident | string | No |
Example:
{
"elementId": "LaunchRocket"
}
Job Selector
A selector to identify a job. The selector must contain at least one of the following properties:
| Property | Description | Type | Required |
|---|---|---|---|
| jobType | Type of the job | string | No |
| elementId | ID of the BPMN element | string | No |
| processDefinitionId | Process definition ID of the job | string | No |
Example:
{
"jobType": "analyze-moon-samples"
}
Message Selector
A selector to identify a message.
| Property | Description | Type | Required |
|---|---|---|---|
| messageName | Name of the message | string | Yes |
| correlationKey | Correlation key of the message | string | No |
Example:
{
"messageName": "AstronautReady"
}
Process Definition Selector
A selector to identify a process definition.
| Property | Description | Type | Required |
|---|---|---|---|
| processDefinitionId | ID of the process definition | string | Yes |
Example:
{
"processDefinitionId": "MoonExplorationProcess"
}
Process Instance Selector
A selector to identify a process instance.
| Property | Description | Type | Required |
|---|---|---|---|
| processDefinitionId | Process definition ID of the process instance | string | Yes |
{
"processDefinitionId": "MoonExplorationProcess"
}
User Task Selector
A selector to identify a user task. The selector must contain at least one of the following properties:
| Property | Description | Type | Required |
|---|---|---|---|
| elementId | ID of the BPMN element | string | No |
| taskName | Name of the user task | string | No |
| processDefinitionId | Process definition ID of the user task | string | No |
Example:
{
"elementId": "ReviewMissionPlan"
}