on 07-04-2018 11:59 AM
Hi All,
I am quiet new to SAP workflows, I have a very basic question:
Consider a scenario where i have 3 workflow steps,
a. An activity step.
b. A decision step.
c. An activity step.
Now consider, in step 2 user takes an action on the decision step after a while(after 1 week).
So that time, when user approves the work item the INSTID in the Method FIND_BY_LPOR will definitely have the key value but will the public attribute 'IM_A' would still be holding the value as '10' or will it be vanished and we have to assign the value again?
I am asking this because, if i had calculated some attribute value at the starting step of the workflow and at later stage(consider after user decision step) I need to utilized the same value again, in that case i would not like to call the same logic again to calculate.
So, I was thinking to assign it to public attribute and at later step I'll use it.
But when i am doing above, my Public attribute value is getting clear(i mean not available) after the user decision step.
So, I wanted to know weather it is possible or not?
Is it like the attribute value will be available only in active session and as the user decision step is there the session gets expire. So, the attribute values are getting vanish?
Regards,
Prince
On a general OO note, you should never assign values to public attributes, they should be read-only.
For WF, you should always assume the object instance only exists as long as the work item (i.e. one step) is being executed. Your object will always be instantiated using the INSTID key, and read it's values via the instantiation (CONSTRUCTOR or other method). If you want to retain a value, you must save it in a way that it will be retrieved whenever workflow instantiates the object. Typically sing a SET_XYZ( ) method which writes it to the database.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Mike,
Thank you very much for your above answer.
I used to think like, we can retrieve the values of the attributes even after the work item execution(for example after user decision step where user can take decision after many days). I thought as we are getting the key values(Unique key) in every step through INSTID in similar fashion system will be storing the attributes values too but it seems like i was wrong.
Regards,
Prince
No, the only thing that is physically stored in the database is what you see in the container before you expand the object: The instance ID, the object category (CL=Class), and the object type (Class name).
Even in the workflow container display, when you click on the triangle to expand an object to see it's attributes, you will see that it calls BI_PERSISTENT~FIND_BY_LPOR to instantiate the object and retrieve its attributes. Set a breakpoint to see how it works. Once that particular code has run, the instance is no longer needed; each piece of workflow functionality including execution of tasks works this way.
User | Count |
---|---|
89 | |
10 | |
9 | |
9 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.