Rule type "Agent determination: Function to be Executed Asynchronously" (IF_SWF_IFS_ASYNCHRONOUS_RULE)

Kjetil Kilhavn kjetil.kilhavn at bluec.no
Thu Apr 12 05:07:39 EDT 2012


Tirsdag 10. april 2012 16.41.33 skrev Kjetil Kilhavn:
> While creating a new ABAP Objects-based workflow I thought I'd venture into
> some unknown territory when I discovered there is a type of rule I have not
> encountered before.
> 
> The rule type has (technical) key G - with English description "Agent
> determination: Function to be Executed Asynchronously". Implementing it is
> done by supporting interface IF_SWF_IFS_ASYNCHRONOUS_RULE in an ABAP class.
> I've tried this, and it doesn't appear to work very well in my opinion, but
> it may be me who is not doing the right things.
After reading OSS Note 1111786 my opinion is now that I am not doing the right 
things. Fortunately this is not a big surprise... However, the documentation 
from SAP is confusing. At help.sap.com it is stated that transferring the 
result of the agent evaluation is done with the help of 
SAP_WAPI_ASYNC_RULE_COMPLETE. My understanding was that this meant this 
function module should be called from the implementation of 
IF_SWF_IFS_ASYNCHRONOUS_RULE (which only has one method, INITIATE_EVALUATION).

OSS Note 1111786 states that SAP_WAPI_ASYNC_RULE_COMPLETE must not be called 
during the creation phase of the work item. When is 
IF_SWF_IFS_ASYNCHRONOUS_RULE~INITIATE_EVALUATION called? I don't know, and it 
seems SAP has no intention of telling me.

Conclusion: This may be a useful feature for some, but is not something I 
should spend time on at the moment. So it's back to good old type F for now, 
and suddenly it works as expected.

> One strange thing (but not a showstopper) is that method LIST_NAMES() of
> parameter IM_CONTAINER which I thought would tell me the names of all
> parameters returns nothing. However, since I can call method GET() and get
> the value of my known parameter this is not a problem in my case.
> 
> From what I've seen it seems function module SAP_WAPI_ASYNC_RULE_COMPLETE
> should be used to return the agent list to the work item, and it seems to
> not do so. It returns a success message, and I have debugged the function
> module without noticing anything strange, but the agents are not set. The
> task is currently a general task, so there's no problem with selected
> agents not being possible agents.
> 
> There is not much information on the interface, and two of the three
> implementations available in the system seem incomplete while the third one
> seems to rely on a different method being called to actually set the agents.
> 
> So, am I trying something which I should stay far away from here, or has
> anyone here implemented a rule of this type successfully?
-- 
Kjetil Kilhavn (+47 40220607) - Blue Consulting AS (http://www.bluec.no)


More information about the SAP-WUG mailing list