Providing a unit test

1,780 views
Skip to first unread message

Daniel Meyer

unread,
Apr 23, 2014, 11:39:37 AM4/23/14
to
Hi All,

Sometimes you discover bugs in the process engine or you notice a behavior where you are not sure whether it is expected or not. 
Such situations are often surprisingly hard to describe in plain language but can be communicated in code much more accurately.

In such situations we will ask you to provide a unit test demonstrating the behavior you want to discuss. 
In order to make it easier for you to provide a unit test we created a simple project template which you can use and adapt:

Thank you all for your many valuable contributions to the camunda community!

Cheers,
Daniel Meyer
Project Lead

Alfonso Mateos Alarcón

unread,
Apr 24, 2014, 10:08:15 AM4/24/14
to camunda-...@googlegroups.com
Thanks a lot! I'll do so next time!

Peter Metz

unread,
Jun 24, 2014, 3:52:49 AM6/24/14
to camunda-...@googlegroups.com
Hello Daniel, 
thanks for your hint :-)

I'll try this to find the reason for a strange behaviour: deploying a model with eclipse Kepler x86 32bit version + maven + camunda works fine. Same thing but using an eclipse Kepler x64 64bit does not work. But there are NO ERR message, nothing. The model just does not appear in the camunda cockpit. (Apache Tomcat/7.0.54 1.7.0_60-b19 Oracle Corporation Windows Server 2008 R2 6.1 amd64)

Best Regards, Peter
Message has been deleted

gar...@tdbfusion.com

unread,
Oct 16, 2014, 10:47:58 AM10/16/14
to camunda-...@googlegroups.com
Hi Daniel,

The POM for the unit test example needs updating to include:

<groupId>org.camunda.bpm.extension</groupId>
<artifactId>camunda-bpm-assert</artifactId>
<version>1.1</version>

rather than

<groupId>org.camunda.bpm.extension</groupId>
<artifactId>camunda-bpm-assert</artifactId>
<version>1.0</version>

1.0 is no longer hosted.

Kind Regards

Gareth
--
Confidentiality Notice:
The contents of this e-mail and any attachments are intended for the named
addressee only and may be confidential. Unless you are the named addressee
or authorised to receive the e-mail of the named addressee, you may not
disclose, use or copy the contents of this e-mail. If you have received
this e-mail in error, please contact the sender and delete the e-mail
immediately. TDB Holdings Limited and its associated group companies do not
accept responsibility for this message and any views or opinions contained
within this e-mail are solely those of the author unless expressly stated
otherwise.

Daniel Meyer

unread,
Oct 16, 2014, 10:50:29 AM10/16/14
to camunda-...@googlegroups.com
Hi Gareth,

thanks, we'll look into it. I think Martin already prepared a Pull
Request, we'll just need to merge it :)

Daniel

galen...@gmail.com

unread,
Jan 13, 2015, 5:48:14 PM1/13/15
to camunda-...@googlegroups.com
Hi,

I was able to get this unit test framework to run, and execute a process I created.
However, as soon as I add

camunda:async="true"

to a task, the process seems to stall out. I think this might have something to do with the way this framework is setup with the H2 database, but I'm not sure.

I've setup two unit tests. Each of them are exactly the same except one has the script task marked as async, and the other doesn't.

++++++++++

Get and compile unit test:
git clone https://github.com/druid77/camunda_locking_parallel_gateway_unit_test.git
cd camunda_locking_parallel_gateway_unit_test
mvn clean compile

To run with async script task:
mvn -Dtest=SimpleTestCase#simpleNoAsync test

To run with no async script task:
mvn -Dtest=SimpleTestCase#simpleNoAsync test


As you can see, the process with async doesn't complete (prints out "IS ENDED: false").
Am I doing something wrong here?
In another test, I tried this with a serviceTask (using a JavaDelegate), and it also stalled out...

Any ideas?

Thanks,
Galen

galen...@gmail.com

