How to extract reponse of workflow in client
I am invoking workflow through ConductorServer class, is it possible to get output of workflow in the cConductorServer class.?
I also have one more query
- is it possible to invoke task which is part of workflow separately through ConductorServer?
Actually what I need to do is , I have many http tasks in the workflow, for some of the http task I need to get response of it, and alter the response and pass it to as input to another http task. is it possible to achieve this through ConductorServer?
@veveeran Yes we can get the output from an workflow API given by conductor First of all we need to have outputParameters properly defined in our workflow. After workflow created successfully, will get unique workflow Id, using same workflowId we can fetch output. Example URL http://localhost:8080/api/workflow/dfa77699-a3b9-4c20-9339-42d4762d5f34.
For second question, conductor support that, but to understand better please post your workflow structure and will identify a solution.
this is my workflow, I have 2 http task defined. tt1 and tt2. I have a requirement that I have to get the json response from tt1 and modified the response( like appending , formatting, deleting some data from json), and this modified json I have to input to tt2 as body. is it possible
Yes, It is possible.
public TaskResult execute(Task task) {
}
This is the method you should implement and can get the input data as task.getInputData(); . This will be a Java Map object with underlying data as JSON. You can use Jackson JSON libraries to extract, enrich and transform the data
If the response need not be modified - could we skip the execute task implementation and directly use tt1.output.response.body.<key> would it work? Will it work in memory?
@jvemugunta Thanks for the response.
@sudvarma You would still need to implement the execute() method and within this method, you can set the status of the task and also the output of the task.