Bug 1022410

Summary: Unable to complete a task with JBPM remote API via JMS due to a no 'current status' match
Product: [Retired] JBoss BPMS Platform 6 Reporter: Ivo Bek <ibek>
Component: Business CentralAssignee: Marco Rietveld <mrietvel>
Status: CLOSED CURRENTRELEASE QA Contact: Ivo Bek <ibek>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0.0CC: ibek, kverlaen, msalatin, smcgowan
Target Milestone: ER5   
Target Release: 6.0.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 20:07:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
the process with single human task
none
the server log none

Description Ivo Bek 2013-10-23 08:47:44 UTC
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 08:48:54 UTC
Created attachment 815275 [details]
the server log

Comment 2 Ivo Bek 2013-10-23 09:32:14 UTC
The same issue appears on rhel6-x86_64, Oracle JDK 1.6, and MySQL 5.5.

Comment 3 Ivo Bek 2013-10-23 11:05:16 UTC
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 11:35:37 UTC
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 11:36:24 UTC
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 13:07:23 UTC
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 13:44:24 UTC
Mauricio,

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 14:19:06 UTC
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 08:36:04 UTC
Verified in BPMS 6.0.0.ER5