Persistent vs Runtime handles - development standards?

Florin Wach florin.wach at gmx.net
Mon Feb 8 05:58:54 EST 2010


Hello Andy,

indeed, this is somewhat strange. I'm using event containers with SWUE or within a transaction and all I receive is fine. The only one problem I know, is when calling a workflow-rule with an object instance, which was in testing mode a runtime, during the workflow a persistant instance.

After having nearly broken my teeth by biting into the keyboard, yelling strangley at the monitor while trying to make contact with the SAP maschine downstairs, I've changed the coding to handle persistent objects after I knew it would function. :-)

Now I pass a the object ID as a simple parameter and let the rule instantiate the object itself as runtime.


For you check function module, I would suggest -- or at least give it a try -- to use the new interfaces, that passes the event container table as a reference to IF_SWF_IFS_PARAMETER_CONTAINER instead of the simple table.
This object also holds all the event container's elements (and as far as I know: persistent).

*"*"Local Interface:
*"  IMPORTING
*"     VALUE(SENDER) TYPE  SIBFLPORB
*"     VALUE(EVENT) TYPE  SIBFEVENT
*"     VALUE(RECTYPE) TYPE  SWFERECTYP
*"     VALUE(EVENT_CONTAINER) TYPE REF TO
*"        IF_SWF_IFS_PARAMETER_CONTAINER
*"  EXCEPTIONS
*"      NOT_RELEVANT

best wishes,
   Florin

-------- Original-Nachricht --------
> Datum: Mon, 8 Feb 2010 03:37:26 -0700
> Von: "Catherall, Andy" <andy.m.catherall at cadbury.com>
> An: "SAP Workflow Users\' Group" <sap-wug at mit.edu>
> Betreff: RE: Persistent vs Runtime handles - development standards?

