cancel
Showing results for 
Search instead for 
Did you mean: 

Custom User Decision for Class Method in Task

PritamKunal
Participant
0 Kudos

Hi Expert,

I have a screen for user decision(Approve/Reject with some comments field). When i execute the process it works fine for all cases, but when i don't click any decision and come back from the screen, then also this task gets completed and workflow starts executing next step. Here in this case, i want workitem to remain in inbox same as what happen in case of user decision step.

Do i need to put this task in loop till i get a decision or some other way i can solve it? I have tried putting this method as Synchronous and non-Synchronous method. I am not sure if this issue is, because i am using Class method. Please help.

Regards,

Pritam

Edited by: Pritam Kunal on Feb 11, 2011 4:28 PM

Accepted Solutions (1)

Accepted Solutions (1)

pokrakam
Active Contributor
0 Kudos

When a class method completes it completes. If you don't want it to complete, you need to raise an exception. Use CX_BO_CANCELLED or a subclass of it to simply cancel execution and leave the item in the inbox.

PritamKunal
Participant
0 Kudos

Hi Mike,

I have got a solution for this. If we make the task as Asynchronous task with a terminating event. Till the time event is not triggered process workitem will remain in inbox. This event can we triggered at any user decision only.

Is there any flow in this logic? I have tried it for few cases and it worked, but not sure if there will be any case where it will not work? any suggestion?

Regards,

Pritam

Former Member
0 Kudos

Hi Pritam,

Yes your solution is correct. This is the way to do it. Make the task as asynchronies then on execution of decision trigger the terminating event with the same object key. Do not forget the maintain terminating event for the task.

Regards,

Devananda A J

pokrakam
Active Contributor
0 Kudos

Using terminating events for a dialog task on a SAPGUI frontent is overkill. If you're already using OO methods then just raise an exception as I suggested. Easier, quicker, doesn't rely on RFC, synchronous, better user experience.

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

Is the task set as a Background Processing? This green mark must be uncheck (gray). Also, in Details tab uncheck Advance with dialog.

Regards,

Former Member
0 Kudos

Hi Pritam,

In your Task check "Confirmation" flag. This would prompt you a dialog box asking for your confirmation to complete the step so unless you confirm it th eWorkitem will not be set to complete.

Hope this helps.

Cheers,

Prashanth