unread,
Jan 13, 2015, 5:54:39 PM1/13/15
to camunda-...@googlegroups.com, galen...@gmail.com
I made a typo in my post - The first test was supposed to say:

mvn -Dtest=SimpleTestCase#simpleWithAsync test

thorben....@camunda.com

unread,
Jan 14, 2015, 3:07:31 AM1/14/15
to camunda-...@googlegroups.com, galen...@gmail.com
Hi Galen,

For better testability, the job executor is deactivated in the engine configuration in the testing template. In unit tests, it is often easier to manually trigger job execution by using the ManagementService. If you want to activate the job executor anyway, make sure to change the following line in camunda.cfg.xml:

<property name="jobExecutorActivate" value="false" />

to the value "true".

Cheers,
Thorben

galen...@gmail.com

unread,
Jan 14, 2015, 9:25:43 AM1/14/15
to camunda-...@googlegroups.com, galen...@gmail.com
Thanks, this makes sense why it was stalling now. I enabled that property, and now the process executes as expected!

Galen

kirsten...@gmail.com

unread,
Mar 23, 2015, 5:01:25 AM3/23/15
to camunda-...@googlegroups.com
Hello,

I am new in the camunda area.
I am currently trying out to test a process via Unit Testing.
I found this example (1) http://docs.camunda.org/7.2/guides/user-guide/#testing-unit-testing and the project example you were talking about in this forum (2) https://github.com/camunda/camunda-engine-unittest.

1.question:
In example (1), I don't what and how I have to configure, that the library with the 'RuntimeService' and the 'TaskService' are included in my project.

2.question:
Do you have suggestion with literatures or links that helps me to learn more about unit testing of BPMN2.0 processes that helps me to find out its range of possibilities.

Thank you in advance !

Sebastian Menski

unread,
Mar 23, 2015, 7:07:19 AM3/23/15
to camunda-...@googlegroups.com, kirsten...@gmail.com
Hi Kirsten,

1. If your test class extends ProcessEngineTestCase the process engine services (runtimeService, taskService etc.) will be initialized
2. You could have a look at bpm assert [1] which is a greate library for testing bpm processes. Checkout the user guide for more informations [2].

Cheers,
Sebastian

Tamás Matányi

unread,
Nov 19, 2015, 5:35:38 AM11/19/15
to camunda BPM users, kirsten...@gmail.com
Hi Sebastian,

I'm trying to use DMN in my BPMN process.
I changed the unittest project below to include and use my BPMN.


Unfortunately I get the following error. I don't know why. Do you have any idea what is missing?

INFO: ProcessEngine default created
nov. 19, 2015 11:22:21 DE org.camunda.bpm.engine.impl.interceptor.BpmnStackTrace printStackTrace
SEVERE: BPMN Stack Trace:
sid-40AAB0E8-AEAE-494D-ABC6-6DD6F6D99922 (activity-execute, ScopeExecution[7])
sid-40AAB0E8-AEAE-494D-ABC6-6DD6F6D99922
 ^
 |
sid-38463660-2945-40B6-BD32-06FBCE75FC06
 ^
 |
sid-1B06BFB0-0071-4057-BD6B-E986DA4C3E09
 ^
 |
ExclusiveGateway_3
 ^
 |
sid-CCBA742A-BF49-482E-8B77-D8A15CFC0492

