aws / aws-swf-flow-library

AWS Simple Workflow Flow framework library
Apache License 2.0
61 stars 54 forks source link

Flow: Injecting POJOWorkflowDefinitionFactoryFactory in WorkflowWorker #1

Open manikandanrs opened 8 years ago

manikandanrs commented 8 years ago

From @sukrit007 on February 21, 2014 6:1

We should have a way to inject POJOWorkflowDefinitionFactoryFactory in WorkflowWorker so that, we can provide our own extended implementation for the same.

Refer: https://github.com/aws/aws-sdk-java/blob/master/src/main/java/com/amazonaws/services/simpleworkflow/flow/WorkflowWorker.java#L30

Copied from original issue: aws/aws-sdk-java#194

manikandanrs commented 8 years ago

From @breedloj on April 21, 2016 18:10

Hey Sukrit,

I noticed that this issue has been open for a long time with no responses. Is this still a feature you'd like to see in SWF?

manikandanrs commented 8 years ago

From @sukrit007 on April 21, 2016 19:47

@breedloj For using Flow with other languages (node, python), this was an important piece that was missing.

We had submitted a PR couple of years back :

https://github.com/aws/aws-sdk-java/pull/189#issuecomment-133238277

manikandanrs commented 8 years ago

From @ctrimble on May 18, 2016 4:7

Hello @breedloj, I work with @sukrit007 . Any word on this? We have been running a fork for some time and it would be nice to get back on the main SDK. We really just need a way to get all of the type information out of band, so that other languages do not need to understand Java's type system.

Please let me know if there is anything I can do to help move this forward.

roskelleycj commented 7 years ago

I'm very interested in this too. My use case is different than that originally stated here.
Basically, I have an injected defaultLambdaRole at application startup. And currently the only way to provide the defaultLambdaRole is to hard code it in the annotations. OR roll your own worker registration code.

If, however, a WorkflowDefinitionFactoryFactory instance could be provided on creation of the WorkflowWorker, that would likely be sufficient for my needs.

Of course, as I review aws-swf-flow-library there is no such thing as WorkflowWorker anymore. And when I review the WorkflowWorker from aws-java-sdk-swf-libraries 1.11.22 I see that, for the most part, it is just an encapsulation of the GenericWorkflowWorker. And review of GenericWorkflowWorker shows that a WorkflowDefinitionFactoryFactory can be 'set' which is not ideal (prefer immutable), but better than nothing.

So this raises the following questions in my mind: