Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question : Client proxies for Multiple activities interface inside a Workflow #20

Open
sukrit007 opened this issue Jan 29, 2014 · 2 comments

Comments

@sukrit007
Copy link

I am trying to simplify my java flow workflow by using groovy and glisten .

In my case , I have multiple activities interfaces, implementation of each resides in a different sub-system,. The workflow implementation uses proxy client for each implementation and orchestrates the workflows.

e.g.

public class StartDeploymentWorkflowImpl implements StartDeploymentWorkflow {

    LockingActivitiesClient lockingActivitiesClient = new LockingActivitiesClientImpl();
    ImageActivitiesClient imageActivitiesClient = new ImageActivitiesClientImpl();
    DeployActivitiesClient deployActivitiesClient = new DeployActivitiesClientImpl();
......
.......

I have been trying to model this using Glisten using delegate WorkflowOperations. However, it can only take one type of activity.

I can create multiple objects for WorkflowOperations viz: WorkflowOperations, WorkflowOperations and so on. However, the different operations like waitFor would now would have to be called on individual objects.

Not sure if there is an easy way to model it using glisten.

@claymccoy
Copy link
Contributor

Yes, this is an issue I have been thinking about, but we haven't had to deal with directly yet as our activities and workflows match up one to one currently.
The multiple WorkflowOperations might work, but will probably have more problems with unit testing using the local implementation. I should really separate the activites out of the WorkflowOperations or make it a Map. Something to allow for multiple Activities.
One simple work around that should work is creating a new interface that extends all three current interfaces. Then you will need an implementation that delegates to the three impls. Using Groovy this can be done in a way that is quite minimal code. The nice thing about activity vs workflow impls is that activity impls are regular POJOs (or POGOs) with lifecycles that are managed by you.

@vernisan
Copy link

It would be a nice feature. Anyway, we followed your advice and created extending interfaces.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants