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
  • Rather than using preconditions you could place your script in the trigger of a transition. In that case output should be AllowStateTransition = True (or False if conditions are not met).
    To avoid complex scripting with OR conditions you can add more than one transition and place different trigger scripts in each, and you can prioritize them to make sure the conditions are checked in a specific order.
    I am not sure exactly what the output should be in pre- or postcondition scripts, have never used them myself. Not much help to be found in the user guide. My best guess would be to try using AllowStateTransition.
    I find that the error messages provided to users when preconditions are not met generally cause a lot of confusion. If, for instance, you set preconditions to "x-property" is not empty, then users will get a message along these lines: The condition "x-property" is not empty is not met. This can be hard enough to understand if you are fluent in English. It is utter jibberish to people native in other languages. Therefor I tend to avoid such preconditions when possible.
Reply
  • Rather than using preconditions you could place your script in the trigger of a transition. In that case output should be AllowStateTransition = True (or False if conditions are not met).
    To avoid complex scripting with OR conditions you can add more than one transition and place different trigger scripts in each, and you can prioritize them to make sure the conditions are checked in a specific order.
    I am not sure exactly what the output should be in pre- or postcondition scripts, have never used them myself. Not much help to be found in the user guide. My best guess would be to try using AllowStateTransition.
    I find that the error messages provided to users when preconditions are not met generally cause a lot of confusion. If, for instance, you set preconditions to "x-property" is not empty, then users will get a message along these lines: The condition "x-property" is not empty is not met. This can be hard enough to understand if you are fluent in English. It is utter jibberish to people native in other languages. Therefor I tend to avoid such preconditions when possible.
Children
No Data