[jBPM] - Difficult workflow question
by John Bize
John Bize [https://community.jboss.org/people/jbize] created the discussion
"Difficult workflow question"
To view the discussion, visit: https://community.jboss.org/message/727034#727034
--------------------------------------------------------------
I am attempting to handle what to me is a difficult workflow problem. I believe a good metaphore for this process is: "Who's got the button?" There are multiple buttons with different descriptions. There are several working teams that may have the button, but it's possible that no one has it.
So, a user connects to our system and submits a form asking "who's got the button?" The form can describe the button by composition (plastic, bone, etc.), color, size, age, etc. (The user does his best to add enough detail.) Since there aren't too many buttons, sometimes just composition or age is sufficient for identification, but sometimes not. So, the request first goes to the user's supervisor (group) to validate that the request is valid and sufficient in detail (Human Task 1). The supervisor may reject the request for a number of reasons or approve it. If approved, an email is sent to all the teams (currently only 2) that might currently have the button. Here I split the workflow to two more human tasks. (I actually put these in an embedded sub-process.) For each of these team requests (human tasks), the response may be: "*Not Me*," "*Need Additional Info* (e.g. color)", or "*Yes I have it*." I recombined the workflow, but the answers are relevant to how the workflow procedes: If both answer "No," (happy path) the supervisor is notified, and the process completes. If neither answer "Yes," but at least one asks for additional information, the request is pushed back to the previous step. However, if one team answers "Yes," the process must complete and the other pending human task(s) must be cancelled (or completed) and the supervisor must be notified immediately and the process ends.
I hasven't even decided the best way to handle the "need more info" results. For right now, I need to know the correct way to cleanly end the other pending human tasks once one answers "yes."
I have tried quite a few different things such as events and errors, but nothing seems correct.
Any and all help is sincerely appreciated.
I'll resummarize the flow (code and image are not available):
* User submits request (start process)
* Supervisor approves or rejects (HT-1) (followed by xor gateway for decision flow)
* Diverge Gateway (AND)
* Simultaneously ask Team 1 and 2 (HT-2 & HT-3)
* Converge Gateway (AND) if results are No or Need More Info
* *BUT if either HT response is Yes, other HT is immediately ended (cancelled or stopped), and the process continues*
* Supervisor receives notification for subsequent action (HT-4)
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/727034#727034]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years
[jBPM] - createProcessInstance + startProcessInstance does not update processinstanceinfo state
by Affan Dar
Affan Dar [https://community.jboss.org/people/affandar] created the discussion
"createProcessInstance + startProcessInstance does not update processinstanceinfo state"
To view the discussion, visit: https://community.jboss.org/message/718535#718535
--------------------------------------------------------------
I am seeing a strange issue in my jbpm 5 + hibernate + mysql configuration.
A test process 'com.sample.bpmn' consists of the following: start -> myactivityhandler -> somescript -> end
myactivityhandler is an async activity handler and hence 'execute' returns without calling completeWorkItem.
Now after execution of the following snippet:
..
ksession.startProcess("com.sample.bpmn");
..
I look at the ProcessInstanceInfo for the process and I see that the instance state is rightful set to ACTIVE since the process is actually active and just hit its first savepoint after the myactivityhandler.
However if I break the startprocess down to the following:
..
ProcessInstance pi = ksession.createProcessInstance("com.sample.bpmn", null);
ksession.startProcessInstance(pi.getId());
..
After execution of the above two, I expect the state would be the same as the previous snippet i.e. process instance state == ACTIVE but in reality it is set to PENDING. Also when I trace the SQL that hibernate is sending to MySQL I don't see any UPDATE going to the ProcessInstanceInfo table. This is a problem since now I can't complete the myactivityhandler workitem to continue the process.. and it needs to be started again.
Any clue why the above two scenarios are behaving differently?
Fwiw, if I configure the system to use the in-memory H2 then everything works fine and dandy.
Thanks
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/718535#718535]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years
[jBPM] - Handling Faults leads to log entry: cvc-id.2: There are multiple occurrences of ID value 'TestException'.
by sebb
sebb [https://community.jboss.org/people/sebb] created the discussion
"Handling Faults leads to log entry: cvc-id.2: There are multiple occurrences of ID value 'TestException'."
To view the discussion, visit: https://community.jboss.org/message/648364#648364
--------------------------------------------------------------
While trying to figure how to deal with exceptions I found the way by "catching" Error Events with a Signal. In order to be able to catch an Error Event I have to do the following things:
1. Add the metadata key "ErrorEvent" with value "FaultName" of my ErrorEvent (in my case: ErrorEvent:TestException).
2. Define the EventType of the Signal with a combination of "Error-[node id of subprocess]-[FaultName of my ErrorEvent]" (in my case: Error-_6-TestException).
But as soon as I do this the log shows the following entries:
(null: 19, 61): cvc-id.2: There are multiple occurrences of ID value 'TestException'.
(null: 19, 61): cvc-attribute.3: The value 'TestException' of attribute 'id' on element 'error' is not valid with respect to its type, 'ID'.
I dont even understand those entries. Of course I will have multiple occurences of the same ID if I reference to it inside my process.
Any opinions to that problem?
Thanks :)
--------------------------------------------------------------
Reply to this message by going to Community
[https://community.jboss.org/message/648364#648364]
Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&con...]
12 years