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

Unjustified "Infinite loop error" in workflow

Hi,

I have built a workflow for an approval process with a loop: if the Approver disapproves, the Author has to make changes and then the Approver has to approve again.
I want the state transitions to be triggered based on metadata: the Approver checks a field called "I disapprove" and the Author checks a field called "Here's a new version to approve again" (very simplified explanation).
Since both state transitions are "automatic", M-Files won't save the workflow because of the possibility of an infinate loop. Even though I prevented this possibility via some rules in the Metadata Card Configuration.

Is there some way to bypass this unjustified infinate loop error without setting state transitions as manual actions?

To elaborate: the M-Files "infinate loop check" seems very primitive: you can't even build a looping workflow where transitions between state A and B (and back) happen automatically after 1 year
  • Hi Leon

    This is indeed a frustrating "feature", and I've fell short of it on occasion too. There are two ways around it:
    • There is a manual state transition, as you've already found out

    • Connect your workflow so that it doesn't actually contain a loop, but instead trigger a VBScript on one of the states that will set the state programmatically to the next logical state


    Hope that helps.
  • I feel your pain,

    On 29 January 2016 i contacted M-Files support about this.

    M-Files workflows does not allow infinite loop for performance reasons.
    If you are sure that infinite loop will not cause performance issues in your use case, scripting can be used to bypass infinite loop restriction by creating another state and changing state using action script in that state.

    Example:

    Option Explicit

    Dim ApprovalState : ApprovalState = 151 ' Workflow State ID, check from Workflow States value list
    Dim oPropVal: Set oPropVal = CreateObject("MFilesAPI.PropertyValue")
    oPropVal.PropertyDef = 39 ' Workflow states build-in property
    oPropVal.TypedValue.SetValue MFDatatypeLookup, ApprovalState
    Vault.ObjectPropertyOperations.SetProperty ObjVer, oPropVal


    I made suggestion to add ?Checkbox? in state transition settings to allow administrator to disable the infinite loop detection/validation for that specific state transition so we would not have to create those pseudo states.
    As usual, improvement suggestion ticket about this was recorded somewhere in R&D tracker (with ID 1464). Evidently this issue is not important enough to resolve.
  • Thanks guys!
    I'll try with a VBscript