nov. 19, 2015 11:22:21 DE org.camunda.bpm.engine.impl.interceptor.CommandContext close
SEVERE: Error while closing command context
org.camunda.bpm.engine.exception.dmn.DecisionDefinitionNotFoundException: no decision definition deployed with key 'book
ingStrands': decisionDefinition is null
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.camunda.bpm.engine.impl.util.EnsureUtil.generateException(EnsureUtil.java:283)
at org.camunda.bpm.engine.impl.util.EnsureUtil.ensureNotNull(EnsureUtil.java:44)
at org.camunda.bpm.engine.impl.persistence.deploy.DeploymentCache.findDeployedLatestDecisionDefinitionByKey(DeploymentC
ache.java:380)
at org.camunda.bpm.engine.impl.util.CallableElementUtil.getDecisionDefinitionToCall(CallableElementUtil.java:86)
at org.camunda.bpm.engine.impl.bpmn.behavior.DecisionRuleTaskActivityBehavior.createScript(DecisionRuleTaskActivityBeha
vior.java:48)
at org.camunda.bpm.engine.impl.bpmn.behavior.DecisionRuleTaskActivityBehavior.execute(DecisionRuleTaskActivityBehavior.
java:35)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityExecute.execute(PvmAtomicOperationActivi
tyExecute.java:42)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityExecute.execute(PvmAtomicOperationActivi
tyExecute.java:27)
at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:85)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.invokeNext(CommandContext.java:178)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performNext(CommandContext.java:157)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:132)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:488)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:465)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationTransitionNotifyListenerStart.eventNotifications
Completed(PvmAtomicOperationTransitionNotifyListenerStart.java:56)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationTransitionNotifyListenerStart.eventNotifications
Completed(PvmAtomicOperationTransitionNotifyListenerStart.java:26)
at org.camunda.bpm.engine.impl.core.operation.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:65
)
at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:85)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.invokeNext(CommandContext.java:178)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performNext(CommandContext.java:157)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:132)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:122)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:499)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:474)
at org.camunda.bpm.engine.impl.core.operation.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:58
)
at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:85)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.invokeNext(CommandContext.java:178)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performNext(CommandContext.java:157)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:132)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:122)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:499)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:474)
at org.camunda.bpm.engine.impl.core.operation.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:58
)
at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:85)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.invokeNext(CommandContext.java:178)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performNext(CommandContext.java:157)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:132)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:488)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:465)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationTransitionCreateScope.scopeCreated(PvmAtomicOper
ationTransitionCreateScope.java:34)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationCreateScope.execute(PvmAtomicOperationCreateScop
e.java:50)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationCreateScope.execute(PvmAtomicOperationCreateScop
e.java:24)
at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:85)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.invokeNext(CommandContext.java:178)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performNext(CommandContext.java:165)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:132)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:488)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:465)
at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl.start(PvmExecutionImpl.java:225)
at org.camunda.bpm.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:75)
at org.camunda.bpm.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:35)
at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:97)
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:32)
at org.camunda.bpm.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:66)
at org.camunda.bpm.unittest.SimpleTestCase.shouldExecuteProcess(SimpleTestCase.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 4.76 sec <<< FAILURE!
shouldExecuteProcess(org.camunda.bpm.unittest.SimpleTestCase)  Time elapsed: 4.695 sec  <<< ERROR!
org.camunda.bpm.engine.exception.dmn.DecisionDefinitionNotFoundException: no decision definition deployed with key 'book
ingStrands': decisionDefinition is null
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.camunda.bpm.engine.impl.util.EnsureUtil.generateException(EnsureUtil.java:283)
at org.camunda.bpm.engine.impl.util.EnsureUtil.ensureNotNull(EnsureUtil.java:44)
at org.camunda.bpm.engine.impl.persistence.deploy.DeploymentCache.findDeployedLatestDecisionDefinitionByKey(DeploymentC
ache.java:380)
at org.camunda.bpm.engine.impl.util.CallableElementUtil.getDecisionDefinitionToCall(CallableElementUtil.java:86)
at org.camunda.bpm.engine.impl.bpmn.behavior.DecisionRuleTaskActivityBehavior.createScript(DecisionRuleTaskActivityBeha
vior.java:48)
at org.camunda.bpm.engine.impl.bpmn.behavior.DecisionRuleTaskActivityBehavior.execute(DecisionRuleTaskActivityBehavior.
java:35)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityExecute.execute(PvmAtomicOperationActivi
tyExecute.java:42)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationActivityExecute.execute(PvmAtomicOperationActivi
tyExecute.java:27)
at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:85)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.invokeNext(CommandContext.java:178)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performNext(CommandContext.java:157)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:132)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:488)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:465)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationTransitionNotifyListenerStart.eventNotifications
Completed(PvmAtomicOperationTransitionNotifyListenerStart.java:56)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationTransitionNotifyListenerStart.eventNotifications
Completed(PvmAtomicOperationTransitionNotifyListenerStart.java:26)
at org.camunda.bpm.engine.impl.core.operation.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:65
)
at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:85)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.invokeNext(CommandContext.java:178)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performNext(CommandContext.java:157)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:132)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:122)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:499)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:474)
at org.camunda.bpm.engine.impl.core.operation.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:58
)
at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:85)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.invokeNext(CommandContext.java:178)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performNext(CommandContext.java:157)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:132)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:122)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:499)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperationSync(ExecutionEntity.java:474)
at org.camunda.bpm.engine.impl.core.operation.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:58
)
at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:85)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.invokeNext(CommandContext.java:178)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performNext(CommandContext.java:157)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:132)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:488)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:465)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationTransitionCreateScope.scopeCreated(PvmAtomicOper
ationTransitionCreateScope.java:34)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationCreateScope.execute(PvmAtomicOperationCreateScop
e.java:50)
at org.camunda.bpm.engine.impl.pvm.runtime.operation.PvmAtomicOperationCreateScope.execute(PvmAtomicOperationCreateScop
e.java:24)
at org.camunda.bpm.engine.impl.interceptor.AtomicOperationInvocation.execute(AtomicOperationInvocation.java:85)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.invokeNext(CommandContext.java:178)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performNext(CommandContext.java:165)
at org.camunda.bpm.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:132)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:488)
at org.camunda.bpm.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:465)
at org.camunda.bpm.engine.impl.pvm.runtime.PvmExecutionImpl.start(PvmExecutionImpl.java:225)
at org.camunda.bpm.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:75)
at org.camunda.bpm.engine.impl.cmd.StartProcessInstanceCmd.execute(StartProcessInstanceCmd.java:35)
at org.camunda.bpm.engine.impl.interceptor.CommandExecutorImpl.execute(CommandExecutorImpl.java:24)
at org.camunda.bpm.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:97)
at org.camunda.bpm.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:32)
at org.camunda.bpm.engine.impl.RuntimeServiceImpl.startProcessInstanceByKey(RuntimeServiceImpl.java:66)
at org.camunda.bpm.unittest.SimpleTestCase.shouldExecuteProcess(SimpleTestCase.java:37)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at org.junit.rules.TestWatcher$1.evaluate(TestWatcher.java:55)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

