camunda-community-hub / zeebe-spec

A tool to run tests for BPMN processes on Zeebe
Apache License 2.0
29 stars 5 forks source link

Trouble with completing task of timeDuration with value of string type #349

Open IKurganov opened 2 weeks ago

IKurganov commented 2 weeks ago

Hello! Need your help

I have such worker

... PT5M How could I resolve it by completeTask? There is example of test for worker with timeDuration's value not in string, but in variable "properties.timerDurations.DURATION" completeTask( jobType = T.workerType, variables = mapOf( "status" to "PROCESSING", "properties" to mapOf( "timerDurations" to mapOf( "DURATION" to Duration.ofSeconds(1).toString() ) ) ) ) scheme: = properties.timerDurations.DURATION
saig0 commented 2 weeks ago

In your process, you have a timer catch event. The timer waits until the given duration is over. You can't trigger a timer event using completeTask() as this works only for service tasks.

Currently, bpmn-spec has no action to trigger a timer event. We would need to add this feature.

IKurganov commented 2 weeks ago

Thank you for your reply, I'm looking forward to the new feature

saig0 commented 2 weeks ago

@IKurganov I don't plan to implement the feature soon. However, I'm open to contributions. :sweat_smile:

I don't maintain this project actively anymore. Instead, I'm working on the new official process testing library of Camunda 8: Camunda Process Test. Eventually, the new library will provide a similar way to define the test cases and replace this community project.