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

Ordering Group Flow #734

Closed
Muniyappasamy opened this issue Sep 3, 2021 · 2 comments
Closed

Ordering Group Flow #734

Muniyappasamy opened this issue Sep 3, 2021 · 2 comments

Comments

@Muniyappasamy
Copy link

Muniyappasamy commented Sep 3, 2021

My requirement is :
group_0
components:
componentA:
job1:
job2:
job3:
componentB:
job1:
job3:
group_1
components:
componentC:
job1:
job2:
job3:
componentD:
job1:
job3:

group_0 components jobs should be completed before group_1 components, And components that are inside the group should be following sequential manner. So I have tried flow jobs to accomplish but it didn't work in order jobs.

Expected result == >** group_0->componentsA->job1->job2->job3->componentB->job1->job2
group_1->componentsC->job1->job2->job3->componentB->job1->job3

Code I have tried:

` const chain = await flowProducer.add({
name: 'Groups',
data: { groups: 'list of groups' },
queueName: 'Groups',
children: [
{
name: 'Group_0',
data: { components: 'list of componenets of group 0' },
queueName : 'Group_0',
children: [
{
name: 'Group_0',
data: { data: 'data' },
queueName:'Group_0',

                      children: [
                          { name: 'job1', data: { item : "test1" }, queueName: 'componentA' },
                          { name: 'job2', data: { item :"test2" }, queueName: 'componentA' },
                          { name: 'job3', data: { item :"test3" }, queueName: 'componentA' },      ],

                        
            },
            {
                name: 'Group_1', 
                data: { data: 'data' },
                queueName:'Group_1',
 
                 children: [
                     { name: 'job1', data: { item : "test1" }, queueName: 'componentB' },
                     { name: 'job3', data: { item :"test2" }, queueName: 'componentB' },
                 ],

                   
       }
                        
            ],
        
          }],   
    });

`

i have also tried to add {priority:5} in { name: 'job1', data: { item : "test1" }, queueName: 'componentA' },but flowjob doesnt have property like priority.

if the way of approach is wrong then please suggest to me the correct way to do it. I appreciate your help.

Flow job structure is i am looking for.

@manast
Copy link
Contributor

manast commented Sep 4, 2021

As long as you put al the jobs inside one children property as an array they will execute in parallel, if you want it in series you need to put it as a chain of parent->children->children->children, etc.

@roggervalf
Copy link
Collaborator

@Muniyappasamy you could check #735 as reference for this case

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