‎2010 Oct 25 4:48 AM
Hello,
I am currently designing a workflow using an ABAP-Objects. So far I have been been able to get my Workflow to run with my class, but I have a couple of problems:
- I am using the Function 'SAP_WAPI_START_WORKFLOW' to start other subflows, which enables me to decide which subflow to start at runtime. All of the subflows have standart importing-parameters in their containers, such as the key of my class. In each workflow I instantiate my class using a self-written method, which checks the table T_INSTANCES in my object, and then either returns the object reference to an existing instance or creates a new one. Obviously all of the subflows that I call from my main workflow should be able to find the instance. As far as I can see in their protocolls, this happens without any problems. The problem starts when I make changes to the instance. For example the changing of attributes (with setter methods) seems not to work. After the subflows are finished, in my main workflow, I do not see (with getter methods) any changes that has been made to the object. Is local persistence really limited to one workflow ?
- My second problem is basically about the workflow container in workflow protocoll. In the same workflow, I can change the attributes of my object. Nevertheless, the protocoll always show the initial attribute, even though, my task with the getter-method returns the new value of the attribute.
I appreciate any help and thanks a lot in advance.
‎2010 Nov 01 10:25 AM
Have you fully implemented refresh method for public attributes?
WBR -
Pauls
‎2010 Nov 03 12:59 PM
Hello Pauls,
Thank you for your respond and interest.
As far as I am informed, the refresh method is there to check the inconsistencies of the information of your current instance and the database "version" of your object. It is my understanding that this method should be implemented, if you have an underlying database layer.
In my concept, my objects live as long as the business workflow remains active. It is completely assured that the subflows those are started from my main workflow end as well. So, basically, I am not using a database in this case.
During debugging I have found out that the instance management, as it is described in Business Workflows Book from SAP-Press, does not really work as it is intended. The private static table for the management of instances is actually absolutely empty, when the object is instantiated from another context.(from my subflows)
Is there a way to find out, how the memory management and object deployment works in SAP system, especially with business workflows ? Some of my ideas have been, using the shared memory.. or up- and downloading the important information about my object as an internal table, so that the different workflows can communicate using a central object. Or is this the wrong forum to ask this question ?
Thanks a lot in advance.
G.Fendoglu
‎2010 Nov 03 3:20 PM
Hi!
In this case you are "simulating" DB access - keep your data as class-data tables and use them as if you are selecting from DB.
There is an example, sort of, in SAP - CL_SWF_FORMABSENC. It shows how to manage instances, data part you have to add yourself.
As far as I can see, everything that is not kept in class static data is lost. Of course, you can always update WF container, but that adds additional difficulties.
WBR -
Pauls
‎2010 Nov 14 7:01 PM
Hello Pauls,
Thank you for your answer. I think we are misunderstanding each other. The problem occurs (I think) because my class is not a singleton class. Or am I mistaken ?
When I directly start a subflow from my main workflow, then the instance that I have created in my main workflow is also visible to the subflow. As well as the static table which actually keeps track of the instances. So, in this case the subflows finds the instance and then can use the object as is.
When I start a subflow from my main workflow using the function I mentioned above, then even though the same object key is used, there is a new instance. And the static table (I assume that you mean a static variable from type table, when you say "class table") is completely empty. In this case, my "new" instance is created which overwrites every attribute that I have set in the main workflow, before I started the subflow. More interestingly, my main workflow instantiates another new object, as soon as the subflow has finished. (I am using an event to wait for the subflow to finish.)
On the other hand, I am not quite sure that I understood your approach with refresh and how it could help me. This method is not well documented anywhere, and all of the examples that I have found are about "leave it empty"
As far as I understood, this method is called by the workflow between the steps, when an object is used. I slowly start to think that I need advanced information about Workflows and Memory Management.
Thanks a lot again. Apparently, I am the only person who came across such a problem
Greetz
G.Fendoglu