PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 8/5/2020 3:19 AM by  B Ledet
Triggering WFWK after a PR140 job run
 8 Replies
Sort:
You are not authorized to post a reply.
Author Messages
Preston Burdwell
Private
Private
Advanced Member
(67 points)
Advanced Member
Posts:33


Send Message:

--
7/13/2020 6:32 PM

    Any suggestions as to how to trigger the IPA after PR140? I could add a WebRun node with PR140 submission, but wanted to see if you all know of other options. No Design Studio, and we are on a Single Tenant, Hybrid instance of S3

    Preston Burdwell Systems Analyst CHRISTUS St. Vincent Med CTR
    David Williams
    Private
    Private
    Veteran Member
    (3343 points)
    Veteran Member
    Posts:1125


    Send Message:

    --
    7/13/2020 7:13 PM
    The easiest way is to trigger IPA to run the job (WebRun) and within the flow to check the job queue to see if the PR140 is complete and then move forward with whatever else you need the flow to do. You could trigger everything from WFWK, even without Design Studio.
    David Williams
    Ragu Raghavan
    Private
    Private
    Veteran Member
    (1294 points)
    Veteran Member
    Posts:450


    Send Message:

    --
    7/13/2020 8:07 PM
    If you are looking for options.....are you able to customize PR140? There are APIs available to trigger flows from 4GL code.
    Preston Burdwell
    Private
    Private
    Advanced Member
    (67 points)
    Advanced Member
    Posts:33


    Send Message:

    --
    7/13/2020 8:24 PM
    Yeah probably not going to get permission to do that. However, you gave me an idea: Could the API to call Processflow be wrapped in a Custom 4GL Program just for this purpose? Like not as a part of any other program? I have created cobol programs before that call shell scripts
    Preston Burdwell Systems Analyst CHRISTUS St. Vincent Med CTR
    Ragu Raghavan
    Private
    Private
    Veteran Member
    (1294 points)
    Veteran Member
    Posts:450


    Send Message:

    --
    7/13/2020 8:54 PM
    I don't see why not. Any 4GL program developed should have access to all the APIs.
    John Henley
    Private
    Private
    Senior Member
    (9887 points)
    Senior Member
    Posts:3313


    Send Message:

    --
    7/14/2020 3:13 PM
    Posted By Ragu Raghavan on 07/13/2020 4:07 PM
    If you are looking for options.....are you able to customize PR140? There are APIs available to trigger flows from 4GL code.

    customizing PR140 is not a good solution, since it is frequently patched and customizations would have to be retrofitted to newer versions.

     

     

     

    Thanks for using the LawsonGuru.com forums!
    John
    John Henley
    Private
    Private
    Senior Member
    (9887 points)
    Senior Member
    Posts:3313


    Send Message:

    --
    7/14/2020 3:21 PM
    Posted By Preston Burdwell on 07/13/2020 4:24 PM
    Could the API to call Processflow be wrapped in a Custom 4GL Program just for this purpose? 

     

    WFWK requires a service to be defined, whereas if you want to just call a flow without the overhead of setting up a service, you have to use a COBOL API like SEND-TO-BCI (BCI is the very old predecessor to PFI then IPA). You could then have a two-step job that runs PR140 and then your custom program to invoke the BCI/PFI/IPA flow. Another option is to use IPA File Channel to monitor a PR140 print folder and trigger a flow when a file is created (include a Wait node in the flow to wait a reasonable amount of time for PR140 to finish). Kinda clunky but i've used that approach and it does the trick....

     

    Thanks for using the LawsonGuru.com forums!
    John
    Preston Burdwell
    Private
    Private
    Advanced Member
    (67 points)
    Advanced Member
    Posts:33


    Send Message:

    --
    7/14/2020 3:48 PM
    Thanks John! At your suggestion, I found the WFBCIPD,WFBCIWS, and WFBCICP in wfsrc/wfpdlib and wfsrc/wfwslib. Invoked by PERFORM 1000-SEND-TO-BCI, like you said. I think I will try researching this more and see where I get. Could use it for other things. Thanks again
    Preston Burdwell Systems Analyst CHRISTUS St. Vincent Med CTR
    B Ledet
    Systems Analyst
    Private
    (9 points)
    Posts:3


    Send Message:

    --
    8/5/2020 3:19 AM

    Its very simple to create a cobol program that starts a processflow, and nothing else.    I often do that to create lookup/email/extract flows and give the users access to running a pflow.

     

    You have to be able to:

    1)write cobol

    2)add processflow service in pflow admin

    3)tie the service to a flow

    4)have access to pflow designer and create the pflowrun and or final flow.

    cobol pd:

     

    000300******************************************************************
           050-EDIT-PARAMETERS           SECTION 10.
               GO TO 050-END.
           050-END.
               EXIT.
    000400******************************************************************
    000500 100-PROGRAM-CONTROL           SECTION 10.
    000600******************************************************************
               DISPLAY "PROGRAM BEGINS".
     
               PERFORM 1000-OPEN-WORKFLOW-DB.
               MOVE "FLOWRUN"      TO CRT-TOKEN.
               MOVE "UPDATE"       TO WFAPI-I-VARIABLE-NAME (1).
               MOVE PRM-INPUTPARAM TO WFAPI-I-VARIABLE-VAL (1).
               MOVE "EMAILTO"      TO WFAPI-I-VARIABLE-NAME (2).
               MOVE PRM-INPUTEMAIL TO WFAPI-I-VARIABLE-VAL (2).
               MOVE "FLOWNAME"     TO WFAPI-I-VARIABLE-NAME(3).
               MOVE PRM-INPUTFLOW  TO WFAPI-I-VARIABLE-VAL (3).
     
               PERFORM 1000-PROCESS-FLOW.
               DISPLAY "PFLOW RETURN MSG -" WFAPI-O-RET-MSG.
     
    001500     DISPLAY "PROGRAM ENDS".
               GO TO 900-DONE.
    01700 100-END.
               EXIT.
          ***************************************************************
           900-DONE.
               EXIT.

     

    This batch program starts a service called 'flowrun'.   Service must be defined with an underscore after the name -       flowrun_

    Service must also be tied to a processflow, also called flowrun.

    It passes flowrun 3 parameters.   Update flag, email address to send results to,  pflow number to run.  Options are 1,2,3

    Service flowrun starts up.   It receives the pflow number to run.   if 1 it async runs flow1,   if 2 it async runs flow 2.   if 3 it async runs flow 3.

    If you choose to,  flowrun can just singly run the final flow you need without the multiple choice option.   I just wanted an easy way to run multiple flows from a single program.


    So you don't touch PR140, you just ADD another batch program in the job stream.

     

    You can also create an end user exit for PR140 that will accomplish the same function. 

    Questions welcome.

     

     

     

    You are not authorized to post a reply.