Multi-line Attribute for WF Routing

Stephan Becker stephan.becker at london.com
Fri Oct 6 04:25:34 EDT 2000


1. you write a method that has as input the multiline element and the appro=
ver who approved last, and find the next approver. (I work with users below=
, but you can use of course any object you want..) ..then you call the (sub=
)workflow that only contains the approval step again.. you do that recursiv=
ely until the last entry is reached.. i.e. approval workflow contains appro=
val step as subworkflow, then evaluation step (see below), then check if th=
e end of list is reached (see below also), if yes, go to update document st=
atus, if not, then again call of approval step subworkflow with next agent.=
.
the approval step needs a "refused" event, at which point you can call a di=
fferent suworkflow to handle the refusal and end the workflow..
 
here's how I did that in my current project (selectedagent is the last appr=
over before this evaluation, and is getting set to the next one at the end =
of the method). I'm sure there's a slicker way of doing it, but then this w=
orks and is easy to read:
 
begin_method selectnextmanualagent changing container.
data: selectedagent like wfsyst-initiator,
      i like bseg-gjahr,=20
      sufficient like boole-boole,
      m like rhobjects-object occurs 0 with header line.      =20
 
swc_get_element container 'SelectedAgent' selectedagent.
swc_get_table container 'ManualAgentList' m.
 
loop at m.
* SB: this assumes each name is only on the list once,
* SB: otherwise the workflow will loop endlessly
* SB: ensure you weed out duplicates when putting the=20
* SB: list of agents together
  if m =3D selectedagent.
* SB: count one up                          =20
    i =3D sy-tabix + 1.                            =20
*SB: grab the next entry                         =20
    read table m index i.                  =20
    if sy-subrc =3D 0.                      =20
      selectedagent =3D m.                            =20
    else.                  "end of the list          =20
      sufficient =3D 'X'.
    endif.
  exit.
  endif.
endloop.                                                         =20
* SB set return values                                  =20
swc_set_element container 'SelectedAgent' selectedagent.=20
swc_set_element container 'Sufficient' sufficient.      =20
end_method.                                             =20
 
In the workflow, you check via a condition for container element "sufficien=
t" and if it's okay, you set the document approval to okay.
 
2. ensure the approval step doesn't set the document status. if you have to=
, split up the standard method into two (create a delegated child object an=
d create two new methods), one to do the approval and one to do the status =
setting.
 
let me know if you need more info.
 
Stephan
 
------Original Message------
From: "Susan R. Keohan" <skeohan at MIT.EDU>
To: SAP-WUG at MITVMA.MIT.EDU
Sent: October 5, 2000 7:37:08 PM GMT
Subject: Multi-line Attribute for WF Routing
 
 
On behalf Jim Sauceman (sauceman at utk.edu)...
 
>I need your help as to how to design and program Workflow (46B) to address=
 the
>following situation:
>
>I am extending a business object to include a multi-line attribute for Fun=
ds
>Centers. It will contain all the Funds Centers referenced by that particul=
ar
>document. The number of occurrences could be anywhere from 1 to 999, but
>usually 3 or 4.
>
>Then, I need to develop a workflow to resolve a Standard Role (e.g. Depart=
ment
>Head) based on the value of each Funds Center and route the document to ea=
ch
>one (in succession) until all have approved the document. For example, I w=
ant
>the Department Head of the Funds Center of line 1 to approve the document
>first, then the Department Head of the Funds Center of line 2 to approve t=
he
>document next, and so on until all have approved it. If any one of them re=
ject
>the document, the Workflow should terminate (with the document remaining
>unapproved) regardless of how many approvals have occurred thus far. It wo=
uld
>be acceptable to send the document to all approvers simultaneously, but th=
ey
>ALL must approve the document before it can be processed. I have tested a
>single Funds Center being sent to my Standard Role (Responsibility Role) a=
nd
>it routes the work item correctly. Now, I need to extend that functionalit=
y to
>process a multi-line attribute for Funds Center.
>
>My questions are:
>
>1. How do I set up the workflow to examine the multi-line attribute Funds
>Center and send each line separately through Role Resolution so the work i=
tem
>can be proceesed by each approver in succession?
>
>2. It is my understanding that once a document is released/approved, its
>status changes to released/approved. This condition will occur as soon as =
the
>first approver acts on his/her work item. However, how can I make sure eac=
h
>approver releases/approves the document before =93officially=94 releasing =
it?
>
>Your suggestions are greatly appreciated.
>
>Jim Sauceman.............................sauceman at utk.edu
>University of Tennessee..................Voice: (865) 974-2448
>Manager, Database and Technical Support..Fax:   (865) 974-4810
>Project IRIS Workflow Team Leader
>
 
______________________________________________
FREE Personalized Email at Mail.com
Sign up at http://www.mail.com/?sr=3Dsignup
 


More information about the SAP-WUG mailing list