How to get workitem id of webflow task to call terminating event?

Baunach, Natasha R natasha.r.baunach at intel.com
Fri Dec 23 21:18:15 EST 2005


All,

In case you are interested, here is the solution on how to terminate
dialog webflow task that calls BSP application via terminating event:

1. Declare sapwfcburl attribute on your BSP page.  Be sure to check Auto
box.  This parameter will be automatically filled with the URL

2. In the OnInputProcessing event handler (that is where you usually
process your user's response or anywhere else) add the following code:

DATA: l_wi_id TYPE sww_wiid.

CALL METHOD cl_swf_ifs_ws_export=>get_callback_ctx_params
  EXPORTING
    callback_url = sapwfcburl
  IMPORTING
    wi_id        = l_wi_id.

This will return your workitem id.  The all you need to do is raise an
event for business object type WEBSERVICES, event COMPLETED, object key
=  l_wi_id.  You will also be able to pass back data into the
containers.

Regards,
Natasha



-----Original Message-----
From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
Of Mike Pokraka
Sent: Friday, December 23, 2005 3:34 AM
To: SAP Workflow Users' Group
Subject: RE: How to get workitem id of webflow task to call terminating
event?

Hi Natasha,
I'm not that familiar with the BSP side of things, and I'm almost
surprised that this isn't bound automatically.
However, what I'm talking about will still work. I think you did
misunderstand: In PFTC, on the basic data tab there's a binding button
by
the object method. That lets you define the - normally automatic -
binding
from *task* to *method*, thus if you bind the ID from there you'll get
the
task ID not the WF ID.

Cheers
Mike

Baunach, Natasha R wrote:
> Hi Mike,
>
> Maybe I am misunderstanding what you are saying but I don't think this
> is what I am looking for.  Let me clarify the question:
>
> I have a BSP approval page.  I created a service and generated a
webflow
> task via WF_EXTSRV transaction.  It created a task with object type
> webservice and method processdialog.  In the terminating event tab,
now
> there is an entry: element=_wi_object_id, object type=webservice,
> event=completed.  So, it expects workitem id of this task as the key
to
> trigger terminating event.
>
> I can pass parameters to the BSP application, but when I tried to pass
> &WEBSERVICE.WI_ID& from workflow to the container I defined at the
task
> level and then at the service level, I get an error that it hasn't
been
> filled because workitem id hasn't been generated.
>
> So, I am wondering how would BSP page know for what workitem id to
> trigger terminating event?
>
> I can easily pass overall workitem id for the whole workflow and then
> use function module SWI_GET_DEPENDENT_WORKITEMS to get all child
> workitem id and look the latest one with a particular task number.
This
> approach would only work if there is only one branch.  If there are
> parallel branches, I might get a wrong workitem id.
>
> I would think that there are must be a way for BSP to capture that
> workitem.  Maybe there is a standard attribute name that is declared
on
> the BSP page itself that workflow automatically populates but I can't
> find any documentation.
>
> I've searched this forum as well as SDN without any success.
>
> With this said, will your solution work and am I just not getting it?
>
> Thanks,
> Natasha
>
>
>
> -----Original Message-----
> From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On
Behalf
> Of Mike Pokraka
> Sent: Friday, December 23, 2005 1:08 AM
> To: SAP Workflow Users' Group
> Subject: Re: How to get workitem id of webflow task to call
terminating
> event?
>
> Hi Natasha,
> The task->method binding is normally implicit, but you can override it
> and
> should be able to add the task ID in manually. Just click on the
binding
> icon in the task definition screen.
> HTH,
> Cheers
> Mike
>
> Baunach, Natasha R wrote:
>> Hello,
>>
>>
>>
>> Does anyone know what is the easiest way to get workitem id of the
>> webflow task that calls BSP page to trigger terminating event to
> return
>> to workflow after execution of the workitem?
>>
>>
>>
>> In binding definition, I can pass id of the workflow itself to the
> task
>> which passes it to the service parameter which will pass it to the
> BSP.
>> Then I can call function module to get all the details for the
> workflow
>> and find the latest task.
>>
>>
>>
>> Is there an easier way to determine workitem id to trigger
terminating
>> event for webflow task (for object type WEBSERVICES, event
COMPLETED)?
>>
>>
>>
>> We are on WAS 640, support pack 13.
>>
>>
>>
>> Many thanks,
>>
>> Natasha
>>
>>
>>
>>
>>
>> _______________________________________________
>> SAP-WUG mailing list
>> SAP-WUG at mit.edu
>> http://mailman.mit.edu/mailman/listinfo/sap-wug
>>
>
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
>
> _______________________________________________
> SAP-WUG mailing list
> SAP-WUG at mit.edu
> http://mailman.mit.edu/mailman/listinfo/sap-wug
>

_______________________________________________
SAP-WUG mailing list
SAP-WUG at mit.edu
http://mailman.mit.edu/mailman/listinfo/sap-wug




More information about the SAP-WUG mailing list