Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

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

Open
IKurganov opened this issue Oct 7, 2024 · 3 comments
Open

Comments

@IKurganov
Copy link

Hello! Need your help

I have such worker
bpmn:intermediateCatchEvent
...
bpmn:timerEventDefinition"
<bpmn:timeDuration xsi:type="bpmn:tFormalExpression">PT5M</bpmn:timeDuration>
</bpmn:timerEventDefinition>
</bpmn:intermediateCatchEvent>

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:

bpmn:timerEventDefinition
<bpmn:timeDuration xsi:type="bpmn:tFormalExpression">= properties.timerDurations.DURATION</bpmn:timeDuration>
</bpmn:timerEventDefinition>

@saig0
Copy link
Collaborator

saig0 commented Oct 8, 2024

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
Copy link
Author

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

@saig0
Copy link
Collaborator

saig0 commented Oct 8, 2024

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

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.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants