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

"One to Many", "Many to One" and "Many to Many" work units #27

Open
rmcdouga opened this issue Mar 22, 2023 · 2 comments
Open

"One to Many", "Many to One" and "Many to Many" work units #27

rmcdouga opened this issue Mar 22, 2023 · 2 comments

Comments

@rmcdouga
Copy link

I recently implemented something very similar to this (I wish I had learned of this project a couple of months sooner).

In my version the "Work" interface was subclassed into several types: OneToOne, OneToMany, ManyToOne and ManyToMany. Each one had a slightly different signature. OneToOne was like your Work interface, takes in one WorkContext and produces one WorkContext, but OneToMany took in one WorkContext and produces a Stream of WorkContexts. Likewise, the ManyToOne takes in a Stream and produces a single WorkContext and ManyToMany takes in a Stream and produces a Stream of WorkContexts.

The reason I did it this way was to create reusable Work implementations that I could mix together in a variety of ways. For example, one Work implementation called "WriteToFolderWork" could take in one WorkContext that contains an XML and write it to a folder. This is a OneToOne Work implementation. Another Work implementation (say, called "SplitXmlWork") could split a single XML into several pieces. This would be a OneToMany Work implementation. The workflow framework too care of converting a "Many" output from one step to a repeating set of "One" inputs to another step and vice-versa.

Have you thought about something similar for easy-flows and rejected it? What are your thoughts?

I am contemplating the idea of forking your project, enhancing it and then replacing my implementation with a modified version of yours. I'd like to gauge your interest in these changes to see if I could submit a PR after I am done. Also, you may have another approach in mind that I haven't considered which is already handled by the current codebase.

Any feedback would be appreciated.

@julienlau
Copy link

Unfortunately it seems to me that the project is not active anymore...
I did not pickup a solution yet, I am also looking into jobrunr but a lot of features are missing in the free edition like dependencies between tasks.
Did you fork the project in the end ?

@rmcdouga
Copy link
Author

rmcdouga commented Sep 6, 2023

I did fork it but I have not done much with it. I did start some changes, but I think maybe they are just on a local branch at this point. I got distracted by other things and have not come back to it. I still think it is a reasonable starting point but the code is a little simplistic (IMO) in spots. It casts Object where generic could perhaps be used instead. Still, it is simple and easy to understand. I just haven't had the need to invest time in it yet.

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

2 participants