ProcessFlow COBOL Trigger - No Work Unit

 2 Replies
 0 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
JM
Basic Member
Posts: 6
Basic Member
    Hello - I added basic custom trigger in COBOL (RQ04) and all needed set up in ProcessFLow, but have no work units created. The instructions from ProcesFlow Admin or Developers Guide (9.0.1) don't seem to work for me by some reason. My code is below, can someone advise?

               PERFORM 500-MOVE-DATA
               THRU    500-END.

    002680     PERFORM 820-STORE-REQUESTER.

    MYCODE     PERFORM 1000-OPEN-WORKFLOW-DB.
    MYCODE       MOVE "RQ04AddRequester" TO WFAPI-I-SERVICE.
    MYCODE       MOVE RQ04F1-REQ-COMPANY TO WFAPI-CRITERION-1.

    MYCODE       MOVE "REQ_COMPANY"        TO WFAPI-I-VARIABLE-NAME (1).
    MYCODE       MOVE RQ04F1-REQ-COMPANY   TO WFAPI-I-VARIABLE-VAL (1).
    MYCODE       MOVE "REQ_REQUESTER"      TO WFAPI-I-VARIABLE-NAME (2).
    MYCODE       MOVE RQ04F1-REQ-REQUESTER TO WFAPI-I-VARIABLE-VAL (2).
    MYCODE     PERFORM 1000-PROCESS-FLOW.



    Robert Spurr
    Veteran Member
    Posts: 130
    Veteran Member
      I pulled this from an very old document I had on creating triggers. (Old enough that this trigger now exists in delivered code) This might be of some value as the process hasn't changed much. (Although it has been a long time and these steps may no longer be valid) Be sure to build your service in BPM. - Hope this helps

      Build a directory
      1 An “usrobj” must exist within the product line in which the trigger will reside. The creation must be performed once per product line (Note: Only product lines using triggers must have this directory). This directory is the destination directory for compiled triggers within that product line.
      2 Navigate to the root directory of the product line. (cd $LAWDIR/{product line}). In this specific case the command would look as follows: (cd $LAWDIR/prodapps)
      3 Create directory. (mkdir usrobj)
      Create Trigger
      1 Two null files must be created.
      2 Navigate to the root directory of the specific system code (cd $LAWDIR/{product line}/{SysCode}src). In this specific case the command would look as follows: (cd $LAWDIR/prodapps/masrc)
      3 Create two files by using the “touch” command. In this specific case the commands would look as follows: (touch MA66EPD) and (touch MA66EWS). A trigger must have both a “PD and WS”. The file is also governed by specific rules. (MA66 is the source program, “Beginning, Middle, or End” indicates how the trigger will react and PD and WS are standard references to file type.
      4 MA66EPD – Using an editor open the file.
      5 MA66 consists of nine forms (MA66.1-MA66.9). When a trigger is being coded all nine forms must be account for even if the trigger has no bearing on that specific form. Enter what is below and save. (“S1-9” represent MA66.1-9)

      ********************************************
      MA66ES1-TRANSACTION SECTION.
      ********************************************
      MA66S1-START.
      MA66ES1-TRANSACTION-END.
      ********************************************
      MA66ES2-TRANSACTION SECTION.
      ********************************************
      MA66S2-START.
      MA66ES2-TRANSACTION-END.
      ********************************************
      MA66ES3-TRANSACTION SECTION.
      ********************************************
      MA66S3-START.
      MA66ES3-TRANSACTION-END.
      ********************************************
      MA66ES4-TRANSACTION SECTION.
      ********************************************
      MA66S4-START.
      MA66ES4-TRANSACTION-END.
      ********************************************
      MA66ES5-TRANSACTION SECTION.
      ********************************************
      MA66S5-START.
      MA66ES5-TRANSACTION-END.
      ********************************************
      MA66ES6-TRANSACTION SECTION.
      ********************************************
      MA66S6-START.
      MA66ES6-TRANSACTION-END.
      ********************************************
      MA66ES7-TRANSACTION SECTION.
      ********************************************
      MA66S7-START.
      MA66ES7-TRANSACTION-END.
      ********************************************
      MA66ES8-TRANSACTION SECTION.
      ********************************************
      MA66S8-START.
      MA66ES8-TRANSACTION-END.
      ********************************************
      MA66ES9-TRANSACTION SECTION.
      ********************************************
      MA66S9-START.
      MA66ES9-TRANSACTION-END.

      Since buyer message are released from MA66.3, insert the following code (in bold) than save.
      ********************************************
      MA66ES3-TRANSACTION SECTION.
      ********************************************
      MA66S3-START.

      PERFORM 1000-OPEN-WORKFLOW-DB.

      MOVE MA66F3-FC TO WFAPI-CRITERION-1.
      MOVE MA66F3-MAG-COMPANY TO WFAPI-CRITERION-2.

      MOVE "FC" TO WFAPI-I-VARIABLE-NAME (1).
      MOVE MA66F3-FC TO WFAPI-I-VARIABLE-VAL (1).
      MOVE MA66F3-FC TO WFAPI-I-VARIABLE-VAL (1).
      MOVE "COMPANY" TO WFAPI-I-VARIABLE-NAME (2).
      MOVE MA66F3-MAG-COMPANY TO WFAPI-I-VARIABLE-VAL (2).
      MOVE "VENDOR" TO WFAPI-I-VARIABLE-NAME (3).
      MOVE MA66F3-MAG-VENDOR TO WFAPI-I-VARIABLE-VAL (3).
      MOVE "INVOICE" TO WFAPI-I-VARIABLE-NAME (4).
      MOVE MA66F3-MAG-INVOICE TO WFAPI-I-VARIABLE-VAL (4).
      MOVE “ACTION” TO WFAPI-I-VARIABLE-NAME (5).
      MOVE MA66F3-MAG-PO-COST-FLAG TO WFAPI-I-VARIABLE-VAL (5).
      MOVE “ITEM” TO WFAPI-I-VARIABLE-NAME (6).
      MOVE MA66F3-MAG-INV-LINE-ITEM TO WFAPI-I-VARIABLE-VAL (6).
      MOVE “UOM” TO WFAPI-I-VARIABLE-NAME (7).
      MOVE MA66F3-MAG-INV-UOM TO WFAPI-I-VARIABLE-VAL (7).

      PERFORM 1000-PROCESS-FLOW.

      MA66ES3-TRANSACTION-END.

      Compile the trigger using the following command “qcompile” (qcompile –u {product line} {SysCode} {program}). In this specific case the command would look as follows: (qcompile –u prodapps ma ma66e). If successful, a “.gnt” will reside in the “usrobj” directory. An unsuccessful compile will result in a “.err” file to be generated in the SysCode (masrc) directory. Review file using lashow, fix issues and recompile. Repeat until the compile is successful.
      MA66EWS – Will not use but must exist for compile to be successful.
      JM
      Basic Member
      Posts: 6
      Basic Member
        Thank you Robert. Although I work with regular online (RQ04) not a user exit, but the custom code is pretty much the same for basic trigger. And this is what I do (if you saw my code in the first posting), still doesn't create a work unit.