Bug 1022410 - Unable to complete a task with JBPM remote API via JMS due to a no 'current status' match
Unable to complete a task with JBPM remote API via JMS due to a no 'current s...
Product: JBoss BPMS Platform 6
Classification: JBoss
Component: Business Central (Show other bugs)
Unspecified Unspecified
medium Severity medium
: ER5
: 6.0.0
Assigned To: Marco Rietveld
Ivo Bek
Depends On:
  Show dependency treegraph
Reported: 2013-10-23 04:47 EDT by Ivo Bek
Modified: 2016-09-20 01:05 EDT (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-08-06 16:07:09 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
the process with single human task (7.90 KB, application/xml)
2013-10-23 04:47 EDT, Ivo Bek
no flags Details
the server log (249.19 KB, text/x-log)
2013-10-23 04:48 EDT, Ivo Bek
no flags Details

  None (edit)
Description Ivo Bek 2013-10-23 04:47:44 EDT
Created attachment 815274 [details]
the process with single human task

Description of problem:

I have a simple process with single human task. To perform all operations I use Jbpm remote API via JMS. BPMS runs on W2k12, Oracle JDK 1.7, and Postgresql 9.2. 

When there is a request to complete a task, client will fail with org.kie.services.client.api.command.RemoteRuntimeException: PermissionDeniedException thrown with message 'User '[UserImpl:'admin']' was unable to execution operation 'Complete' on task id 2 due to a no 'current status' match'
	at org.kie.services.client.api.command.AbstractRemoteCommandObject.executeJmsCommand(AbstractRemoteCommandObject.java:184)
	at org.kie.services.client.api.command.AbstractRemoteCommandObject.execute(AbstractRemoteCommandObject.java:77)
	at org.jbpm.services.task.impl.command.CommandBasedTaskService.complete(CommandBasedTaskService.java:61)

The server log contains:
00:58:08,903 WARN  [org.kie.services.remote.jms.RequestMessageBean] (Thread-3 (HornetQ-client-global-threads-23724632)) User '[UserImpl:'admin']' was unable to execution operation 'Complete' on task id 2 due to a no 'current status' match

Unfortunately there is nothing more interesting.

These are the commands I perform http://pastebin.com/7c0yt7bp
And I am going to attach the BPMN process definition and full server log.

It's important to use the JMS client because via REST client the task complete operation works.

How reproducible:

Steps to Reproduce:
1. Install and configure BPMS 6.0.0.ER4 with EAP 6.1.0 to run on W2k12, Oracle JDK 1.7, and Postgresql 9.2
2. Create the process definition with single human task in BPMN designer or put the attached BPMN into your existing project.
3. Start and perform task operations remotely with Jbpm remote API via JMS.

Actual results:

Expected results:

Additional info:
Comment 1 Ivo Bek 2013-10-23 04:48:54 EDT
Created attachment 815275 [details]
the server log
Comment 2 Ivo Bek 2013-10-23 05:32:14 EDT
The same issue appears on rhel6-x86_64, Oracle JDK 1.6, and MySQL 5.5.
Comment 3 Ivo Bek 2013-10-23 07:05:16 EDT
To sum it up, these configurations produce the issue:

1) W2k12, Oracle JDK 1.7, and Postgresql 9.2
2) RHEL6 x86_64, Oracle JDK 1.7, and MSSQL2008R2
3) RHEL6 x86_64, Oracle JDK 1.7, and MySQL 5.5
4) RHEL6 x86_64, Oracle JDK 1.7, and Oracle11gR2
Comment 4 Mauricio Salatino 2013-10-23 07:35:37 EDT
I've reassigned the issue to Marco, because he is dealing with the remote interfaces. But please make sure that you don't use the admin user to interact with tasks. If you can reproduce the issue with another user then we can look into this issue to fix it.
Comment 5 Mauricio Salatino 2013-10-23 07:36:24 EDT
Also make sure that the task is started before you are trying to complete it, because if not you will end up with an error like the one that you are pasting here.
Comment 6 Kris Verlaenen 2013-10-23 09:07:23 EDT
The exception means the given user was not allowed to complete the task in its current status.  Most likely, this is because the task hasn't been started yet, as Mauricio suggested.  Ivo, could you please verify that the task was actually started before you try to complete it?
Comment 7 Ivo Bek 2013-10-23 09:44:24 EDT

I've changed user and the steps to also check the task status and you right that the task wasn't started. java.lang.AssertionError: expected:<InProgress> but was:<Reserved>
But there are no exceptions during the start operation as you can see in the server log.
Comment 8 Kris Verlaenen 2013-10-23 10:19:06 EDT
Marco, seems there's an issue when trying to start a task through JMS, could you take a look?
Comment 10 Ivo Bek 2013-12-04 03:36:04 EST
Verified in BPMS 6.0.0.ER5

Note You need to log in before you can comment on or make changes to this bug.