All resources
Build3 min read

Build without the backend: mocking service tasks

Give a service task a pretend response, delay and failure rate, so you can run the whole process before the real system or worker exists.

In short

  • 01

    A mocked task finishes on its own — no worker needed.

  • 02

    Return one fixed response, or pick randomly from several.

  • 03

    Simulate slow and failing systems with a delay and a failure rate.

Process design usually gets blocked on integration: the payment API is not ready, the worker is not written. Mock mode removes the wait. You describe what the task should return, and the engine plays that part.

The four settings

SettingWhat it doesExample
Mock responseVariables the task writes back when it succeeds{"status": "OK"}
Response variantsSeveral responses; one is picked at random each run[{"approved": true}, {"approved": false}]
Failure rateChance from 0 to 1 that the task fails0.1 (fails one time in ten)
DelayPretend latency in milliseconds200

Set them on the service task in Studio's properties panel. In the BPMN file they are stored as attributes on the task:

<bpmn:serviceTask id="charge-card"
    orkovia:jobType="charge-card"
    orkovia:mockResponse='{"status": "OK"}'
    orkovia:mockFailureRate="0.1"
    orkovia:mockDelayMillis="200"/>

How a mocked task behaves

  • Setting any mock field switches the task to mock mode. It takes priority over the job type.
  • The task completes straight away and no job is created, so no worker has to be running.
  • A mocked failure behaves like a real one: the instance fails and an incident is raised, so you can practise recovery too.
  • A task with no mock settings behaves exactly as before.

Where it helps

1
Early design
Run the full process end to end on day one, then replace mocks with real workers one by one.
2
Demos
Show a process without connecting to live systems.
3
Testing unhappy paths
Use a failure rate and response variants to exercise error handling and both sides of a gateway.
Remove mock settings before going live. A mocked task never calls the real system.

See it on your own process

Book a walkthrough with the Orkovia team.

Request a Demo