0

A new requirement came up that an item of a certain template should be automatically approved and a different email should be sent out IF the item has previous versions that have been approved in the past.

I have a custom Workflow Action under the Draft Workflow State that does this logic and when appropriate places the item into an AutoApproved Workflow State and the actions under this state will send an email and then place the item into the Approved State.

The problem is the code works but after the path is done of sending the email and setting it to the Approved State, the rest of the Actions under the Draft Workflow State still continue, meaning an email is sent to the appropriate approvers and the item is then put into Awaiting Approval State. Making the auto approve steps moot.

Is there a way to abort the current workflow path and put an item on a different workflow path? Right now it seems I can only send the item on a different workflow path but when it is done with it's journey it picks back up on the original workflow path.

1

Have you considered putting a custom action at the end of your primary workflow that will change the item's workflow after the first approval? This would allow you to maintain a separate workflow definition for these auto-approvals. Here's an idea of the flow:

  1. Item of 'certain template' enters normal workflow for first time.
  2. Item is approved through normal workflow to final state.
  3. Custom action triggers to change item to final state of 'Auto Approve' workflow.
  4. Next author edit triggers new version in 'Auto Approve' workflow.

In this way, you won't have any conflicts with other actions from your normal workflow definition.

| improve this answer | |
  • I have considered it and was going to do something similar as my Plan B if there wasn't an abort. Thanks for the input Jay. – Colema18 Nov 22 '16 at 15:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.