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 state precondidion setting with Advanced Conditions (VBScript)

Hello
I am truing to set up a workflow, were one of the States has to have a precondition with multiple metadata properties. In the object metadata card I have an Engineering Responsible and a Project Manager, Next state should be allowed only if one or both fields are filled. When using Property condition definition it works on AND principle, so I can set if both are filled.
I would like to try to set the condition using the Advanced Conditions(VBScript) option. How do I set the output? What property o variable I should set to allow or block the state transition?
So far I have this code, but what should be set if the condition is met?
Option Explicit

' Get Engineering responsible.
Dim szEngineeringResponsible
szEngineeringResponsible = PropertyValues.SearchForProperty( 1644 ).TypedValue.DisplayValue
if szEngineeringResponsible <> null then

???????

end if
 
Parents
  • Unfortunately placing the code in to the transition trigger, does not help my case. Problem with using the code in the trigger is that it triggers the transition as soon as first criteria is met not all of them and it does so with out permission from the user. In my case I need to have ether Engineering Responsible or Project Manager fields filled or both in addition to other metadata properties. In case o the trigger code, as soon as the user enters the Engineering Responsible and saves it, state changes, when user might wanted to fill in some other data as well, before sending it thru. As soon as the trigger transition is placed, the state becomes invisible to the user and they can not trigger it manually.
    I tried using the AllowStateTransition=True statement in the state precondition, but it is not recognised as an output. M-files sees it as just another variable, that does not have any impact on allowing or forbidding the actual state transition.
Reply
  • Unfortunately placing the code in to the transition trigger, does not help my case. Problem with using the code in the trigger is that it triggers the transition as soon as first criteria is met not all of them and it does so with out permission from the user. In my case I need to have ether Engineering Responsible or Project Manager fields filled or both in addition to other metadata properties. In case o the trigger code, as soon as the user enters the Engineering Responsible and saves it, state changes, when user might wanted to fill in some other data as well, before sending it thru. As soon as the trigger transition is placed, the state becomes invisible to the user and they can not trigger it manually.
    I tried using the AllowStateTransition=True statement in the state precondition, but it is not recognised as an output. M-files sees it as just another variable, that does not have any impact on allowing or forbidding the actual state transition.
Children
No Data