Skip to content

Commit

Permalink
update edge conditions (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
mtuchi authored Sep 30, 2024
1 parent b0ae772 commit f604f24
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions openfn-cd92dd57-9a3c-4318-bdcb-f57a386cf811-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,9 @@ workflows:
Upsert-TEIs->Get-Encounters:
source_job: Upsert-TEIs
target_job: Get-Encounters
condition_type: on_job_success
condition_type: js_expression
condition_label: has-patient-uuids
condition_expression: state.patientUuids.length > 0 && !state.errors
enabled: true
Get-Encounters->Get-Options-Map:
source_job: Get-Encounters
Expand All @@ -234,5 +236,7 @@ workflows:
Get-Patients->Mappings:
source_job: Get-Patients
target_job: Mappings
condition_type: on_job_success
condition_type: js_expression
condition_label: has-patients
condition_expression: state.patients.length > 0 && !state.errors
enabled: true
4 changes: 2 additions & 2 deletions workflows/wf2/workflow.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"adaptor": "openmrs",
"configuration": "../tmp/openmrs-creds.json",
"state": {
"lastRunDateTime": "2024-09-16T00:00:00.000Z"
"lastRunDateTime": "2024-09-30T12:00:00.000Z"
},
"expression": "1-get-patients.js",
"next": {
Expand All @@ -27,7 +27,7 @@
"configuration": "../tmp/dhis2-creds.json",
"expression": "2-upsert-teis.js",
"next": {
"get-encounters": "!state.errors"
"get-encounters": "!state.errors && state.patientUuids.length > 0"
}
},
{
Expand Down

0 comments on commit f604f24

Please sign in to comment.