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 Post Condition with OR Logic

Hello, we have a use case in which users create a non-document object (that is forced to start in the 'Draft' State of a Workflow), then fill in metadata and attach file(s).  The business wants to require that before moving out of 'Draft' State, either the user has uploaded a file to the NDO OR they have checked the boolean property called 'Waive Requirements?'.  I see in Workflow configuration of Post-Conditions I can easily make one or both of these a requirement.  But I can't figure out how to make EITHER a requirement.  Has anyone done this before?

Parents
  • As far as I know you cannot use OR in this context (nor in many others!).

    If it is OK to use automatic transitions you can configure a workaround with 2 transitions having different triggers, one of them having and uploaded file as requirement, and the other having Waive Requirements = True as requirement. You can add more conditions to both to create AND conditions if other requirements need to be in place before triggering.

  • Hey , thanks for the feedback, I was afraid that was the case.  In our case, an automatic transition out of the Draft State wasn't feasible, the user needs to create the object, compile documentation, then manually transition it when they're ready.

    To get around this limitation I ended up inserting 2 intermediate States between draft and the next state.  The first one checks to see if the 'Waive Requirements?' boolean is checked.  If it is checked, it will automatically transition to the normal 2nd state.  If it is not checked, it will automatically transition to another intermediate step which has a post-condition requiring a file to be attached.  If the file isn't attached, the user will get the standard post-condition failure error and will roll back to draft.  Not ideal, definitely not manageable at scale (multiple ORs), but doable.

  • Hi,

    This is the only possible "mouse-click" solution I can think of, but personally I would write custom code to check all the conditions and display an understandable message for the user. This will contribute to a better user experience.

Reply
  • Hi,

    This is the only possible "mouse-click" solution I can think of, but personally I would write custom code to check all the conditions and display an understandable message for the user. This will contribute to a better user experience.

Children
No Data