logan and production prodline COBOL program

 2 Replies
 0 Subscribed to this topic
 17 Subscribed to this forum
Sort:
Author
Messages
kim
Basic Member
Posts: 15
Basic Member

    Hang on to your hats because this will be fun.



    Scenario:

    Individual Action work units (WFWORKUNIT) are created via ProcessFlow trigger on PA52.x, both Portal/LID and MSS.



    Requirement:

    Now here is the fun part!  Again I am only talking about work units that are created from PA52.x.

    I have been tasked with building an online form that allows the user to review the WFWORKUNIT but, here’s the fun part, I have to be able to apply HR Security to the work unit. Meaning I have to look at what employee the WFWORKUNIT is created for and run that thru the 700-HR-EMP-SECURITY API to confirm that the user has access to the WFWORKUNIT employee.


    What I would like to do:

    Retrieve all WFWORKUNIT.OBJECT-NAME records for the PCTSET1

    Unstring the WFWORKUNIT.KEY-STRING to retrieve the PCTSET1 key

    Check 700-HR-EMP-SECURITY using the employee retrieved from the WFWORKUNIT.KEY-STRING

    Sample Code would be:

    -- retrieve all workunits

    MOVE  “PCTSET1” TO DB-OBJECT-NAME.

    MOVE WFWSET2-OBJECT-NAME TO WS-DB-BEG-RNG.

    PERFORM 850-FIND-BEGRNG-WFWSET2.

    IF (WFWORKUNIT-NOTFOUND)

       GO TO NEXT-WFWORKUNIT

    END-IF.




    --- parse the workunit key

    (unstring the key)




    --- retrieve the employee

    MOVE WFW-PCT-COMPANY TO DB-COMPANY.

    MOVE WFW-PCT-EMPLOYEE TO DB-EMPLOYEE.

    PERFORM 840-FIND-EMPSET1.



    IF (EMPLOYEE-NOTFOUND)

       GO TO NEXT-WFWORKUNIT

    END-IF.




    --- check HR Security

    MOVE  WFW-PCT-COMPANY TO CRT-COMPANY.

    MOVE EMP-PROCESS-LEVEL TO   CRT-PROCESS-LEVEL.

    PERFORM 700-HR-EMP-SECURITY.

    IF (HRWS-EMP-SECURED)

       GO TO NEXT-WFWORKUNIT

    END-IF.




     

    I have looked and looked and looked for additional APIs within the WFAPI that will allow me to do the standard find APIs but no such luck.  The issue is I cannot talk to both databases within a single program. Does anyone have any tricks? I would rather not create two forms where the logan form would drop a workfile that includes all the workunits and the production form will pick up the workfile and do the check. Seems like a lot of extra work for such a simple simple check.

    Thanks for your thoughts and assistance.

     

    Release information:

    Apps: 8.1.0 MSP6

    Env: 9.0.0 ESP4

    currently using laua for security not ldap

     

    kim valdez

    Providence Health & Services

    ProvConnect/Development Services

    Lawson ERP Developer

    3601 SW Murray Blvd, Suite 100

    Beaverton, OR 97005







    Jay Riddle
    Veteran Member
    Posts: 191
    Veteran Member
      You can create a view in the main production line that links into the logan data.  Here is what we did for Requisitions.  It would be somewhat simular for PA52.  Once you have the company and emloyee number in the view the security should get pulled in for you if you are using LAUA.  If your using the new security than you should be able to just create a security rule.

      CREATE

      VIEW [dbo].[XXREQLOC] AS

      (

      SELECT

      rqh.COMPANY

      ,

      rqh.REQ_NUMBER

      ,

      rqh.REQUESTER

      ,

      CAST(t.TASK AS CHAR(20)) AS TASK

      ,

      rqst.NAME

      ,

      rqh.REQ_LOCATION

      ,

      CAST(CASE WHEN t.TASK = 'CEO' THEN 'CEO'

      WHEN t.TASK = 'Materials Mgt Appr' THEN 'Materials Mgt Appr'

      WHEN ucat.WF_RM_ID IS NOT NULL THEN ucat.WF_RM_IDELSE 'Contact Help Desk'

      END AS CHAR(20)) AS APPROVER_ID

      ,

      CAST(LEFT(CASE WHEN t.TASK = 'CEO' THEN 'CEO'

      WHEN t.TASK = 'Materials Mgt Appr' THEN 'Materials Mgt Appr'

      WHEN emp.NICK_NAME IS NOT NULL THEN LTRIM(RTRIM(emp.NICK_NAME)) + ' ' + LTRIM(RTRIM(emp.LAST_NAME))

      WHEN ucat.WF_RM_ID IS NOT NULL THEN ucat.WF_RM_IDELSE 'Error: Routing Changes'

      END + ' ',30) AS CHAR(30)) AS DESCRIPTION

      FROM

      logan..WFWORKUNIT wu, REQHEADER rqh, REQUESTER rqst, logan..WFWUQUEUE que LEFT OUTER JOIN logan..WFQUETASK t ON que.WORKUNIT = t.WORKUNIT AND que.PROCESS_ID = t.PROCESS_ID AND que.ACTIVITY_ID = t.ACTIVITY_IDLEFT OUTER JOIN logan..WFUSERCAT ucat ON t.TASK = ucat.TASK AND que.CATEGORY_VALUE = ucat.WORK_CAT_VALUELEFT OUTER JOIN logan..WEBUSER web ON ucat.WF_RM_ID = web.WEB_USERLEFT OUTER JOIN EMPLOYEE empON web.COMPANY = emp.COMPANY AND web.EMPLOYEE = emp.EMPLOYEE

      WHERE

      LEFT(wu.KEY_STRING,4) = rqh.COMPANY

      AND

      SUBSTRING(wu.KEY_STRING,5,7) = rqh.REQ_NUMBER

      AND

      wu.OBJECT_NAME = 'RQHSET1'

      AND

      wu.WORKUNIT = que.WORKUNIT

      AND

      que.DISP_STATUS = 1

      AND

      rqh.REQUESTER = rqst.REQUESTER

      )

      Sam Simpson
      Veteran Member
      Posts: 239
      Veteran Member
        We have been doing this type of things all the time. Here's my suggestion.
        1. Create a new table in the application database which is a complete copy of WFWORKUNIT table in the logan db.
        2. Create a processflow (scheduled everyday) to get pa52 workunits only and update your
        new table. This flow will either add, change or delete records in your new table.

        In addition to your requirements, I would also suggest creating some metrics table so you can use them in your query. Such metrics should indicate what happen to the personnel action and where it is located in the business process.