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

Assign operation on run time after completion a operation #24

Open
dilkhush opened this issue Jan 10, 2017 · 4 comments
Open

Assign operation on run time after completion a operation #24

dilkhush opened this issue Jan 10, 2017 · 4 comments

Comments

@dilkhush
Copy link

Hello I really like your gem but i need to know following points:

  • How we can assign a operation to multiple roles ?
  • Can I assign an Operation dynamically to an user after completing an operation? For Ex. 'a' operation completed after flow should go to the 'b' operation but 'b' should assigned at that time to whom it should assigned ?
  • Can I re-assign the operation to previous step if current operation is failed ?

I am also looking deep into your gem your answer can save some of my time.

Thanks For your reply in advance

@madzhuga
Copy link
Owner

@dilkhush thanks! As for your questions:

  1. How can we assign an operation to multiple roles?
    You can create new MultipleRolesOperation class like this one, and add 'roles' to it. And then just check if template roles list includes user role.
  2. There are few ways to do it. For example, you can update add #build_operation method in Operation Template - here you will have the only argument - operation, created by this operation template. There you can add code to assign this operation to some specific user or any other.
  3. Not sure what do you mean by re-assign operation to the previous step if the current operation is failed. Can you describe this case in more details?

@dilkhush
Copy link
Author

dilkhush commented Jan 11, 2017

@madzhuga Thanks for you quick reply
3 point was If I configure a template with 3 operations like A, B, C. B will be in-progress if A is done and C will be in-progress if A and B both are done.
This the success workflow will be A > B > C.
Now My requirement is if B operation got cancel then A should be again in-progress state again.
One more thing in your demo application its not able to find cancel/skip methods in controller so do i need to create cancel/skip action in my application or I am missing any thing ?
I am getting this error "The action 'cancel' could not be found for RailsWorkflow::OperationsController
"

@madzhuga
Copy link
Owner

@dilkhush sorry for the delay. You can configure operation A so that it will be created when operation B gets canceled. The most proper way is to re-create completed operation rather than re-open it. I will need to add cancel to operations controller in demo app - looks like I forgot to add it. There is API to cancel operation but may be I missed to add controller action.

@dilkhush
Copy link
Author

@madzhuga Thanks for your reply.
I have one scenario where if the current task is cancel/rejected then I need to restart the flow from a point. Example:

  1. A customer give me a requirement
  2. Marketing Team Accept It
  3. Technical Team Give Efforts
  4. Sales Team Add costs
  5. If Customer Reject that
  6. Reassign to sales team and modified cost assign back to customer
  7. Now if customer say 'Yes' then the flow should go to Technical Team Again to thee 3rd point

In that case I was trying to use the same process but its not effecting here. Can you help me out in the scenario.

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