Adding a processflow for any changes to accounting units on GL20

 17 Replies
 0 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
Ruma Malhotra
Veteran Member
Posts: 412
Veteran Member
    I am a novice in process flow and just trying to enter the arena and starting to get my hands dirty.

    I am trying to add a processflow to trigger whenever a change is made to an accounting unit on GL20.

    I looked on the delivered flow triggers from lawson and have not found one on this.

    Any ideas on where to start. Lawson does not store any changes made to the accounting unit with any kind of date field.

    How can I write a pf trigger for this ?

    Thanks in advance.
    John Henley
    Posts: 3353
      Ruma, you would need to add two things: 1) a ProcessFlow service in tied to the flow, as well as 2) a customization--either a Design Studio customization or a COBOL user exit to trigger the service and pass the before/after values. Incidentally, there are some new features in 9.0.1 (MSP4 I think) that add audit tables for the types of changes you want to track.
      Thanks for using the LawsonGuru.com forums!
      John
      David Williams
      Veteran Member
      Posts: 1127
      Veteran Member
        You will need to add a trigger, either through Design Studio or with a COBOL user exit.
        David Williams
        Ruma Malhotra
        Veteran Member
        Posts: 412
        Veteran Member
          John, I tried using the audit tables on GLNAMESAU and wrote a smart notification on this. But somehow it is not working properly.

          Hence the processflow solution. If I go down the design studio path is there some kind of previous post that will help me with this.

          tia.
          Shane Jones
          Veteran Member
          Posts: 460
          Veteran Member
            Ruma,
            I don't have smart notifications so I sometimes get creative with process flow. However this is not a novice idea and might not work if your tables get too big... I have a flow that uses sql to compare a table and a copy of the table ... When it sees a difference it sends an email and then replaces the copy with a "new" copy of the table....

            Shane
            Shane Jones
            Tools: HR, Payroll, Benefits, PFI, Smart Office, BSI, Portal and Self-Service
            Systems: Lawson, Open Hire, Kronos, Crystal Reporting, SumTotal Learning
            ** Teach others to fish...
            Bill Ianni
            Veteran Member
            Posts: 111
            Veteran Member
              I have created a similar trigger if you want to take a look at it.
              Ruma Malhotra
              Veteran Member
              Posts: 412
              Veteran Member
                That would be great. How can I look at it ?
                james whatley
                New Member
                Posts: 1
                New Member
                  I did this on the cobol side and works great.
                  Ruma Malhotra
                  Veteran Member
                  Posts: 412
                  Veteran Member
                    Did you us a cobol user exit to develop the flow ?
                    Rob Conrad
                    Veteran Member
                    Posts: 73
                    Veteran Member
                      Hi Ruma -

                      It's pretty straightforward to do the trigger in Design Studio - and I would recommend this approach from an upgrade / system management perspective versus the Cobol approach.

                      I have some screenshots from a client design doc I created for an Absence Management flow I did using LP51 on 9.0.1 that you might useful

                      Feel free to drop me an email and I'll send it over - it's all very GUI process these days and easy to trigger on Add, Change, Inquire, Delete from the custom form etc.

                      RC.
                      John Henley
                      Posts: 3353
                        Assuming you're licensed for Design Studio...=
                        Thanks for using the LawsonGuru.com forums!
                        John
                        Ruma Malhotra
                        Veteran Member
                        Posts: 412
                        Veteran Member
                          Yes we are licensed for ds
                          Ruma Malhotra
                          Veteran Member
                          Posts: 412
                          Veteran Member
                            Thanks Rob for sending it. It is very useful.
                            M Graham
                            Veteran Member
                            Posts: 32
                            Veteran Member
                              Hi Ruma - I just joined the process flow forum and saw your post. I have created many PF triggers in both Design Studio and in COBOL user exits, and would be happy to email you a sample of each. Also, for more info, Lawson documents how to create a custom PF trigger in their manual "Process Flow Developer Guide v.9.0.1.x" (pfug-uwa.pdf) starting on p.149.
                              Ruma Malhotra
                              Veteran Member
                              Posts: 412
                              Veteran Member
                                Thanks you Marcy for the helpful hints. If you can send me that information that would be great. Why did I forget about you ?
                                M Graham
                                Veteran Member
                                Posts: 32
                                Veteran Member

                                  Steps to create a Process flow trigger on GL20 changes
                                  (From M.Graham).

                                  Overview:

                                  There are 3 main steps to creating a process flow trigger in GL20:

                                  1.       Create code for a process flow trigger in either a COBOL user exit  or Design Studio.

                                  These instructions show you how to create a trigger in COBOL user exit code in files GL20EPD & GL20EWS (where “E” is an “End” user exit .

                                  2.       Process Flow Designer

                                  Create a process flow, save it, and upload it to the server.

                                  3.       Process Flow Administration Tool

                                  Create a service (4 steps)

                                  Detail Steps:

                                  1.     COBOL user exit:

                                  a.       Create a trigger in a COBOL user exit in files GL20EPD & GL20EWS (where “E” = “End” user exit).  See example code below.

                                  b.      Compile the user exit:    qcompile –u  dev90 if gl20e   Verify no errors exist.

                                  c.       Compile the program: qcompile dev90 if gl20   Verify no errors exist.

                                   

                                  GL20EWS

                                  000100******************************************************************

                                  000200*                            GL201EWS                            *

                                  000300******************************************************************

                                   

                                  GL20EPD

                                  Note that the GL20EPD file must have the same number of sections as the GL20PD file.

                                        *MG. 03/10/11 - Process flow trigger for GL20

                                        ******************************************************************

                                         GL20ES1-TRANSACTION             SECTION 10.

                                        ******************************************************************

                                         GL20ES1-START.

                                   

                                             IF (GL20F1-FC NOT = "C")

                                                 GO TO GL20ES1-TRANSACTION-END.

                                   

                                        *-----------------------------------------------------

                                        *Check if workflow is enabled for the service

                                        *-----------------------------------------------------------

                                             PERFORM 1000-OPEN-WORKFLOW-DB.

                                   

                                             INITIALIZE WFAPI-INPUT

                                                        WFAPI-OUTPUT.

                                             IF (GL20F1-FC = "C")

                                                 MOVE "GL20E.1_C"          TO WFAPI-I-SERVICE.

                                             MOVE GL20F1-GLN-COMPANY       TO WFAPI-I-CRITERION-1.

                                             MOVE GL20F1-GLN-ACCT-UNIT     TO WFAPI-I-CRITERION-2.

                                             PERFORM 1000-WF-SERVICE.

                                             IF (WFAPI-O-RETURN-CODE NOT = ZEROS)

                                                 GO TO GL20ES1-TRANSACTION-END.

                                   

                                        *-------------------------------------------------------------

                                        *Create work unit header

                                        *-------------------------------------------------------------

                                             INITIALIZE WFAPI-INPUT.

                                   

                                             MOVE WFAPI-O-SERVICE         TO WFAPI-I-SERVICE.

                                             MOVE WFAPI-O-AGENT           TO WFAPI-I-AGENT.

                                             MOVE WFAPI-O-PROCEDURE       TO WFAPI-I-PROCEDURE.

                                             MOVE 1                       TO WFAPI-I-WORK-PRIORITY.

                                             MOVE WFAPI-O-WORKUNIT        TO WFAPI-I-WORKUNIT.

                                             MOVE WFAPI-O-FILE            TO WFAPI-I-FILE.

                                             MOVE "GLNSET1"               TO WFAPI-I-OBJECT-NAME.

                                             MOVE GL20F1-GLN-COMPANY      TO WFAPI-I-KEY-VALUE(1).

                                             MOVE GL20F1-GLN-ACCT-UNIT    TO WFAPI-I-KEY-VALUE(2).

                                             MOVE SPACES                  TO WFAPI-I-WORK-TITLE.

                                             STRING "GL20 Acct Unit "     GL20F1-GLN-ACCT-UNIT

                                                      DELIMITED BY SIZE INTO WFAPI-I-WORK-TITLE.

                                             MOVE "Acct Unit"             TO WFAPI-I-WORK-CATEGORY.

                                   

                                             INITIALIZE WFAPI-OUTPUT.

                                             PERFORM 1000-WF-CREATE-SETUP.

                                   

                                        *----------------------------------------------------------

                                        *Create work unit variables

                                        *----------------------------------------------------------

                                             INITIALIZE WFAPI-INPUT.

                                             MOVE WFAPI-O-WORKUNIT        TO WFAPI-I-WORKUNIT.

                                   

                                             MOVE "Company"               TO WFAPI-I-VARIABLE-NAME(1).

                                             MOVE "S"                     TO WFAPI-I-VARIABLE-TYPE(1).

                                             MOVE GL20F1-GLN-COMPANY      TO WFAPI-I-VARIABLE-VAL (1).

                                   

                                             MOVE "AcctUnit"              TO WFAPI-I-VARIABLE-NAME(2).

                                             MOVE "S"                     TO WFAPI-I-VARIABLE-TYPE(2).

                                             MOVE GL20F1-GLN-ACCT-UNIT    TO WFAPI-I-VARIABLE-VAL (2).

                                   

                                             MOVE "PersonResp"            TO WFAPI-I-VARIABLE-NAME(3).

                                             MOVE "S"                     TO WFAPI-I-VARIABLE-TYPE(3).

                                             MOVE GL20F1-GLN-PERSON-RESP  TO WFAPI-I-VARIABLE-VAL (3).

                                   

                                             MOVE "PostingFlag"           TO WFAPI-I-VARIABLE-NAME(4).

                                             MOVE "S"                     TO WFAPI-I-VARIABLE-TYPE(4).

                                             MOVE GL20F1-GLN-POSTING-FLAG TO WFAPI-I-VARIABLE-VAL (4).

                                   

                                             MOVE "ChartSection"          TO WFAPI-I-VARIABLE-NAME(5).

                                             MOVE "S"                     TO WFAPI-I-VARIABLE-TYPE(5).

                                             MOVE GL20F1-GLN-CHART-SECTION TO WFAPI-I-VARIABLE-VAL(5).

                                   

                                             INITIALIZE WFAPI-OUTPUT.

                                             PERFORM 1000-WF-ADD-VAR-SETUP.

                                   

                                             PERFORM 1000-PROCESS-FLOW.

                                   

                                        *----------------------------------------------------------

                                        *Release Work Unit

                                        *----------------------------------------------------------

                                             PERFORM 1000-WF-RELEASE-SETUP.

                                   

                                         GL20ES1-TRANSACTION-END.

                                        ******************************************************************

                                         GL20ES2-TRANSACTION             SECTION 10.

                                        ******************************************************************

                                         GL20ES2-START.

                                         GL20ES2-TRANSACTION-END.

                                        ******************************************************************

                                         GL20ES3-TRANSACTION             SECTION 10.

                                        ******************************************************************

                                         GL20ES3-START.

                                         GL20ES3-TRANSACTION-END.

                                        ******************************************************************

                                         GL20ES4-TRANSACTION             SECTION 10.

                                        ******************************************************************

                                         GL20ES4-START.

                                         GL20ES4-TRANSACTION-END.

                                        ******************************************************************

                                         GL20ES5-TRANSACTION             SECTION 10.

                                        ******************************************************************

                                         GL20ES5-START.

                                         GL20ES5-TRANSACTION-END.

                                        ******************************************************************

                                         GL20ES6-TRANSACTION             SECTION 10.

                                        ******************************************************************

                                         GL20ES6-START.

                                         GL20ES6-TRANSACTION-END.

                                        ******************************************************************

                                         GL20ES7-TRANSACTION             SECTION 10.

                                        ******************************************************************

                                         GL20ES7-START.

                                         GL20ES7-TRANSACTION-END.

                                        ******************************************************************

                                         GL20ES8-TRANSACTION             SECTION 10.

                                        ******************************************************************

                                         GL20ES8-START.

                                         GL20ES8-TRANSACTION-END.

                                        ******************************************************************

                                         GL20ES9-TRANSACTION             SECTION 10.

                                        ******************************************************************

                                         GL20ES9-START.

                                         GL20ES9-TRANSACTION-END.

                                        ******************************************************************


                                   

                                  2.     Process Flow Administration Tool:

                                  Create a service in the Process Flow Administration Tool.  There are 4 steps to create a service as shown below:

                                  a.       Service Definition

                                  Add a service named ‘GL20E.1_C” and enable it, where “GL20” = program name, “E”= End user exit, “.1” = part of token name, “C”=Change function code.

                                  Product = ERP

                                  Status = Enabled

                                   

                                  b.      Service Variables Definition:

                                  Inquire on the service ‘GL20E.1_C”.  Add variable names, indicating which fields are key fields, the size, and type.  The variable names must be spelled the same as in the COBOL user exit file GL20EPD.  Click the ‘PROCESS’ button to save it.

                                   


                                   

                                  c.       Service Criteria Level Definition:

                                  Inquire on the service ‘GL20E.1_C”.  Then add a blank record in the data area.  Click the ‘PROCESS’ button to save it.

                                   

                                   

                                  d.      Service Process Definition:

                                  Inquire on the service ‘GL20E.1_C”. 

                                  Select the process flow filename.   Note:  Before you can select the process flow filename, you must create the process flow filename in the Process Flow Designer, then upload the file to the server,  as shown in step 3 below.

                                  Select Event Type=”EVT_PFLOW”.

                                   


                                   

                                  3.     Process Flow Designer

                                  a.       Create a process flow and save it with a filename such as, ‘gl20.xml’.

                                  b.      Upload the process flow to the server by selecting PROCESS>>UPLOAD TO SERVER:

                                   

                                   

                                  Task Name:  PFIAdmin

                                  Process Description:  Enter a description of the process flow, such as ‘GL20 change trigger’

                                   

                                   


                                   

                                  Verify a workunit gets created:

                                  Verify that process flow creates a workunit when you make a change to GL20:

                                  a.       Run GL20, inquire on an account unit, and click the “Change” button.

                                  b.      Verify that a workunit was created by going into the Process Flow Administration Tool and click on “Workunit” on the left menu.  The workunit will be either the last one created or one of the last ones created.

                                   

                                   

                                  Ruma Malhotra
                                  Veteran Member
                                  Posts: 412
                                  Veteran Member
                                    Marcy, Thanks,Thanks,Thanks. Thank you so much for this as well as the webex training. Both were wonderful. You are awesome.
                                    Kate Liamero
                                    Veteran Member
                                    Posts: 70
                                    Veteran Member
                                      If anyone is still following the post , I would love to see an example of creating the trigger in Design studio as I am cobol impaired.  my email  kate.liamero@edisonlearning.com

                                      thanks