I can’t seem to find examples of where a workflow has a constructor with parameters in Java. I have a case where I need to pass in some parameters. There are two places:
Where you register the workflow
Where you create the workflow via newWorkflowStub
In both cases how would you pass in the constructor parameters.
In my workflow, I have an activity that will publish some data to a datastore. However, when testing in dev environment (local), I want to disable this activity since it is only need to staging/prod. In this case, I want to be able to pass in a configuration or some sort of flag that will tell what environment it is.
You either register a different activity implementation with the worker based on config or let the activity implementation behave differently based on config. Passing config to an activity implementation object is fully supported.