OpenFn/unicef-cambodia

Update the f1-j2 job to not fail if no services have been passed from the f1-j1 job

daissatou2 opened this issue · 2 comments

Feature Request

Background, context, and business value

The f2-j2 job currently fails if the parent-run retrieves a case and removes its services. See this example run. In the parent-run log, line 29 shows that we removed the service for the case.

The specific request, in as few words as possible

Instead of failing, the f2-j2 job should pass and log "no referrals to send".

state.json

f1-j1 job

{
"configuration": "Primero V2 Cambodia Demo (openfn_cp_user)",
}

f1-j2 job

{
"configuration": "Oscar Staging (api only user)",
"data": "Data will be generated from this job"
}

adaptor

language-http

expression.js

only update job in the V2 folder
https://github.com/OpenFn/unicef-cambodia/blob/master/jobs/V2/f1-j2-casesToOscar.js

@taylordowns2000 you can test locally with "case_id": "a73b0bab-f236-4b48-aab2-2c0700a7daa5", after running the f1-j1 job.

@daissatou2 , filtered out all cases w/o services: c5b751f