Issue 1:
We are not able to implement condition branching using strings. The given condition is not working.
"${T.pathParams}.id=='pet'"
{ "name": "condition string", "type": "flogo:app", "version": "0.0.1", "description": "", "triggers": [ { "name": "Receive HTTP Message", "ref": "github.com/rameshpolishetti/triggerhttpnew", "description": "Simple REST Trigger", "settings": { "port": "9096" }, "id": "receive_http_message", "handlers": [ { "settings": { "method": "GET", "path": "/test/:type", "autoIdReply": "true", "useReplyHandler": "true", "Condition": null }, "actionId": "check" } ] } ], "actions": [ { "name": "check", "data": { "flow": { "type": 1, "attributes": [], "rootTask": { "id": 1, "type": 1, "tasks": [ { "id": 2, "name": "Log Message", "description": "Simple Log Activity", "type": 1, "activityType": "tibco-log", "activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/log", "attributes": [ { "name": "message", "value": "", "required": false, "type": "string" }, { "name": "flowInfo", "value": "true", "required": false, "type": "boolean" }, { "name": "addToFlow", "value": "true", "required": false, "type": "boolean" } ], "inputMappings": [ { "type": 1, "value": "{T.pathParams}.type", "mapTo": "message" } ] }, { "id": 3, "name": "Log Message (2)", "description": "Simple Log Activity", "type": 1, "activityType": "tibco-log", "activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/log", "attributes": [ { "name": "message", "value": "pet", "required": false, "type": "string" }, { "name": "flowInfo", "value": "true", "required": false, "type": "boolean" }, { "name": "addToFlow", "value": "true", "required": false, "type": "boolean" } ] }, { "id": 4, "name": "Log Message (3)", "description": "Simple Log Activity", "type": 1, "activityType": "tibco-log", "activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/log", "attributes": [ { "name": "message", "value": "weather", "required": false, "type": "string" }, { "name": "flowInfo", "value": "true", "required": false, "type": "boolean" }, { "name": "addToFlow", "value": "true", "required": false, "type": "boolean" } ] } ], "links": [ { "id": 1, "from": 2, "to": 3, "type": 1, "value": "${T.pathParams}.type=='pet'" }, { "id": 2, "from": 2, "to": 4, "type": 1, "value": "${T.pathParams}.type=='weather'" } ], "attributes": [] } } }, "id": "check", "ref": "github.com/TIBCOSoftware/flogo-contrib/action/flow" } ] }
Issue 2:
Steps to produce:
- Create the flogo app using the attached flogo.json. Command: flogo create -f flogo.json condition
- Go to condition folder and build. Command:flogo build
- Go to bin folder and run the condition app.
Run the App with the two Urls:
For first branch: localhost:9096/test/10
For second branch: localhost:9096/test/43
The url for the first branch also redirects to the second branch.
{ "name": "flogo", "type": "flogo:app", "version": "0.0.1", "description": "", "triggers": [ { "name": "Receive HTTP Message", "ref": "github.com/rameshpolishetti/triggerhttpnew", "description": "Simple REST Trigger", "settings": { "port": "9096" }, "id": "receive_http_message", "handlers": [ { "settings": { "method": "GET", "path": "/test/:id", "autoIdReply": "true", "useReplyHandler": "true", "Condition": null }, "actionId": "condition" } ] } ], "actions": [ { "name": "condition", "data": { "flow": { "type": 1, "attributes": [], "rootTask": { "id": 1, "type": 1, "tasks": [ { "id": 2, "name": "Log Message", "description": "Simple Log Activity", "type": 1, "activityType": "tibco-log", "activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/log", "attributes": [ { "name": "message", "value": "", "required": false, "type": "string" }, { "name": "flowInfo", "value": "true", "required": false, "type": "boolean" }, { "name": "addToFlow", "value": "true", "required": false, "type": "boolean" } ], "inputMappings": [ { "type": 1, "value": "{T.pathParams}.id", "mapTo": "message" } ] }, { "id": 3, "name": "Log Message (2)", "description": "Simple Log Activity", "type": 1, "activityType": "tibco-log", "activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/log", "attributes": [ { "name": "message", "value": "pet", "required": false, "type": "string" }, { "name": "flowInfo", "value": "true", "required": false, "type": "boolean" }, { "name": "addToFlow", "value": "true", "required": false, "type": "boolean" } ] }, { "id": 4, "name": "Log Message (3)", "description": "Simple Log Activity", "type": 1, "activityType": "tibco-log", "activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/log", "attributes": [ { "name": "message", "value": "weather", "required": false, "type": "string" }, { "name": "flowInfo", "value": "true", "required": false, "type": "boolean" }, { "name": "addToFlow", "value": "true", "required": false, "type": "boolean" } ] }, { "id": 5, "name": "Invoke REST Service", "description": "Simple REST Activity", "type": 1, "activityType": "tibco-rest", "activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/rest", "attributes": [ { "name": "method", "value": "GET", "required": true, "type": "string" }, { "name": "uri", "value": "http://api.openweathermap.org/data/2.5/weather?APPID=6231d08ce5469ffd47f0cd92f4b9af3e&q=vizag", "required": true, "type": "string" }, { "name": "pathParams", "value": null, "required": false, "type": "params" }, { "name": "queryParams", "value": null, "required": false, "type": "params" }, { "name": "content", "value": null, "required": false, "type": "any" } ] }, { "id": 6, "name": "Log Message (4)", "description": "Simple Log Activity", "type": 1, "activityType": "tibco-log", "activityRef": "github.com/TIBCOSoftware/flogo-contrib/activity/log", "attributes": [ { "name": "message", "value": "", "required": false, "type": "string" }, { "name": "flowInfo", "value": "true", "required": false, "type": "boolean" }, { "name": "addToFlow", "value": "true", "required": false, "type": "boolean" } ], "inputMappings": [ { "type": 1, "value": "{A5.result}", "mapTo": "message" } ] } ], "links": [ { "id": 1, "from": 2, "to": 3, "type": 1, "value": "${T.pathParams}.id<15" }, { "id": 2, "from": 2, "to": 4, "type": 1, "value": "${T.pathParams}.id>15" }, { "id": 3, "from": 4, "to": 5, "type": 0 }, { "id": 4, "from": 5, "to": 6, "type": 0 } ], "attributes": [] } } }, "id": "condition", "ref": "github.com/TIBCOSoftware/flogo-contrib/action/flow" } ] }