Completing waiting Tasks by hand

I have recently started a perf-testing feature. We are using an embedded instance of Camunda in our Spring-boot application.

We would like to reuse our populated DB between perf-test runs as to mimic a production DB, the issue that we are facing is… a number of workflows that are created towards the end of one perf run, will then become live and attempt to retry at the start of our next perf run. Ideally we would like to have no pending tasks in-between, completing them all by hand (preferably mocking their completion).

Could anyone suggest a method in order to achieve this? Im not sure some of the API suggested in the docs is available because we are using the embedded Camunda engine.

Would it be possible to change the status’ of the tasks in the db using sql statements, in preparation of starting server/testing?

Any help is much appreciated!

Updating tasks entity directly in db using scripts is not a good practice, which leads to data inconsistency and transactional issues.

Rather than this approach, I would suggest standard approach to handle/complete the tasks using Java API/Rest API to handle the tasks without any issues.

Example:

@Autowired
private TaskService taskService;

public void completeTask(String taskId, Map<String, Object> processVariables) {
	taskService.complete(taskId, processVariables);
}

We would like to reuse our populated DB between perf-test runs as to mimic a production DB

If restoring the test context is not too time consuming, I would recreate the context before a new test run.
With this, it is no longer a Camunda issue but more of an automated test best practice.

I will attempt to add a hook for the Java API.

Im just reading through the documentation, do you know if it is possible to mock the completion?

@KingMark For testing the process we can mock. In realtime process execution I would recommend to process the task.

If suppose the task itself doesn’t add any business value in the process you can avoid modelling it.

Another hint is like attaching timer boundary event to the task which will complete the task once time lapses.