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

Add sub-workflow support #7

Open
samuell opened this issue Aug 31, 2015 · 4 comments
Open

Add sub-workflow support #7

samuell opened this issue Aug 31, 2015 · 4 comments

Comments

@samuell
Copy link
Member

samuell commented Aug 31, 2015

Allow chaining WorkflowTask tasks together. Might not be fully possible yet.

@proycon
Copy link

proycon commented May 14, 2016

I'm looking for similar functionality and just stumbled upon the fact that this is not possible currently.

@samuell
Copy link
Member Author

samuell commented May 17, 2016

@proycon Thanks for letting us know! We should look at this soonish ... should not need too big a change.

@proycon
Copy link

proycon commented May 20, 2016

Thanks, looking forward to it!

@ddd-bbb
Copy link

ddd-bbb commented Nov 16, 2017

My solution to this (and #18) was to create a new SubWorkflowTask class that caches its workflow definition on initialization and so lets you specify your own out ports in case you want them available to other workflows:

class SubWorkflowTask(sciluigi.WorkflowTask):
    def __init__(self, *args, **kwargs):
        super(sciluigi.WorkflowTask, self).__init__(*args,**kwargs)
        self.cached_workflow = self.workflow_logic()

    def workflow(self):
        return self.cached_workflow

    def workflow_logic(self):
        """
        Contains all the logic that would normall go in self.workflow, but you
        can also define outputs (self.out_*) that will be visible elsewhere
        
        for example:

        my_task = self.new_task("do_something", DoSomething)
        self.out_foo = my_task.out_foo

        return my_task
        """
        raise Exception("workflow_logic not implemented")

Curious to hear what you think of this @samuell, not sure what issues I may be ignoring.

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

No branches or pull requests

3 participants