Thanks,
Tamas

Sebastian Menski

unread,
Nov 19, 2015, 9:32:49 AM11/19/15
to camunda BPM users, kirsten...@gmail.com
Hi Tamas,

the exception states that you try to call a decision with the id 'bookingStrands'. And it doesn't find a deployed decision with this id. Are you
sure the decision is deployed correctly?

Cheers,
Sebastian

Matányi Tamás

unread,
Nov 19, 2015, 9:48:13 AM11/19/15
to camunda-...@googlegroups.com, kirsten...@gmail.com

Hi Sebastian,

 

We’re talking about unitTesting. Do you mean .startProcessInstance on deploy?

 

ProcessInstance processInstance = runtimeService().startProcessInstanceByKey(”ID”);

 

Yes, you’re right. I didn’t deployed decision with the ID 'bookingStrands' Should I do it?

The missing file is just beside the started BPMN in src/test/resources.

 

I’m afraid I don’t know how to deploy DMN in a unitTest.

 

Thanks in advance,

Tamas

--
You received this message because you are subscribed to a topic in the Google Groups "camunda BPM users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/camunda-bpm-users/7fB4rxWEpVY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/camunda-bpm-users/d0694c18-c32b-492e-ac6b-3d6d1b6a0045%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Sebastian Menski

