Bug 767596

Summary: Submitting Human Task with potential owner that is not known to the HT service results with Hibernate exception
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Jiri Locker <jlocker>
Component: jBPM 5Assignee: Kris Verlaenen <kverlaen>
Status: VERIFIED --- QA Contact: Jiri Locker <jlocker>
Severity: high Docs Contact:
Priority: unspecified    
Version: BRMS 5.3.0.GACC: kverlaen, lpetrovi, rsynek
Target Milestone: ER6   
Target Release: BRMS 5.3.0.GA   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Attachments:
Description Flags
MyProcess.bpmn2
none
server.log none

Description Jiri Locker 2011-12-14 13:18:57 UTC
Description of problem:
I have a simple process with a single HT node, which has the following definition of potential owner:

> <bpmn2:potentialOwner id="...">
>     <bpmn2:resourceAssignmentExpression id="...">
>         <bpmn2:formalExpression id="...">unknownUser</bpmn2:formalExpression>
>     </bpmn2:resourceAssignmentExpression>
> </bpmn2:potentialOwner>

When I start a process instance through a StatefulKnowledgeSession, the task instance doesn't appear in the HT service. No exception in the client code, no hasErrors() method to find out what went wrong. Only a undescriptive Hibernate exception in the server log. After some investigation I found out that a foreign key constraint was not satisfied when persisting the task.

Version-Release number of selected component (if applicable):
BRMS 5.3.0.DEV5

How reproducible:
always

Steps to Reproduce:
1. run attached BPMN2 process (assuming the "unknownUser" is not defined in the running task service
2. see server log for the exception

Actual results:
org.hibernate.exception.GenericJDBCException and javax.persistence.RollbackException exceptions in server log

Expected results:
more descriptive exception in the task service, explaining why the task couldn't be submitted

Additional info:
attached process and server log

Comment 1 Jiri Locker 2011-12-14 13:23:46 UTC
Created attachment 546722 [details]
MyProcess.bpmn2

Comment 2 Jiri Locker 2011-12-14 13:24:36 UTC
Created attachment 546723 [details]
server.log

Comment 3 Jiri Locker 2012-03-12 17:35:00 UTC
I don't know if any change has been introduced, but it seems the DefaultUserGroupCallbackImpl is registred by default, because the hibernate exception is no longer thrown and the task with uknown potential user is persisted.

But, if the unknown user queries for his potential tasks the result is empty. That means the task cannot be completed/aborted and the process is blocked (if it depends on the task).

I suggest this should be resolved as part of this issue.

Comment 4 Maciej Swiderski 2012-03-20 11:46:02 UTC
This is already implemented and is ready for review as standalone commit that can be found here: https://github.com/mswiderski/jbpm/commit/8282bac9c9b0bb708b2708e2da03fc7bc228cbb1

Once reviewed it must be merged with recent changes related to handling persistence in task service.

Comment 5 Maciej Swiderski 2012-04-02 09:32:40 UTC
pull request prepared and can be found at: https://github.com/droolsjbpm/jbpm/pull/68

Comment 6 Ryan Zhang 2012-04-23 07:36:04 UTC
Update status to ON_QA. Please verify them against ER6.