Replies: 2 comments 9 replies
-
|
I think your problem is specific to Synapse, so I'd summon @cdavernas and @JBBianchi here! From the spec pov, the workflow is correct and the runtime (Synapse) should be able to receive a CE to run accordingly. I don't know the details about Synapse implementation, so it would be better to wait for them to chime in. |
Beta Was this translation helpful? Give feedback.
-
|
Hello @Kounavi! Sorry for the delay! Could you please provide the logs of the 500? They might be on both the server and/or runner. Bug aside, you should only have to perform a POST request on whichever url on the server, with content type |
Beta Was this translation helpful? Give feedback.

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello.
I have a workflow based mainly on the documentation's examples:
{ "id": "monitor-patient---react-to-events", "name": "Monitor Patient - React To Events", "version": "0.1.20", "specVersion": "0.8", "events": [ { "name": "High Body Temp Event", "source": "monitoring", "type": "org.monitor.temperature", "correlation": [ { "contextAttributeName": "patientId" } ] }, { "name": "High Blood Pressure Event", "source": "monitoring", "type": "org.monitor.pressure", "correlation": [ { "contextAttributeName": "patientId" } ] }, { "name": "High Respiration Rate Event", "source": "monitoring", "type": "org.monitor.respiration", "correlation": [ { "contextAttributeName": "patientId" } ] } ], "functions": [ { "name": "Invoke Dispatch Nurse Function", "operation": "file:///C:\\Users\\hdiak\\.synapse\\workflows\\nurse.json#employee", "type": "rest" }, { "name": "Invoke Dispatch Pulmonologist Function", "operation": "file:///C:\\Users\\hdiak\\.synapse\\workflows\\pulmonologist.json#employee", "type": "rest" } ], "states": [ { "name": "Monitor Vitals", "type": "event", "onEvents": [ { "actions": [ { "name": "Get nurse", "actionDataFilter": { "toStateData": "${ .employee.name } will be your ${ .employee.role } and they will attend to you shortly" }, "functionRef": { "refName": "Invoke Dispatch Nurse Function", "arguments": { "patiendId": "${ .patiendId }" } } } ], "eventRefs": [ "High Blood Pressure Event", "High Body Temp Event" ], "eventDataFilter": {} }, { "actions": [ { "name": "Get pulmonologist", "actionDataFilter": { "toStateData": "${ .employee.name } will be your ${ .employee.role } and they will attend to you shortly" }, "functionRef": { "refName": "Invoke Dispatch Pulmonologist Function", "arguments": { "patiendId": "${ .patiendId }" } } } ], "eventRefs": [ "High Respiration Rate Event" ], "eventDataFilter": {} } ], "end": true } ] }Here are the function files:
{ "employee": { "name": "Sally Bally", "role": "Pulmonologist" } }{ "employee": { "name": "Sally Hoe", "role": "Nurse" } }This looks like this when I run it:

My problem is that I cannot trigger any (cloud) event so that the workflow progresses.
I try to pass arguments with an employee payload but that does not work.
What am I missing?
P.S.: Should operations using file:/// have a type expression or rest?
P.S.2: I tried also using one of the provided examples with the required json function files using file:/// but that crashes Synapse!
Here is the above example w/ minor modifications as stated:
{ "specversion" : "1.0", "type" : "org.monitor.highBodyTemp", "source" : "monitoringSource", "subject" : "BodyTemperatureReading", "id" : "A234-1234-1234", "time" : "2020-01-05T17:31:00Z", "patientId" : "PID-12345", "data" : { "value": "98.6F" } }{ "id": "patientVitalsWorkflow", "name": "patientVitalsWorkflow", "version": "1.0.1", "specVersion": "0.8", "events": [ { "name": "high-body-temperature", "source": "monitoringSource", "type": "org.monitor.highBodyTemp", "correlation": [ { "contextAttributeName": "patientId" } ] }, { "name": "high-blood-pressure", "source": "monitoringSource", "type": "org.monitor.highBloodPressure", "correlation": [ { "contextAttributeName": "patientId" } ] }, { "name": "high-respiration-rate", "source": "monitoringSource", "type": "org.monitor.highRespirationRate", "correlation": [ { "contextAttributeName": "patientId" } ] } ], "functions": [ { "name": "call-pulmonologist", "operation": "file:///C:/Users/diakosi7344/.synapse/pulmonologist.json#employee", "type": "expression" }, { "name": "send-tylenol-order", "operation": "file:///C:/Users/diakosi7344/.synapse/nurse.json#employee", "type": "expression" }, { "name": "call-nurse", "operation": "file:///C:/Users/diakosi7344/.synapse/nurse.json#employee", "type": "expression" } ], "start": "monitor-vitals", "states": [ { "name": "monitor-vitals", "type": "event", "onEvents": [ { "actions": [ { "name": "send-tylenol-order", "functionRef": { "refName": "send-tylenol-order", "arguments": { "patientid": "${ .patientId }" } } } ], "eventRefs": [ "high-body-temperature" ], "eventDataFilter": {} }, { "actions": [ { "name": "call-nurse", "functionRef": { "refName": "call-nurse", "arguments": { "patientid": "${ .patientId }" } } } ], "eventRefs": [ "high-blood-pressure" ], "eventDataFilter": {} }, { "actions": [ { "name": "call-pulmonologist", "functionRef": { "refName": "call-pulmonologist", "arguments": { "patientid": "${ .patientId }" } } } ], "eventRefs": [ "high-respiration-rate" ], "eventDataFilter": {} } ], "end": { "terminate": true } } ] }This fails with the below error (whether I provide as a json argument a patientId, as instructed, or not before running the workflow):

Again, it seems I am missing something. Any ideas?
Beta Was this translation helpful? Give feedback.
All reactions