unread,
Nov 19, 2015, 10:10:35 AM11/19/15
to camunda BPM users, kirsten...@gmail.com
Hi Tamas,

no problem. Camunda provides a @Deployment test annotation which allows you to easily deploy resources need for the unit test. As you can see
in our example [1] we used it to deploy the "testProcess.bpmn" file which is used by the unit test. If you want to deploy more resources needed
by your unit test just add them to the resources list like so (assuming your DMN file is called 'decision.dmn'):

@Test
@Deployment(resources = {"testProcess.bpmn", "decision.dmn"})
public void shouldExecuteProcess() {
 
// ... test code ...
}

There is also a small section about unit testing in our docs [2].

Cheers,
Sebastian

Matányi Tamás

unread,
Nov 19, 2015, 10:18:07 AM11/19/15
to camunda-...@googlegroups.com, kirsten...@gmail.com

Thank you Sebastian!

 

It is working!

 

Cheers,

Tamas

 

From: camunda-...@googlegroups.com [mailto:camunda-...@googlegroups.com] On Behalf Of Sebastian Menski


Sent: Thursday, November 19, 2015 4:11 PM
To: camunda BPM users <camunda-...@googlegroups.com>
Cc: kirsten...@gmail.com

--

You received this message because you are subscribed to a topic in the Google Groups "camunda BPM users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/camunda-bpm-users/7fB4rxWEpVY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.

Matányi Tamás

unread,
Nov 24, 2015, 6:11:10 AM11/24/15
to camunda-...@googlegroups.com, kirsten...@gmail.com

Hi,

 

I don’t understand why I get the following error on running my unit test:

 

SEVERE: Error while closing command context

org.camunda.bpm.engine.ProcessEngineException: One of the attributes 'class', 'delegateExpression', 'type', or 'expression' is mandatory on

businessRuleTask. | BookingEngineDMN.bpmn | line 45 | column 205

One of the attributes 'class', 'delegateExpression', 'type', or 'expression' is mandatory on businessRuleTask. | BookingEngineDMN.bpmn | lin

e 67 | column 231

 

Why these attributes are mandatory (class, delegateExpression, type, expression) on businessRuleTask?

 

I have this line in my BPMN:

<businessRuleTask id="sid-40AAB0E8-AEAE-494D-ABC6-6DD6F6D99922" camunda:decisionRef="bookingStrands" camunda:resultVariable="unterkonto" name="BookingStrand ermitteln" implementation="##WebService">

It has a camunda:decisionRef attribute reffering to the appropriate DMN. What else is missing?

 

Thanks in advance,

Tamas

 

From: camunda-...@googlegroups.com [mailto:camunda-...@googlegroups.com] On Behalf Of Sebastian Menski


Sent: Thursday, November 19, 2015 4:11 PM
To: camunda BPM users <camunda-...@googlegroups.com>
Cc: kirsten...@gmail.com

--

You received this message because you are subscribed to a topic in the Google Groups "camunda BPM users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/camunda-bpm-users/7fB4rxWEpVY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.

Sebastian Menski

unread,
Nov 24, 2015, 6:54:47 AM11/24/15
to camunda BPM users, kirsten...@gmail.com
Hi Tamas,

which version of Camunda are you using? The decisionRef attribute will be introduced with the next 7.4.0 release. The example provided at [1] is
using Camunda version 7.3.0 so the "decisionRef" attribute is not known.

You could change the version in the pom.xml to 7.4.0-alpha3 and it should work.

Cheers
Sebastian

Tamás Matányi

unread,
Nov 24, 2015, 9:13:19 AM11/24/15
to camunda-...@googlegroups.com
Hi Sebastian,

Unfortunately it says:

Missing artifact org.camunda.bpm:camunda-engine-plugin-connect:jar:7.4.0-alpha3

Cheers,

Tamas


--
You received this message because you are subscribed to a topic in the Google Groups "camunda BPM users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/camunda-bpm-users/7fB4rxWEpVY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.

