Process Flow Looping

 3 Replies
 0 Subscribed to this topic
 52 Subscribed to this forum
Sort:
Author
Messages
Chad Dirst
Advanced Member
Posts: 42
Advanced Member
    I have a process flow that reads all GLNAMES records.

    For each GLNAMES record it determines if an Attribute is associated with it from the AUMXVALUE file.  The attribute contains an RM ID.  Once I have the RM ID the flow performs an RM query to obtain the employee number.  I then utilize the employee number to query the EMPLOYEE file.  All of this works fine except when an RM ID does not have an employee number defined in the LAWSON_EMPLOYEE service. 

    When an RM ID does not find an employee number it loops through ALL of the EMPLOYEE records where COMPANY=X and EMPLOYEE=.  This dramatically slows down the query and is causing issues.  I tried putting in a branch node to check the record count (xxxxx_RECORD_COUNT!=0), however, this was not successful. 

    Any ideas?
    Thanks in advance. 
    Chad
    David Williams
    Veteran Member
    Posts: 1127
    Veteran Member
      Just to make sure, are you verifying that your Attribute returns a value before you run the ResourceQuery?
      David Williams
      JudeBac
      Veteran Member
      Posts: 129
      Veteran Member
        Have you considered using the SQL Query instead?
        Chad Dirst
        Advanced Member
        Posts: 42
        Advanced Member
          Thanks for your reply David.

          I changed my check to be xxxxx_EMPLOYEE != "" and that resolved my issue.