I am looking at the Java samples for supporting the serveless workflow DSL. I have couple of questions.
I see that there is support for various states like Operation, Event, Switch etc. But I couldn’t find the support or examples for Callback state. Is there plan to add it to the sample code?
I am looking to get results after every state. Is that possible?
Hi, sure we can add sample for Callback state, please add feature request here.
It would be just invocation of activity to invoke a service and then Workflow.await(condition), or Workflow.await(duration, condition) after to wait for completion signal(s).
For the second question, not sure this is needed, can you give use case for it please?
Typically you would maintain state as your temporal workflow state during execution and update it based on activity results, signal payloads, etc.
Thank you @tihomir . I am able to get callback working. It executes the activity and then await for the signal. I used run id as correlation property to identify the existing workflow instance when it receives signal.
For the 2nd question, let me revisit and ask you specific question if any. I think I am almost getting this right now.
Also the swtemporal repo, is there any license for using or extending this repo?
Hi @tihomir I have another question related to callback implementation. I want to return data returned by function called and then await. So the flow I am trying to build is
The workflow is advanced to the callback state.
The function “f1” is called. It returns value "r1. "
Return “r1” to the UI (this value UI can use for human decisions)
Await(signal1)
UI submits data to backend
Backend sends signal signal1 to workflow instance
Execution continues
My confusion is around 3 and 4 how to archive that. The help would be appreciated.