I have a process with 2 Service Class (Implementation: Java Class) and a gateway.
When I compile under Eclipse it is working well.
But I have an issue when I add a User Task (need to input a number before proceeding) at the beginning of the process.
This is the error when compiling: java.lang.AssertionError: Expecting ProcessInstance {id='4', processDefinitionId='PolicyRule:1:3', businessKey='null'} to be ended, but it is not!. (Please make sure you have set the history service of the engine to at least 'activity' or a higher level before making use of this assertion!)
I have tried several ways to solve this problem but in vain.
Grateful if you guys could help (I have attached the bpmn file as well).
The error occurs when I compile under Eclipse (Run As → Maven install).
I have noticed that the error occurred when I added the “Input application number” process which is a User Task. If I remove this process, then it is working fine. But the thing is that I need to read the user’s input so that I may use the variable in the service task “Check customer status”.
Additionally if I replace the User Task by a simple Task and compile again, then there are no errors. I don’t understand why the error is happening when simply adding a user task.
Are you running tests?
If you haven’t changed the default JUnit test to match your process then it’s going to fail.
Either remove the test or run the maven built and skip tests to see if that works.
Results :
Failed tests: testHappyPath(proj.camunda.demo.PolicyRule.ProcessUnitTest): Expecting ProcessInstance {id='4', processDefinitionId='PolicyRule:1:3', businessKey='null'} to be ended, but it is not!. (Please make sure you have set the history service of the engine to at least 'activity' or a higher level before making use of this assertion!)
Tests run: 1, Failures: 1, Errors: 0, Skipped: 0
You mean I can comment out the test or is there a particular way to disable/skip it?
Thanks.
I recall that there is a tickbox somewhere that lets you run a maven built that skips the Unit test.
If you can’t figure that out then commenting out the tests will have the same affect.
I have been able to skip the test by specifying it in the pom.xml.
It is now compiling ok.
<properties>
<camunda.version>7.14.0</camunda.version>
<!--
Adjust if you want to use Camunda Enterprise Edition (EE):
<camunda.version>7.14.0-ee</camunda.version>
Make sure you also switch to EE repository below
-->
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<failOnMissingWebXml>false</failOnMissingWebXml>
**<skipTests>true</skipTests>**
</properties>
But, now I am encountering another issue when running the process in Camunda (see below). Unknown property used in expression: #{blacklisted}. Cause: Cannot resolve identifier 'blacklisted'
It seems that now, Camunda cannot see the variable “blacklisted” which is being declared and computed in the Service Task “Check customer status”.
As said before, the process was working fine before the addition of the user task at the beginning.
Can you upload your model and show the code being run by the service task?
I would also ask that if you post the code here can you take a look at how to format it correctly so that i can easily read it.
I have been able to solve the problem by changing the type of apply_no from int to long (same type declared in the model).
I am now able to launch the process, input the application number and the service task is being correctly executed.