on 2012 Mar 22 2:59 AM
Hi all,
My requirement is to update the workflow task using event in the triggering event tab of standard task.
I was able to trigger the event using a wait event activity in the workflow template.
I already tried inserting a bor object type in the triggering events tab of task.
Then using an abap program to trigger the event sww_wi_create_via_event
Upon checking the tcode swel. The event was successfully triggered but the task was not updated/completed.
I tried starting the workflow template using the same event and was able to start the workflow template properly.
Did i missed something or any additional config needed?
Thanks in advance.
Request clarification before answering.
Hi Nathaniel,
A triggering event uses the task to create a work item.
A terminating event updates/completes the work item.
Move your event to the terminating events and you will have a better outcome.
Regards,
Jocelyn
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Nathaniel,
Ok... I'm guessing from this question that you are quite new to workflow. In that case can I suggest that instead of using the internal not-released-for-customer function module sww_wi_create_via_event, you instead use the released for customer workflow API function module that does the same thing. That is, function module SAP_WAPI_CREATE_EVENT.
What you need to pass whenever raising an event is the following:
You also need to COMMIT WORK. If you use SAP_WAPI_CREATE_EVENT you can simply do that by specifying the COMMIT_WORK parameter as "X".
By specifying both the object type and the object key the function will complete the _EVT_OBJECT container element for you.
Provided your event appears in transaction SWEL and you can see the correct key is assigned, it has been raised correctly.
"No receiver entered" usually means a problem in the definition of the task or workflow receiving the event. Remember with terminating events, the receiver (i.e. the work item) does not exist until the work item has first been created. You can create a waiting work item directly from the task using the test tool transaction SWUS.
You do also need to be clear on whether you are using your event to trigger or to terminate a workflow or task. If you are triggering, i.e. creating a new workflow or task, then the event linkage needs to be activated on the workflow/task. When you are terminating, i.e. updating/closing a workflow/task, then the event linkage is automatically activated when the work item or work flow item is created. Only active event linkages will be considered. A good tool to help with understanding what may be missing from your event linkage is transaction SWU0. Enter your object type and event name and it will show the status of any event linkages to that event and what, if anything, might be missing.
Hope that helps.
Regards,
Jocelyn
Message was edited by: Jocelyn Dart
Hi jocelyn,
Thank you for assisting me with my issue.
Finally i was able to trigger my wf task using the terminating event in the standard task.
During my testing, i found out that no binding was set in the wf Template to wf task.
So i inserted the bor object in the binding and the wf task completed after running
FM SAP_WAPI_CREATE_EVENT.
last question before i close this thread and give my points.
Whats the difference between the wait event activity in the wf template
and the terminating events in the standard task? Both of them delivers the same output.
What approach do you recommend?
Thanks
Hi Nathaniel,
Usually:
* Nearly Always: We use a Triggering Event to start a workflow
* Nearly Always: We use a workflow to start a task (simply as one of the steps of a workflow)
* Often: We use terminating events to complete both tasks and workflows - you can set the terminating events of a workflow in the basic data section (hat icon in transaction SWDD) of the workflow
* Sometimes: We use an event creator step in a workflow to trigger or terminate another workflow or subworkflow
* Occasionally: We use a wait for event step to continue an existing workflow - e.g. where it needs to wait for something to happen before continuing, rather than just complete
We hardly ever use a triggering event to start a task directly - mainly because if you start a task without a workflow there are a lot of features you can't use, such as deadlines, and its more awkward when using workflow monitoring tools, which mostly assume you are starting a workflow not just a task.
Hope that helps.
Regards,
Jocelyn
| User | Count |
|---|---|
| 8 | |
| 6 | |
| 4 | |
| 3 | |
| 3 | |
| 3 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.