Discussion:
[jboss-user] [jBPM] - how do we assign the rejected tasks to initiator in Approval flow.
Rajesh P
2013-05-06 11:59:03 UTC
Permalink
Rajesh P [https://community.jboss.org/people/javalearner] created the discussion

"how do we assign the rejected tasks to initiator in Approval flow."

To view the discussion, visit: https://community.jboss.org/message/816224#816224

--------------------------------------------------------------
Hi,
I am new to workflow and JBPM. I would like to implement 2 level of approvals work flow. I have created process as explained in the https://community.jboss.org/people/bpmn2user/blog/2011/09/21/jbpm5-web-example https://community.jboss.org/people/bpmn2user/blog/2011/09/21/jbpm5-web-example link.

At first level approval, we have approve and rejection options. If first level approver is rejected then it has to assigned to creator.
At this point i am confused, whether i need to invoolve the creator in the process as human task or not. If i have not involved then how can i assign the rejected requests to initiator.
If i involve him as human task, when and how can i start the process.
Please correct me if am wrong or my understanding is wrong.

Please let me know if any details required.


Thanks in advance.

Rajesh.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/816224#816224]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Maciej Swiderski
2013-05-10 05:16:32 UTC
Permalink
Maciej Swiderski [https://community.jboss.org/people/swiderski.maciej] created the discussion

"Re: how do we assign the rejected tasks to initiator in Approval flow."

To view the discussion, visit: https://community.jboss.org/message/817097#817097

--------------------------------------------------------------
why not model the case completely - first you will have a task for initiator to perform some work, once completed this moves to approval step and if rejected you loop back to the first task for corrections. That way you have clear model that represents the entire flow.

HTH
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/817097#817097]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Rajesh P
2013-05-22 12:30:46 UTC
Permalink
Rajesh P [https://community.jboss.org/people/javalearner] created the discussion

"Re: how do we assign the rejected tasks to initiator in Approval flow."

To view the discussion, visit: https://community.jboss.org/message/818834#818834

--------------------------------------------------------------
Hi Maciej Swiderski,

I am sorry for the late reply.

Thanks a lot for your reply, Maciej.
As you suggested, I can have task for Initiator but my question is who is going to start the process?

Please let me know if i am missing any thing.


Please find the attached bpmnn file which i have designed for approval process.

I have few more thoughts
       I would like to have User task in the rejection flow and pass the persons Id, who started the process, as actor id to the User Task.
               Suggest me is it a right approach?
     Can i signal the approval flow after rejection?
               Correct if i am wrong.

Thanks,
Rajesh.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/818834#818834]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Ashish T
2013-05-23 11:28:42 UTC
Permalink
Ashish T [https://community.jboss.org/people/ashpcs] created the discussion

"Re: how do we assign the rejected tasks to initiator in Approval flow."

To view the discussion, visit: https://community.jboss.org/message/819052#819052

--------------------------------------------------------------
You have two options to explore


1) as suggested Maciej  add a human task representing first form just after the start event and assign it to innitiator.  When the  initiator start the process either do a) first task can go to initiators inbox  or      b) claim first task for intiator and show the first form to initiator. For next Approve/Reject task at a node to this first human task in case of rejection.




2) If you have form before starting the process and form data is fed into the process then you will have to create human task programatically and assign it to initiator on rejection by approve/Reject task.


First approach is better as you are able to model first human task in the process.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/819052#819052]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Rajesh P
2013-05-25 12:10:34 UTC
Permalink
Rajesh P [https://community.jboss.org/people/javalearner] created the discussion

"Re: how do we assign the rejected tasks to initiator in Approval flow."

To view the discussion, visit: https://community.jboss.org/message/819508#819508

--------------------------------------------------------------
Thanks Ashish.

As you suggested,i would like to go with first approach.i.e, having a human task just after after the start node.
I will pass Actor id dynamically as suggested by the Shobhit.
And then i would like to claim,start and complete the task after starting the process . I have given sample to do the same below. please validate it is it a right apparoach?

Map<string,Object> inputParam  = new HashMap<String,Object>();
inputParam.put("initiator","<UserID>");
kession.startproces("<process id>",inputParam);
//start the task
///complete task


Please suggest me on the above approach.

Thanks,
Rajesh.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/819508#819508]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Shobhit Tyagi
2013-05-27 15:17:32 UTC
Permalink
Shobhit Tyagi [https://community.jboss.org/people/roxy1987] created the discussion

"Re: how do we assign the rejected tasks to initiator in Approval flow."

To view the discussion, visit: https://community.jboss.org/message/819678#819678

--------------------------------------------------------------
you could start the process that way. But you also would need to create a process variable for your decision node and you will need to set its value at the time of completion of the approval task.
You will need to check its value in the decision node and use the appropriate transition.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/819678#819678]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Shobhit Tyagi
2013-05-23 17:41:25 UTC
Permalink
Shobhit Tyagi [https://community.jboss.org/people/roxy1987] created the discussion

"Re: how do we assign the rejected tasks to initiator in Approval flow."

To view the discussion, visit: https://community.jboss.org/message/819164#819164

--------------------------------------------------------------
Rajesh,

You will need to include a human task for the initiator. Because if you dont do it, and if you try and assign the rejected task to the initiator, your first level approval will be out of the definition.

First task assigned to a variable using expression and set as #{initiator}.
Second task for the approver. To decide whether the task is rejected or is approved, use a decision node with two transactions coming out. One going back to the initiator task(rejected case) and other to the next level approver(in case the task is approved).
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/819164#819164]

Start a new discussion in jBPM at Community
[https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
Loading...