This discussion is archived
4 Replies Latest reply: Nov 15, 2012 6:56 AM by JTyson RSS

Is it possible to skip a workflow step based on metadata?

JTyson Newbie
Currently Being Moderated
I'm looking to skip a step in a workflow based on metadata, using the wizard thing for jumps doesn't seem to work at all. Hoping someone has a solution or method to pull this off.
  • 1. Re: Is it possible to skip a workflow step based on metadata?
    970471 Explorer
    Currently Being Moderated
    In the entry event for the step, you can check if the metadata field is set to a specific value and if it is, use the wfSet function to jump to another step.

    For example, the following step entry script sends documents in the Secure security group to the next step in the workflow:

    <$if dSecurityGroup like "Secure"$>
    <$wfSet("wfJumpName", "New")$>
    <$wfSet("wfJumpTargetStep", wfCurrentStep(1))$>
    <$wfSet("wfJumpEntryNotifyOff", "0")$>
    <$endif$>

    Jonathan
    http://jonathanhult.com
  • 2. Re: Is it possible to skip a workflow step based on metadata?
    JTyson Newbie
    Currently Being Moderated
    I have tried that and it seems to just still go into that step
    (The entry script of the step I'm trying to skip)

    <$if xYesNoMetadata like "No"$>
    <$wfSet("wfJumpName", "Skip_This_Step")$>
    <$wfSet("wfJumpTargetStep", wfCurrentStep(1))$> [[%In the test tab this shows up "wfJumpTargetStep=Next_Step@My_Workflow"%]]
    <$wfSet("wfJumpEntryNotifyOff", "0"$>
    <$endif$>

    [[%stuff to do if the Metadata field was "Yes"%]]


    I also stuck the line "<$wfSet("test", "Hi there")$>" to see if it popped up in the test tab to see if it was going in that block of code, and it's going in no problem.
    Oddly enough the step with "<$wfSet("wfJumpTargetStep", wfExit(0,0))$>" works fine like it is suppose to. It was a copy paste of the script I'm having issues with :/.

    Edited by: JTyson on Nov 15, 2012 5:43 AM
  • 3. Re: Is it possible to skip a workflow step based on metadata?
    jiri.machotka Guru
    Currently Being Moderated
    I have tried that and it seems to just still go into that step
    Technically speaking, it must go into the step (i.e. the step will be listed in the Workflow History), because you reach the Entry event, don't you? It should not, however, notify the approvers, nor step into further events (Update).

    If you want to step over the step, you need to move your logic to the Exit event of the previous step. The 'pro' of this approach would be that you don't need to bother with rejections (what if you reject your item within the next step you jumped onto?), the 'con' is that for the first step no previous step exists (or to be precise, a previous step that you may modify).
  • 4. Re: Is it possible to skip a workflow step based on metadata?
    JTyson Newbie
    Currently Being Moderated
    Thanks for that, I should have relized it had to be in the step to run that script. Thanks for the help.

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points