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 Automatic State Transition by calculated date

Former Member
Former Member
Hi

I was wondering if it is possible to define a automatic state change on a workflow based on a date, that has been calculated using an object's date property.

Regards

Yaney
Parents
  • Have M-Files solved the requirement of trigger a state transition in time?, I was testing a script that calculate the difference in minutes to trigger the state but doesn't work, Response from Mika was on 2014.


    Option Explicit

    Const INTERVAL = 6 'every 6 minutes

    Dim dThisState : dThisState = PropertyValues.SearchForProperty( MFBuiltInPropertyDefStateEntered ).TypedValue.Value
    Dim dDeadLineTime : dDeadLineTime = Now()
    Dim tInterval, dThisStateUpdated

    ' Adapting the Time Zone (-3)
    dThisStateUpdated = DateAdd("h",-3, dThisState)

    ' Calculating the interval
    tInterval = DateDiff("n", dThisStateUpdated, dDeadLineTime)

    If tInterval = INTERVAL Then
    AllowStateTransition = true
    Else
    'Do nothing
    End If
Reply
  • Have M-Files solved the requirement of trigger a state transition in time?, I was testing a script that calculate the difference in minutes to trigger the state but doesn't work, Response from Mika was on 2014.


    Option Explicit

    Const INTERVAL = 6 'every 6 minutes

    Dim dThisState : dThisState = PropertyValues.SearchForProperty( MFBuiltInPropertyDefStateEntered ).TypedValue.Value
    Dim dDeadLineTime : dDeadLineTime = Now()
    Dim tInterval, dThisStateUpdated

    ' Adapting the Time Zone (-3)
    dThisStateUpdated = DateAdd("h",-3, dThisState)

    ' Calculating the interval
    tInterval = DateDiff("n", dThisStateUpdated, dDeadLineTime)

    If tInterval = INTERVAL Then
    AllowStateTransition = true
    Else
    'Do nothing
    End If
Children
No Data