Hi Guys…
I’ve been modeling a process and, since it has a few activities, I haven’t tried to run it manually yet just using the automated test (JUnit) where I’m experiencing some unexpected behaviors I’d like to check with you if I’m doing something wrong or not.
1) Reseting state after a test
Since every method in my test class is a different scenario, I expected to have the database reset after each one of them to avoid one test to “contaminate” other. Is there any configuration or technique I could use to get this behavior?
2) Parallel Multi Instance subProcess
I’ve defined a parallel multi instance subprocess with a boundary event and a simple activity following it. The idea is to go to this next activity when all the instances are done or finish them all if a certain condition is met. The boundary event is working fine but in the scenario where all the instances are finished sometimes the process just don’t move to the next “simple activity”. Sometimes it does (the same model, the same test)… Any idea of what could be happening ?
3) Message Events
In the subprocess, I want some instances to enter in a “wait mode” until another instance emits a message (kind of a waiting list). I’ve modeled it using end/intermediate message events but the catch event is never fired. I’m not sure if I’ve modeled it properly of if it’s any kind of limitation of the test environment.
4) BDD
Has anyone ever tried using any BDD framework like cucumber or jbehavior on top of camunda framework ?
Hi @fcordova,
regarding your questions:
-
Please have a look at the Github example test repo and the User Guide.
-
Do you see any errors? Maybe you run into some optimistic lock exceptions while joining the parallel flows. You can use asynchronous continuation to avoid this.
-
Please have a look at the Reference Guide. If you have still problem then share your BPMN process.
-
The community created some great extensions for tests, e.g., assertj or scenario.
Best regards,
Philipp
Hi @Philipp_Ossler, thanks for your reply…
-
I will…
-
No, no errors at all… Could you explain better what does the asynchronous continuation does exactly and any expected collateral effect ?
-
I tested the process manually and it didn’t work either, so I guess I had some problem with the model. I’ve got to go around it using a condition event and it’s working just fine.
-
Really excited with some of them, I’ll try them asap. Thanks !!!
Hi @fcordova,
regarding asynchronous continuation, please have a look at the User Guide. It describes in detail when you need it and how to use it.
Best regards,
Philipp
Hello @fcordova,
Concerning (1): I think the container is started once for the testclass and reused afterwards for each method. Probably an alternative Testframework might help you.I am working on ejb-cdi-unit that simulates with the help of cdi-unit a limited container environment and reinitializes CDI-Container and therefore the embedded processengine including its database for each test.
This is slower but makes the determinism of the tests normally better since no possible previous leftovers can change the outcome of your statements.
I just ported the tests from engine-cdi to ejb-cdi-unit and included the Base-Test-class: CdiProcessEngineTestCase in the Version 1.0.8 of the artifact.
This might help, but is yet in a quite early stage of development. I would be glad, if you looked into this and told me what you think, better, if you could use the approach.