Sebastian Menski

unread,
Nov 24, 2015, 10:07:34 AM11/24/15
to camunda BPM users
Hi Tamas,

I tried it myself. Please ensure that your IDE updates the artifacts correctly. I run the following maven command at it worked as expected:

mvn clean test

As you can see the artifact [1] is available on maven central.

Cheers,
Seabastian

Tamás Matányi

unread,
Nov 24, 2015, 12:46:04 PM11/24/15
to camunda-...@googlegroups.com
Hi Sebastian,

I could get the version (7.4.0-alpha3) we need finally.
Now, I get the following error:

SEVERE: ENGINE-16004 Exception while closing command context: Unable to transform DMN resource 'bookingStrands.dmn'

org.camunda.bpm.engine.ProcessEngineException: Unable to transform DMN resource 'bookingStrands.dmn'


Content of the file 'bookingStrands.dmn' is:

<?xml version="1.0" encoding="UTF-8"?>

<Definitions xmlns="http://www.omg.org/spec/DMN/20130901" xmlns:camunda="http://camunda.org/schema/1.0/dmn" id="definitions" name="camunda" namespace="http://camunda.org/dmn">

  <ItemDefinition id="itemDefinition1">

    <typeDefinition>string</typeDefinition>

    <allowedValue id="LiteralExpression_0dt8gnf">    <text>21</text>

</allowedValue>

  </ItemDefinition>

  <ItemDefinition id="itemDefinition2">  <typeDefinition>string</typeDefinition>

</ItemDefinition>

  <ItemDefinition id="ItemDefinition_0e72j56">  <typeDefinition>integer</typeDefinition>

</ItemDefinition>

  <Decision id="bookingStrands" name="Strands">

    <DecisionTable id="decisionTable" hitPolicy="FIRST" isComplete="true" isConsistent="true">

      <clause id="clause1" name="Buchungstext">

        <inputExpression id="inputExpression1">

          <itemDefinition href="#itemDefinition1" />

          <text>btxt_form</text>

        </inputExpression>

        <inputEntry id="LiteralExpression_03bwc37">        <text>21</text>

</inputEntry>

        <inputEntry id="LiteralExpression_1j6eywo">        <text>21</text>

</inputEntry>

      </clause>

      <clause id="Clause_1o6crm1" name="Sequenz">

        <inputExpression id="LiteralExpression_1yknl8p">

          <itemDefinition href="#ItemDefinition_0e72j56" />

          <text>sequenz</text>

        </inputExpression>

        <inputEntry id="LiteralExpression_0k7ugmd">        <text>1</text>

</inputEntry>

        <inputEntry id="LiteralExpression_1frv9r6">        <text>2</text>

</inputEntry>

      </clause>

      <clause id="clause2" name="Unterkonto" camunda:output="unterkonto">

        <outputDefinition href="#itemDefinition2" />

        <outputEntry id="LiteralExpression_1rddw1k">        <text>U2</text>

</outputEntry>

        <outputEntry id="LiteralExpression_1nh1vbp">        <text>U1</text>

</outputEntry>

      </clause>

      <rule id="DecisionRule_0eq90y8">

        <condition>LiteralExpression_03bwc37</condition>

        <condition>LiteralExpression_0k7ugmd</condition>

        <conclusion>LiteralExpression_1rddw1k</conclusion>

      </rule>

      <rule id="DecisionRule_1v9nlfb">

        <condition>LiteralExpression_1j6eywo</condition>

        <condition>LiteralExpression_1frv9r6</condition>

        <conclusion>LiteralExpression_1nh1vbp</conclusion>

      </rule>

    </DecisionTable>

  </Decision>

</Definitions>


What may be wrong with this file?


Thanks,

Tamas


--
You received this message because you are subscribed to a topic in the Google Groups "camunda BPM users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/camunda-bpm-users/7fB4rxWEpVY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.

Sebastian Menski

