The M-Files Community will be updated on Tuesday, April 2, 2024 at 10:00 AM EST / 2:00 PM GMT and the update is expected to last for several hours. The site will be unavailable during this time.

This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Workflow design: how to return to previous workflow step

Hi all, I have the following requirement in a workflow with about 10 states:

- It shall be possible to put the workflow execution on hold and continue it on a specific date. Putting the workflow on hold shall be possible from each of the 10 states. Once a given date is reached, the workflow shall continue it's execution at the state where the user decided to put it on hold.

Now my question: I think the most simple solution would be to have a state "on hold" and once the target date is reached, the workflow would automatically return to the previous state (see workflow picture below). However, I am not sure how I can return to the previous state. Does anybody have an idea how this could be done?? E.g. if the user changed the state from A to "on hold", then the workflow should automatically return to state A once the target date is reached.

Thanks for any inputs.

Best regards,
 Beat

  • Hello,

    You can add a Property Definition where you add what was the previous state, and add the transitions based on that property.

  • Hi Radu, thanks for your feedback. I thought about that but wasn't sure how I could set the "previous state" property in an easy way. Would you set it to a static value once entering a workflow step (e.g. set it to A once state A is entered, but set nothing if state "On hold" is entered)?  Or would you use Compliance Kit (auto property)? Or do you have a VB script to set the previous state? :-)

    A couple workflows with many steps need that feature. So it sucks that I have to change like 50 workflow states..

    Thanks,
     Beat

  • Well the manual way is when object enters State A, B, C you set the Previous state to that state with set property, and when the object goes on hold, you leave the previous state at it is, so that you know where to send the object from On hold State.

    If you have a lots of states, it is difficult to manage that.

    With Managed Properties, it might be doable, but now I am holiday and can’t be sure until I check.

    With VBscript it is for sure doable without the property. You would need to search for previous version of the object to check what was the previous state and transition the object to that state.

  • thanks! Ok it's clear now what to do.. writing VB.. :-( 
    Anybody having such a script?