Workflow for Beginners

download Workflow for Beginners

of 17

Transcript of Workflow for Beginners

  • 8/13/2019 Workflow for Beginners

    1/17

    Workflow for BeginnersAuthors: Arnab Dhar, Sangram Chowdhury.

    11/28/13 191949291.doc Pag 1 o! 1"

  • 8/13/2019 Workflow for Beginners

    2/17

    Workflow for Beginners...........................................................................................................................1

    1:FINDASTANDARDBUSINESSOBJECT- WHICHREATESTOTHEDESIRED!ASTERDATA"""""""""""""""""""""""""""#

    $:CREATEABUSINESSOBJECT"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""%#: CREATEANE&ENT"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""'

    (: CREATEA!ETHOD"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""")

    *" CREATE+E,FIEDS""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

    %:I!.E!ENTBUSINESSOBJECT""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

    ':CREATEWOR+FOWTAS+""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""1/

    ): SETU.CONTAINERS"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""11

    : ASSI0NIN0A0ENTTOATAS+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""1$

    1/: FORTHISDE!OEA!.E2 ,OUWITRI00ERTHEE&ENTB,WRITIN0ACUSTO!CODE" """""""""""""""""""1(11" A SIN0ESTE.TAS+"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""1*

    1$" SO!EWOR+FOWCONCE.TS"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""1*

    11/28/13 191949291.doc Pag 2 o! 1"

  • 8/13/2019 Workflow for Beginners

    3/17

    1:Find a standard business object - which relates to the desired master data.

    Tr3ns345ion S#$D

    Definition Tools SAP Business WorkflowDevelopmentDefinition ToolsBusiness

    Object Builder Tr!ns!ction "ode SW#1$

    Cli4k on 56e B7siness O89e45 B7iler" T6e ini5i3l s4reen 3;;e3rs 3s follows"

    Ei56er se3r46 for 3n o89e45 8< n3=e in s6or5 es4ri;5ion" Or 7se 56e I!0 s5r7457re2 w6i46is 344esse >i3 56e B7siness O89e45 Re;osi5or< 8755on"

    .osi5ion =o7se 47rsor in 56e fiel O89e45?in5erf34e 5

  • 8/13/2019 Workflow for Beginners

    4/17

    Sele45 3ll o89e45 5

  • 8/13/2019 Workflow for Beginners

    5/17

    A 87siness o89e45 63s following 4o=;onen5s 3s s6own in 56e fig7re:

    11/28/13 191949291.doc Pag % o! 1"

  • 8/13/2019 Workflow for Beginners

    6/17

    A s4reen s6owing 56e 4o=;onen5s of 56e o89e45 is is;3le 56e 87siness o89e45 n3=e ;refi@e wi56 "

    En5er 56e following fiels wi56 >3l7es:

    &b'ct ty(: TEST

    This is the internal technical key. 6Object type can have maximum 10

    characters. This must be unique across all object type. Objects arespecific instances of object types at runtime.

    &b'ct nam:O89e45N3=efor

    11/28/13 191949291.doc Pag ) o! 1"

  • 8/13/2019 Workflow for Beginners

    7/17

    The object type is addressed with this name by external applications.This is a descriptive n!lish name and can be up to "# characters. This

    also must be unique across all object type.

    *am: O89e45 N3=e:

    This is a meanin!ful name of the business object.

    Dscr+(t+on: O89e45 Des4ri;5ion:

    $Object description% can be up to &0 characters.

    Program: TEST

    ach object type has an '(')*& pro!ram in which methods of theobject are implemented. This pro!ram is !enerated automatically

    when you create or revise an object type.

    A((+cat+on:

    $+ indicates cross application.

    ,hould you need to extend the components of an ,') delivered object%

    you can create a subtype and then -dele!ate it back up to itssupertype. This means that the supertype transparently acquires the

    new functionality. /f this supertype is referenced by any ,') or custom

    application% the new functionality is available. 'ny supertype mayhave at most one dele!ation assi!ned to it. ele!ations are client

    independent. se the menu path ,ettin!s 2,ystem3wide to create adele!ation.

    3: Create an event.

    O;en 56e O89e45 5e 56e e>en5 3 n3=e 3n 3 es4ri;5ion" Ne@5 se5 56e s5357s of 56is o89e45 5

  • 8/13/2019 Workflow for Beginners

    8/17

    A s=3ll 8o@ sign >3nis6es fro= 56e rig65 sie of 56e e>en52 ini435ing 5635 i5 is

    i=;le=en5eT6ere 43n 8e =7l5i;le 5riggering e>en5s for 3 s53n3r?47s5o=er 53sk"

    /n 4*" &.0 the release strate!y for new Object Types and Object Type

    5omponents methods% attributes% events% etc.7 was enhanced. 8ow

    when an object type and*or components are created% there aredifferent statuses to select% based on its required purpose. The

    statuses are9

    :odeled 3 objects cannot be accessed at runtime. This is the status

    that is automatically set when an object type or component is

    created. /tems with a modeled status cannot be referenced in anytype of workflow task.

    /mplemented 3 objects can be used internally in a test environment.

    They are accessible% but may not be stable especially if nodele!ation has been defined7.

    4eleased 3 objects are ready for production. 8ote9 ;ocal objects

    cannot be released.

    Obsolete 3 objects are typically replaced by new functionality or

    incompatible with previous versions. This status is optional.

    4: Create a method.

    Ne@5 3 =e56o =7s5 8e 4re35e wi56o75 7sing 3n< f7n45ion =o7le 5e=;l35e" W6en

    4re35ing 56e =e56o ens7re 5635 56e =e56o 43ll is synchronous - 56is =e3ns 5635 56e=e56o oesnG5 re7ire 3 5er=in35ing e>en5"

    ' method can be synchronous or asynchronous. ,ynchronous :ethod:ethod that% for the duration of its execution% assumes the process

    control and% after its execution% reports to the callin! component work

    item mana!er% in this case7.,ynchronous methods can return the followin! data% if defined9 4eturn

    parameters% one result and xceptions.

    Terminatin! events can also be defined for a sin!le3step task described

    with a synchronous method. 't runtime% the relevant work item is then

    terminated either when the synchronous method is successfullyexecuted or when one of the defined terminatin! events occurs.

    'synchronous :ethod

    :ethod that% after its execution% does not report directly to the callin!component work item mana!er% in this case7.

    11/28/13 191949291.doc Pag 8 o! 1"

  • 8/13/2019 Workflow for Beginners

    9/17

    'synchronous object methods do not return results% parameters orexceptions.

    't least one terminatin! event must be defined for a sin!le3step task

    described with an asynchronous object method.'t runtime% the relevant work item is only terminated if one of the

    defined terminatin! events occurs.

    Ne@5 se5 56e s5357s of 56is o89e45 5

  • 8/13/2019 Workflow for Beginners

    10/17

    *ow you can chc0 th synta, gnrat th us+nss &b'ct and thn tst +t.

    -cut th custom mthod you cratd and g+ th Com(any cod, Documnt

    numbr and ar.

    $:Create wor%low tas%.

    Now we nee 5o 4re35e 3 workflow 53sk2 56is will 8e 5riggere 8< 56e e>en5 3n will 43ll56e esire =e56o in e 5o 56e r+ggr+ng -nts 538" Inser5 3 new en5r< in 56e 538le 6ere -

    referen4ing 56e 87siness o89e45 s785en5"

    =hen this event occurs% the system starts this task. 'nother event is

    Terminatin! vent9 =hen this event occurs% the system terminates thework item for this sin!le3step task.

    11/28/13 191949291.doc Pag 1 o! 1"

  • 8/13/2019 Workflow for Beginners

    11/17

    /f the sin!le3step task has the property 5onfirm end of processin!%the work item is not terminated when the event occurs. The work item

    must still be set to >one? by one of its recipients.7

    se9,in!le3step tasks that refer to an asynchronous method must have at

    least one terminatin! event.,in!le3step tasks that refer to a synchronous method can have

    terminatin! events.

    &: 'et u# containers.

    T6ere 3re 3 n7=8er of 353 4on53iners2 w6i46 3re 7se in 56is ;ro4ess 5o 5r3ns;or5 rele>3n5

    353 8e5ween e>en5s2 53sks 3n =e56os2 we nee 5o =3ke 3 few s=3ll =oifi435ions 5o56ese"

    11/28/13 191949291.doc Pag 11 o! 1"

  • 8/13/2019 Workflow for Beginners

    12/17

    Cli4k on 56e Conta+nrs8755on" Now 4li4k 56e Crat8755on" Cre35e 56ree fiels in 56e

    4on53iner wi56 referen4e 5o 56e 35383se 538le" For 56e firs5 fiel gi>e referen4e 538le n3=e3s KP;L 3n referen4e fiel n3=e 3s Ke referen4e fiel

    K-$*=L 3n K>?A@=L for 56e 56ir" Now go 834k 5o 56e Triggering E>en5 5382

    6ig6lig65 56e newl< 4re35e re4or in 56e 538le 3n 4li4k 56e +nd+ng D!+n+t+on8755on"

    T6is s6ows 7s 6ow 353 is 5r3nsferre fro= 56e E>en5 4on53iner in5o 56e T3sk 4on53iner"

    T6ere s6o7l 8e fo7r re4ors" Now 4li4k on 56e -nt Paramtr Conta+nr8755on2 56iss6ows 7s w635 353 is ;resen5 in 56e e>en5 for 5r3nsfer 5o 56e 53sk" If 56ere is =3546ing353 in 56e E>en5 .3r3=e5er Con53iner2 4o;< 56e ele=en5 n3=e fro= 56e s4reen 3n inser5

    i5 in 5o 56e 3sso4i35e slo5 in 56e 8ining efini5ion En4lose in MGs"

    h ast st( o! ais 5o 345i>35e 56e e>en5 link3ge2 8< ;ressing 56e s=3ll rd8755on 5o

    56e lef5-63n sie of 56e e>en5 re4or" W6en i5 is 345i>35e i5 8e4o=es grn" T6is 4re35es

    56e link 8e5ween 56e e>en5 3n 56e 53sk - w6i46 will 43ll 56e =e56o2 w6i46 in 57rn 43lls56e re7ire 5r3ns345ion or re;or5s or f7n45ion =o7le"

    (: )ssi*nin* a*ent to a +as%.

    De5er=ine 56e ;ossi8le Agen5s for e@e475ing 56e single s5e; T3sk"

    'n agentis an executor of a work item.

    ' work itemis the actual runtime representation of a workflow

    process step task7. =ork items appear in users? inte!rated

    inboxes.

    11/28/13 191949291.doc Pag 12 o! 1"

  • 8/13/2019 Workflow for Beginners

    13/17

    Possible agentsare a collection of a!ents who qualify to execute a

    work item% and therefore could potentially receive a work item in

    their inte!rated inboxes.

    Selected agentsare those possible a!ents 1 or more7 who areelected to execute a task at runtime. They actually receive thework item in their

    inte!rated inboxes.

    The actual agentis the a!ent amon! those selected a!ents who

    actually processes the work item. =hen the actual a!ent processesthis work item% it disappears from the inte!rated inboxes of any

    other selected a!ents.

    't runtime% a pool of selected and actual a!ents can be created forthe followin! types of actual a!ents9

    The processing agent:The persons7 who actually processes

    the

    work item. The deadline agent:The persons7 informed when a work

    item is not processed fully within the specified deadline. Thisnotification is received via a deadline work item in the deadline

    a!ent?s inte!rated inbox.

    The notification agent9 The persons7 notified when an activity

    step is fully processed. This notification is received via notification

    e3mail in the notification a!ent?s ,') office e3mail.The notification

    agentis informed if a work item or workflow has been processed and

    the status of the work item is -completed or -lo!ically deleted.

    Res;onsi8ili5< 43n 8e 3ssigne 5o 3 single ;erson2 5o =7l5i;le ;eo;le 3 s63re 53sk 83se

    on 9o8s2 ;osi5ions or org3ni35ion3l 7ni5" T6is fle@i8le 3ssign=en5 ;ro>ies 56e gre35es5

    s538ili5< 3n =3in53in38ili5< sin4e 56e 53sks o no5 63>e 5o 8e re3ssigne e>er< 5i=e

    s;e4ifi4 e=;lo

  • 8/13/2019 Workflow for Beginners

    14/17

    Agen5s 3re 3n i=;or53n5 ;3r5 of 53sks" Agnts 5ca(ab cutors o! th tas07 must

    b ass+gnd to th s+ngst( tas0" Wi56in 56e 53sk efini5ion2 Add+t+ona

    dataAgnt ass+gnmnta+nta+n" T6ese 3re 56e 3gen5s r3wn fro= 56e

    org3ni35ion3l ;l3n w6o 3re 73lifie 5o ;erfor= 56e 53sk"

    1,: For this demo eam#le you will tri**er the event by writin* a custom code.

    "

    Z

    T6e s53r5ing ;oin5 of 3 workflow is 56e o89e45?e>en5 5rigger" Wi56o75 56is 56e

    ;ossi8ili5< of 87iling 3 workflow is r7le o75" T6e 5riggering of e>en5s is 346ie>e

    56ro7g6 3 n7=8er of =e463nis=s so=e of 56e= 3re lis5e 8elow:

    E>en5s 43n 8e 4re35e in 56e following w3

  • 8/13/2019 Workflow for Beginners

    15/17

    Custom cod: T6ef7n45ion =o7le SWEE&ENTCREATEis 7se 5o 5rigger 56e

    e>en5" DonL5 forge5 5o wri5e 3 4o==i5 work3f5er 56e f7n45ion =o7le 43ll"

    11. ) 'in*le 'te# +as%.

    B< now e efine 3 B7siness O89e45 wi56 ke< fiels Co=;3n< 4oe2 A44o7n5ing

    o47=en5 n7=8er 3n Fis43l e 3lso efine 56e T3sk for linking 56e =e56o 3n e>en5 3n3lso efine 4on53iners 3n ;erfor=e 56e 8ining efini5ion" ,o7 63>e 3lso efine 56e

    47s5o= 4oe 5o 5rigger 56e e>en5" Now2 e is 5o is;l3< fin3n4i3l o47=en5

    7sing CA TRANSACTION KFB/#L2 w6en 56e e>en5 is 5riggere" For 56is en5 4on53iner2 fro= 56ere i5 will ;3ss on 5o 56e 53sk 4on53iners eefine" T6is 5r3nsfer is 4on5rolle 8< 56e 8ining efini5ion 35ing 56e 53sk" Fro= 56e 53sk 4on53iner 56e ke< fiels will 8e 3>3il38le insie 56e

    B7siness O89e45" T67s 56e< will 8e 3ssess38le insie 56e O89e45 !e56o2 w6ere i73l s5e;s" W6en 4re35ing 3 s5e; in 3

    workflow efini5ion2 56e s5e; 5

  • 8/13/2019 Workflow for Beginners

    16/17

    us+nss &b'cts:Ien5ifi38le s;e4ifi4 ins53n4es of 3n o89e45 5en5 is 4re35e in 3;;li435ion"

    $ T6e workflow re4ei>es 56e 3;;li435ion 353 fro= 56e e>en5"

    # T6e workflow s5e; 5r3nsfers 3;;li435ion 353 fro= 56e workflow 5o 56e

    s

  • 8/13/2019 Workflow for Beginners

    17/17

    ) T6e workflow s5e; 5r3nsfers 3;;li435ion 353 5o 56e s53n3r role ;3r3=e5ers"

    T6e 53sk 5r3nsfers 3;;li435ion 353 fro= 56e 53sk 5o 56e o89e45

    =e56o ;3r3=e5ers"

    1/ T6e e@e475ion of 56e o89e45 =e56o =3< 463nge 56e 3;;li435ion 353" T6eo89e45 =e56o ;3r3=e5ers 5r3nsfer 353 5o 56e 53sk"

    11 T6e 53sk 5r3nsfers 3;;li435ion 353 834k 5o 56e workflow"

    1$ T6e workflow s5e; 5r3nsfers 3;;li435ion 353 fro= 56e workflow 5o 56e

    3sen5 5r3nsfers 3;;li435ion 353 5o 56e 53sk"

    1* T6e 53sk 5r3nsfers 3;;li435ion 353 834k 5o 56e workflow"

    T6e 353flow 8e5ween 56e 3;;li435ion 3n workflow 4on53iner ele=en5s 3n 8e5ween56e ele=en5s of 56e workflow 4on53iner2 e>en5 4on53iners2 53sk 4on53iners2 role

    4on53iners2 3n =e56o ;3r3=e5er 4on53iners is 4on5rolle 8< 3 se5 of r7les 43lle 56e

    8ining efini5ion"

    11/28/13 191949291.doc Pag 1" o! 1"