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

Not working "Trigger the state transition once all separate assignments..."

Former Member
Former Member
Hi All,

Anyone knows why my workflow does not change to next state even though all assignments have been approved.



This stayed at "Awaiting for Approval" even though all assignments have been approved. It was working a couple of times. Is it any interval for the transmitting?

Thanks
Bin
  • By default the conditions for triggering state transitions are checked once per hour and the transfer is triggered if the requirements are met. The interval can also be adjusted through a registry setting if needed (restart the server instance after modifying the registry):

    Key path: HKEY_LOCAL_MACHINE\SOFTWARE\Motive\M-Files\\Server\MFServer
    Value name: StateChangerSleepingIntervalInMinutes
    Value type: DWORD
    Value data: default 60, minimum 1

  • Former Member
    Former Member
    Thanks

    I have changed the interval, but the issue is still there.

    I did a sort of experiments and figured out:
    1. If the assignment is created from workflow "Create separate assignments", then the state would automatically transmit to next once it is approved. I notice there is an entry called "Workflow Assignments" in this way.

    2. However, if the assignment is added manually, then the state would not transmit after it is approved.

    Could you please advice what is the difference and how should I make the second way working as well?



    Thanks
    Bin
  • Sounds like you in the second instance are creating an assignment manually without involving the workflow. In that case, of course, the workflow is not involved and cannot handle state transition etc. You should add the workflow to the document rather than add an assignment.
  • Former Member
    Former Member
    Thanks bright,

    I do set the employee to workflow before manually add the assignment.

    Any other cause.

    Thanks



  • Former Member
    Former Member
    Figured out my code below had a wrong sequence, once swap it and the automatic transmission works.


    // Relate it to the original object via the "workflow assignment" property.
    env.ObjVerEx.AddLookup((int) MFBuiltInPropertyDef.MFBuiltInPropertyDefWorkflowAssignment, // = 79
    new ObjVer()
    {
    Type = (int) MFBuiltInObjectType.MFBuiltInObjectTypeAssignment, // = 10
    ID = assignmentId
    });

    // Ensure that the audit is correct.
    env.ObjVerEx.SetModifiedBy(env.CurrentUserID);
    env.ObjVerEx.SaveProperties();


    Should swap the last two lines sequence as below

    env.ObjVerEx.SaveProperties();
    // Ensure that the audit is correct.
    env.ObjVerEx.SetModifiedBy(env.CurrentUserID);