unread,
Nov 25, 2015, 3:50:05 AM11/25/15
to camunda BPM users
Hi Tamas,

with alpha3 we switchted to DMN 1.1. The file you posted is still DMN 1.0. You now have to options. Either you remodel
your decision with the online modeler [1] to get DMN 1.1 XML. Or you use the 7.4.0-alpha2 of Camunda which still
uses DMN 1.0.

I would recommend the switch to DMN 1.1 as this will be part of the final release.

Cheers,
Sebastian

Tamás Matányi

unread,
Nov 25, 2015, 4:12:16 AM11/25/15
to camunda-...@googlegroups.com
Hi Sebastian,

Thank you for the info!

Cheers,
Tamas

--
You received this message because you are subscribed to a topic in the Google Groups "camunda BPM users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/camunda-bpm-users/7fB4rxWEpVY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.

venkataraju...@gmail.com

unread,
Feb 25, 2016, 8:08:27 AM2/25/16
to camunda BPM users
Hi Sebastian,
Seems it's not working even with alpha3 version. I tried with both alpha2 & alpha3 versions, but not able to deploy and getting errors. 
Created the DMN file with Camunde Modeler and online tool provided, still same issue. How to differentiate DMN1.1 DMN1.0 files, because it looks same for me. 
POM
<properties>
   <camunda.version>7.4.0</camunda.version>
   <spring.version>3.1.2.RELEASE</spring.version>
   <version.dmn>7.4.0-alpha3</version.dmn>
   <version.groovy>2.4.6</version.groovy>
   
   <skipTests>true</skipTests>
</properties>

  <dependencyManagement>
    <dependencies>
      <dependency>
        <groupId>org.camunda.bpm</groupId>
        <artifactId>camunda-bom</artifactId>
        <version>${version.dmn}</version>
        <scope>import</scope>
        <type>pom</type>
      </dependency>
    </dependencies>
  </dependencyManagement>

  <dependencies>
    <dependency>
      <groupId>org.camunda.bpm</groupId>
      <artifactId>camunda-engine</artifactId>
      <version>${version.dmn}</version>
      <scope>provided</scope>
    </dependency>
    
    <dependency>
<groupId>org.camunda.bpm.dmn</groupId>
<artifactId>camunda-engine-dmn</artifactId>
<version>${version.dmn}</version>
</dependency>
<dependency>
        <groupId>org.codehaus.groovy</groupId>
        <artifactId>groovy-all</artifactId>
        <version>${version.groovy}</version>
     </dependency>

    <dependency>
      <groupId>javax.servlet</groupId>
      <artifactId>javax.servlet-api</artifactId>
      <version>3.0.1</version>
      <scope>provided</scope>
    </dependency>
  </dependencies>

Here is the Error LOG, If I use alpha3 in POM
SEVERE [org.camunda.bpm.engine.impl.interceptor.CommandContext] (Se
rverService Thread Pool -- 82) Error while closing command context: org.camunda.
bpm.engine.ProcessEngineException: Unable to transform DMN resource 'My-Dish-Dec
ision.dmn'

Thanks in advance.
VenaktaRaju Nandam

Sebastian Menski

unread,
Feb 25, 2016, 9:28:29 AM2/25/16
to camunda BPM users
Hi,

please use the final release 7.4.0. You can see which version of DMN you are using by the namespace of the XML file.

DMN 1.1 has the following namespace

Cheers,
Sebastian

VENKATARAJU NANDAM

unread,
Feb 26, 2016, 2:08:20 AM2/26/16
to camunda-...@googlegroups.com
Hi Sebastian,
Yes, am able to see (.dmn11.xsd) in the updated file with online link. I moved to camunda-bpm-jboss-7.5.0-alpha2 version and its working well. 

Thanks,
VenkataRaju

--
You received this message because you are subscribed to a topic in the Google Groups "camunda BPM users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/camunda-bpm-users/7fB4rxWEpVY/unsubscribe.
To unsubscribe from this group and all its topics, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages