Specifying Interface as Importing parameter

Alon Raskin araskin at 3i-consulting.com
Thu Nov 16 09:18:51 EST 2006


Jocelyn,
 
Thank you for your response. When I added the IF_WORKLFOW interface it also added the BI_PERSISTENT and BI_OBJECT interfaces. It did that because the IF_WORKFLOW interface inherits from those BI_PERSISTENT which in turn inherits from BI_OBJECT.
 
The reason that I chose BI_PERSISTENT was because the interface defines the LPOR method. I want to call this method so I can get the ObjectType and Key of any instance that is passed into my Workflow. However, it seems that the current implementation of the Workflow builder does not allow this. I have to specify a concrete type and not an interface as the type definition of my container element. 
 
Your suggestion of not specifying a class (type) worked but still did not give what I want. Ultimately I want to take this instance and cast it to a reference of BI_PERSISTENT. It is 'this' that I can not do and therefore greatly reduces my ability to deal with 'abstraction' in my design. 
 
Very disappointing but I am sure that SAP will 'fix' this significant limitation in subsequent releases.
 
Regards,
 
Alon Raskin
e: araskin at 3i-consulting.com <mailto:araskin at 3i-consulting.com> 
p: +1 207 523 3489
c: +1 207 409 4983
f:  +1 806 403-4983
________________________________

From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf Of Dart, Jocelyn
Sent: 15 November 2006 22:16
To: SAP Workflow Users' Group
Cc: Janetz, Frank
Subject: RE: Specifying Interface as Importing parameter
 
Hi Alon, 
 
One of the basic rules is you have to obey is that your class must support interface IF_WORKFLOW. 
 
BI_PERSISTENT does not support IF_WORKFLOW.  Also as BI_PERSISTENT is part of the IF_WORKFLOW interface you could run into recursive scenarios so best to create something completely separate. 
 
Perhaps what you are looking for is a container element that is an object type of category ABAP Class but without the class name specified???   This is ok to do and lets you pass in any workflow capable class at runtime. 
 
Widening and narrowing bindings are possible - make sure you use the arrowhead button to refine the binding rules, e.g. when narrowing cast you might want to use "handle error as warning". 
 
Regards, 
Jocelyn Dart 
Senior Consultant 
SAP Australia Pty Ltd. 
Level 1/168 Walker St. 
North Sydney 
NSW, 2060 
Australia 
T   +61 412 390 267 
M   + 61 412 390 267 
E   jocelyn.dart at sap.com 
http://www.sap.com <http://www.sap.com/>  
The information contained in or attached to this electronic transmission is confidential and may be legally privileged. It is intended only for the person or entity to which it is addressed. If you are not the intended recipient, you are hereby notified that any distribution, copying, review, retransmission, dissemination or other use of this electronic transmission or the information contained in it is strictly prohibited. If you have received this electronic transmission in error, please immediately contact the sender to arrange for the return of the original documents. 
Electronic transmission cannot be guaranteed to be secure and accordingly, the sender does not accept liability for any such data corruption, interception, unauthorized amendment, viruses, delays or the consequences thereof.
Any views expressed in this electronic transmission are those of the individual sender, except where the message states otherwise and the sender is authorized to state them to be the views of SAP AG or any of its subsidiaries. SAP AG, its subsidiaries, and their directors, officers and employees make no representation nor accept any liability for the accuracy or completeness of the views or information contained herein. Please be aware that the furnishing of any pricing information/ business proposal herein is indicative only, is subject to change and shall not be construed as an offer or as constituting a binding agreement on the part of SAP AG or any of its subsidiaries to enter into any relationship, unless otherwise expressly stated. 
 
 
________________________________

From: sap-wug-bounces at mit.edu [mailto:sap-wug-bounces at mit.edu] On Behalf Of Alon Raskin
Sent: Thursday, 16 November 2006 8:13 AM
To: SAP Workflow Users' Group
Subject: Specifying Interface as Importing parameter
Well this Workflow-OO stuff just gets better and better.

It seems that I can not declare a container element of type interface. The workflow editor requires a concrete type and will not allow me to specify an element whose type is an interface. The way I see it, this basically blows away any polymorphic behaviour within Workflow and greatly reduces the benefits of using OO in SAP Workflow (feel free to let me know that I am over reacting). To make things worse I can achieve this using the old BOR by simply not specifying a type.
 
Before you ask, here is what I am trying to achieve, I am creating a workflow which should be able to accept any instance of a class which implements the BI_PERSISTENT interface. However, when I define my importing container element I am given an error that tells me that I can not specify a container element of type BI_PERSISTENT and must specify a concrete type.
 
Am I going crazy or is this a big 'hole' in the OO - Workflow implementation?
 
Alon Raskin
e: araskin at 3i-consulting.com <mailto:araskin at 3i-consulting.com> 
p: +1 207 523 3489 
c: +1 207 409 4983
f:  +1 806 403 4983
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/sap-wug/attachments/20061116/d41aaa5e/attachment.htm


More information about the SAP-WUG mailing list