workflow with http task not working
Hi i am trying to create a task for http request. i followed the however its done in kitchen sink example. i am getting error when i trying to start the workflow. `
{ "name": "test_workflow", "description": "test http workflow", "version": 1, "tasks": [
{
"name": "test_task1",
"taskReferenceName": "test_task1",
"inputParameters": {
"http_request": {
"uri": "http://localhost:8080/",
"method": "GET"
}
},
"type": "HTTP"
}
],
"schemaVersion": 1 } `
`[{ "name": "test_task1", "description": "test_task1", "retryCount": 0, "timeoutSeconds": 0, "timeoutPolicy": "TIME_OUT_WF", "retryLogic": "FIXED", "retryDelaySeconds": 2000, "responseTimeoutSeconds": 2000 }]
` above are my workflow json and task json respectively. Error getting is
{code=INTERNAL_ERROR, message=INTERNAL_ERROR - Invalid input expression for http_request, paramPathComponents.size=1, expression={uri=http://localhost:8080/, method=GET}, instance=DAAMO3}

My two cents on this:
I am also facing difficulty in getting HTTPTask working, raised issue #141
I am also getting the error message reported by you.
On closer inspection of the stacktrace and code, this msg is coming from deprecated method DeciderService.getTaskInputV1 which checks the value of the parameter for 2 dots. In your case its localhost:8080 with no dot, so its getting treated as 1 param. Hence you see paramPathComponents.size=1 in your error message.
I tried an URI which contains an IPv4. Since, it contains 3 dots I got paramPathComponents.size=4 in the error message.
I tried my luck with an URI with 2 dots like http://www.thomas-bayer.com/sqlrest/CUSTOMER/18/. Phew!! it worked!!
The comment of the DeciderService.getTaskInputV1 says
//Workflow schema version 1 is deprecated and new workflows should be using version 2
I explicitly set the schemaVersion of the Workflow definition to 2. This time it worked again with a URL with an IP i.e 3 dots.
So, for you the single line solution is : Change the schemaVersion in the JSON to 2 from 1. Kitchensink also has schemaVersion as 2.
Proper documentation would have helped :-) .
Next week I'll try with other URIs. Believe all will work with schemaVersion as 2.
@sameekb thank you. it worked.