cancel
Showing results for 
Search instead for 
Did you mean: 

CPI: Looping Process Call Issue

babruvahana
Contributor
0 Kudos

Hi Experts,

I am getting the below enriched message for each user ID after querying EmpTime from the SF system for yesterdayDate(02/07/2021).

Enriched Message:

  <EmpJob>
    <EmpJob>
      <userId>1000001</userId>
      <EmployeeTime>
        <externalCode>100000120210611</externalCode>
        <endDate>2021-07-01T00:00:00.000</endDate>
        <userId>1000001</userId>
        <startDate>2021-07-01T00:00:00.000</startDate>
      </EmployeeTime>
    </EmpJob>
  </EmpJob>
  <EmpJob>
    <EmpJob>
      <userId>1000002</userId>
    </EmpJob>
  </EmpJob>
  <EmpJob>
    <EmpJob>
      <userId>1000003</userId>
    </EmpJob>
  </EmpJob>
  <EmpJob>

If EmployeeTime is node not there, I have to query that userID again(1000002 and 1000003 from the above message) for a day before yestrdayDate(01/07/2021). I have to do this until unless userID has EmployeeTime.

I have written groovy which replaces the yestrdayDate to previousDate after every loop. I can collect lastDate and userID which has the EmployeeTime from this groovy for further processing of mapping.

But, looping is not working coz of the condition I maintained. I have tried the below values in looping process call to check if EmployeeTime exists. But, no luck.

/messages/EmpJob/EmpJob[not(EmployeeTime)]
/messages/EmpJob[EmpJob[not(EmployeeTime)]]

Any leads will be really helpful.

Regards, Pavan

Accepted Solutions (0)

Answers (0)