> Two examples so far:
>  
> First - Child objects missing in WF & WF log
> Workflow is bombing out (in new ECC6 environment) because it cannot
> determine the agents... because it cannot find the object-values against
> which to interrogate the Responsibility Rule. In this case, this is the
> SALES ORG attribute, on the SALES ORG object (BUS0006) which is a custom
> attribute of [extended] IDOCALEAUD.
> The error message is SWF_EXP001 072 "Error in the evaluation of
> expression '&IDOC_PACKET<???>.ZSALESORGANIZATION.SALESORGANIZA' for it".
> The <???> has given me a little nugget of doubt as to whether I have a
> dodgy character or something, but I can't find it.
> In the log, this child object is clearly missing (IDOCALEAUD/IDOCPACKET
> is instantiated). Yet, when I test the IDOCALEAUD object in SWO1, the
> SALES ORG object does exist.
> Stranger yet, if I set a break point in the virtual-attribute code, and
> open the log, the code correctly finds the SALES ORG references, and
> then still fails to show the object in the log.
>  
> The variable type is SWC_OBJECT.
> I am using SWC_CREATE_OBJECT to instantiate it.
>  
>  
> Second - Event CheckFM throwing exception
> When creating a Document Information Record, the DRAW-FULLYCREATED event
> is raised. A custom CheckFM is used to interrogate a value held the
> object. The error appears to be that my code is expecting a run-time
> handle, but is having a persistent handle passed to it. 
> Just as I understood this, however, I discovered that if I raise the
> DRAW-FULLYCREATED event against the same object via SWUE, the
> event-container now holds a run-time object reference, and the entire
> operation works!
> So, it would appear that my code has to assess whether an object
> reference in a container is a run-time or a persistent handle first, and
> move it to the correct variable type accordingly. As both CV01N and SWUE
> were run in my name as foreground transactions, I was a little surprised
> that the reference types in the event-container differed, and this led
> me to wondering what was the 'correct' way of handling object
> references...?
>  
> I am vaguely aware, from the "Considerations when upgrading SAP Business
> Workflow..." document that the handling of SWC_OBJECT and SWOTOBJID has
> become stricter, but I am not entirely clear what 'right' looks like.
>  
> Thanks
> Andy
> 
> 
> ________________________________
> 
> From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
> Of Mike Pokraka
> Sent: Saturday 06 February 2010 09:11
> To: 'SAP Workflow Users' Group'
> Subject: RE: Persistent vs Runtime handles - development standards?
> 
> 
> 
> Hi Andy, 
> 
>  
> 
> I don't believe such a document exists, but could you provide an example
> of such surprises? 
> 
>  
> 
> Basic idea is that everything is persistent when it goes outside the
> current context. This means binding, container storage. Persistent is
> converted to runtime for working with an object and back to persistent
> for binding/storage. 
> 
>  
> 
> Hope that helps, 
> 
> Mike
> 
>  
> 
>  
> 
>  
> 
> From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf
> Of Catherall, Andy
> Sent: 05 February 2010 15:33
> To: SAP Workflow Users' Group
> Subject: BOR: Persistent vs Runtime handles - development standards?
> 
>  
> 
> Hi all
> 
>  
> 
> As I progress through my ECC6 upgrade, I have now started to trip over a
> few locations where the runtime/persistent handles are not as rigorous
> as they might be. This is having some entertaining effects!
> 
>  
> 
> Can anyone point me towards some development standards documents that
> might exist to make sure I use the correct handle type at the correct
> time?
> 
>  
> 
> Thanks
> 
> Andy Catherall 
> Technical Analyst - SAP Workflow, IXOS & DMS 
> 
>  
> 
> Int: 751 0556 
> Ext: +44 (0)121 486 0556 
> Mobile: +44 (0)7813 025481 
> 
>  
> 
>  
> 
> The Cadbury Cocoa Partnership is working to secure the future of cocoa
> farming around the world. Cadbury Dairy Milk bars are now Fairtrade
> certified in the UK and Ireland. Visit www.cadbury.com
> <http://www.cadbury.com/>  to learn more.
> 
>  
> 
> Be part of our "Purple Goes Green" commitments and don't print this
> email.
> 
>  
> 
> -----------------------------------------
> 
>  
> 
> This email (including any attachment) is confidential and may contain
> privileged information and is intended for the use of the individual(s)
> to whom it is addressed. If you are not the intended recipient or
> receive it in error, you may not use, distribute, disclose or copy any
> of the information contained within it and it may be unlawful to do so.
> If you are not the intended recipient please notify us immediately by
> returning this email to us at mailerror at cadbury.com and destroy all
> copies.
> 
> Any views expressed by individuals within this email do not necessarily
> reflect the views of Cadbury Holdings Ltd or any of its subsidiaries or
> affiliates. This email does not constitute a binding offer, acceptance,
> amendment, waiver or other agreement, or create any obligation
> whatsoever, unless such intention is clearly stated in the body of the
> email. Whilst we have taken reasonable steps to ensure that this email
> and any attachments are free from viruses, recipients are advised to
> subject this email to their own virus checking, in keeping with good
> computing practice. We accept no liability for any damage sustained as a
> result of any viruses. Please note that email received by Cadbury
> Holdings Ltd or its subsidiaries or affiliates may be monitored in
> accordance with applicable law. 
> 
> This email originates from Cadbury Holdings Ltd ("Cadbury") or Cadbury
> UK ("Cadbury UK") as the case may be.
> 
>  
> 
> Cadbury Holdings Ltd: registered in England and Wales, registered no.
> 52457
> Registered office address: Cadbury House, Sanderson Road, Uxbridge,
> Middlesex, UB8 1DH United Kingdom. Telephone: +44 (0)1895 615000
> Fax:+44 (0)1895 615001  
>  
> 
> Cadbury UK: a partnership of Cadbury UK Ltd, Trebor Bassett Ltd and The
> Old Leo Company Ltd. each of which is registered in England and Wales. 
> 
> Principal trading address: Cadbury House, Sanderson Road, Uxbridge,
> Middlesex, UB8 1DH United Kingdom. Telephone: +44 (0)1895 615000
> Fax:+44 (0)1895 615001  
> 
> 
> 
> 
> -----------------------------------------
> 



More information about the SAP-WUG mailing list