Can an attribute know it's calling workflow?

Michael Pokraka workflow at quirky.me.uk
Fri Aug 27 10:47:29 EDT 2004


Hi Alon/Darrell,
Interesting, these were the sort of hacks I was hoping for, but alas don'=
t
play nicely in an attribute. I also found SWO_QUERY_REQUESTER, which - li=
ke
SWE_WI_GET_FROM_REQUESTER - gets its info from memory (under different
id's).
However the swo_%invoke at least told me why it won't work: The requester=
 in
the case of an attribute is the object itself, which kinda makes sense.
(Unless I'm missing something?). Argh, so close and yet so far.
 
Interestingly enough, the attribute gets invoked twice during the running=
 of
the workflow (once at startup, and once at container operation), so that
counters any performance hit I was trying to avoid. This is a bit of a
performance-intensive bit of code. I thought attributes were only evaluat=
ed
on an as-needed basis...? Oh, well.. method it is.
 
Thanks both for your input, it's fun to go digging around the internals o=
n
occasion, but now Friday becons and I am getting too thirsty for this.
 
Cheers & happy weekend.
Mike
 
Heath, Darrell L. wrote:
> Alon's suggestion is probably best but I have referred to SWO_%INVOKE t=
o
> get the requestor, then read the workitem (I know, it's not WAPI way
> ...).
>
>   requester =3D swo_%invoke-requester.
>   workitemid =3D  requester-objkey.
>
>   call function 'SWL_WI_READ'
>        exporting
>             wi_id         =3D workitemid
>         :
>         :
>
> Good luck, I know I had fun working on this one!
> Darrell
>
> -----Original Message-----
>> From: SAP Workflow [mailto:Owner-SAP-WUG at MITVMA.MIT.EDU] On Behalf Of
> Alon Raskin
> Sent: Friday, August 27, 2004 8:41 AM
> To: SAP-WUG at MITVMA.MIT.EDU
> Subject: Re: Can an attribute know it's calling workflow?
>
> try this FM SWE_WI_GET_FROM_REQUESTER
>
> I have never tried it from an attribute but definitely works in methods=
.
>
> Let us know how you get on.
>
> Alon
> -----Original message-----
>> From: Michael Pokraka workflow at quirky.me.uk
> Date: Fri, 27 Aug 2004 23:35:04 +1000
> To: SAP-WUG at MITVMA.MIT.EDU
> Subject: Can an attribute know it's calling workflow?
>
>
>  > Greetings all ye knowledgeable people,
>>
>> Simple one: Can an attribute somehow find out which workflow (if any)
> is
>> calling it?
>> There's nothing obvious I can find, so I don't hold much hope but
> perhaps
>> someone has a sneaky workaround?
>>
>> I know, easy to do in a method and I'll probably end up doing that,
> but a> n
>> attribute would be a bit neater for various reasons.
>>
>> Cheers
>> Mike
>
>
 


More information about the SAP-WUG mailing list