Getting _wf_initiator from a task

Dart, Jocelyn jocelyn.dart at sap.com
Wed Oct 9 19:37:25 EDT 2002


Hi Rick,
Don't use workitem.createdbyuser as the workflow initiator
- that could be different people in different circumstances
e.g. workflow initiator,
the person who executed the previous workitem or WF-BATCH.
 
I think you are making more work for yourself by trying to
avoid creating explicit container elements to handle this.
 
Even linking to the parent of a work item is dubious as it
doesn't cater for scenarios using subflows within workflows.
 
You could potentially create a delegated subtype of _WORKITEM
and use a virtual attribute to find the initiator by finding
the top-level workflow and reading its worflow initiator container
element but to me that sounds dubious from a performance
perspective.
 
Standard practice is ...
1) From your triggering event to the workflow, bind the event
creator element to the workflow initiator element.
2) Create a workflow container element based on USR01.
3) Add a step based on USR01.FINDUSERFROMAGENTSTRUCTURE to convert
your initiator to a USR01 object.
4) Pass the USR01 object to each task you want to display the
details.
 
If you have the same pattern in many tasks you might
want to ensure that the USR01 element is called the same thing
in all tasks and make that a standard at your site.
 
It's usually better to be explicit - less hassle during monitoring,
troubleshooting and future maintenance - and it really isn't all that
much extra work.
 
Regards,
        Jocelyn Dart
Consultant (SRM, EBP, Workflow)
and co-author of the book
"Practical Workflow for SAP"
SAP Australia
email: jocelyn.dart at sap.com
phone: +61 412 390 267
fax:   +61 2 9935 4880
 
 
 
 
 
-----Original Message-----
From: Rick Sample [mailto:Rick.Sample at gbe.com]
Sent: Wednesday, 9 October 2002 10:33 PM
To: SAP-WUG at MITVMA.MIT.EDU
Subject: Getting _wf_initiator from a task
 
 
I can get the _wf_initiator (USmyname) which is the work item creator as
well
and display it in my tasks description text like this:
 
...
Created by:
<H>&_WORKITEM.CREATEDBYUSER.NAME&</> <H>
&_WORKITEM.CREATEDBYUSER.TELEPHONE&</>
...
 
When I go to my second task , which has a different user execute that
task,
I want to display the _wf_initiator's name, telephone, etc. The above
code
obviously give me the task creator. Not the Wf initiators data.
 
All the tasks in my workflow I want to display workflow initiator's
data in the above layout.
I don't want to create a wf container type USR01 element to store for I
 know it must be in an object somewhere.
How do I get the wf_initiators data from any task as an object verses
just the USmyname?
 
Demo flow to look at?
Thanks!
 


More information about the SAP-WUG mailing list