Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Published by Scroll Versions from space PRINSAG and version 9.0
Sv translation
languageen

You can edit the code for the Branch flow action to insert a conditional branch into a rule chain.


 
By default, the user interface creates two blocks of code: one that contains the True/False conditions for the branch and another that checks the condition and triggers either the Yes event or the No event.

' ====================================================
' The ConfigureAction function implements a branch.
' It is called with the event which triggered the rule and the action.
' ============================================================
Public Sub ConfigureAction( _
ByVal triggerEvent As Creo.PWS.Automation.PrinergyDataModel.PageApprovalChangedEvent, _
ByVal action As Creo.PWS.Automation.GenericDataModel.BranchAction)

If (Me.Condition1(triggerEvent) AndAlso Me.Condition2(triggerEvent)) Then

‘This is how we make the branch trigger the “Yes” event
action.SetYes

Else
‘This is how we make the branch trigger the “No” event
action.SetNo

End If

End Sub


' =============================================================
' The condition functions test the event which triggered the rule
' If it returns true the Yes branch will be taken by the ConfigureAction function.
' If it returns false the No branch will be taken.
' =============================================================
Private Function Condition1( _
ByVal item As Creo.PWS.Automation.PrinergyDataModel.PageApprovalChangedEvent) _
As Boolean

Return (item.NewApprovalState = _
Creo.PWS.Automation.PrinergyDataModelTypes.ApprovalState.Approved)

End Function

Private Function Condition2( _
ByVal item As Creo.PWS.Automation.PrinergyDataModel.PageApprovalChangedEvent) _
As Boolean

Return '<your condition here>

End Function

Sv translation
languagede

Sie können den Code für die Zweig-Flussaktion bearbeiten und einen Bedingungszweig in eine Regelkette einfügen.

Anchor
Bookmark170_concept_DBB70F30D98349FABF2A
Bookmark170_concept_DBB70F30D98349FABF2A

Standardmäßig erstellt die Benutzeroberfläche zwei Codeblöcke: einen, der die True/False-Bedingungen für den Zweig enthält, und einen weiteren, der die Bedingung überprüft und das Yes-Ereignis oder das No-Ereignis auslöst.
' ====================================================
' The ConfigureAction function implements a branch.
' It is called with the event which triggered the rule and the action.
' ============================================================
Public Sub ConfigureAction( _
ByVal triggerEvent As Creo.PWS.Automation.PrinergyDataModel.PageApprovalChangedEvent, _
ByVal action As Creo.PWS.Automation.GenericDataModel.BranchAction)
If (Me.Condition1(triggerEvent) AndAlso Me.Condition2(triggerEvent)) Then
'This is how we make the branch trigger the "Yes" event
action.SetYes
Else
'This is how we make the branch trigger the "No" event
action.SetNo
End If
End Sub

' =============================================================
' The condition functions test the event which triggered the rule
' If it returns true the Yes branch will be taken by the ConfigureAction function.
' If it returns false the No branch will be taken.
' =============================================================
Private Function Condition1( _
ByVal item As Creo.PWS.Automation.PrinergyDataModel.PageApprovalChangedEvent) _
As Boolean
Return (item.NewApprovalState = _
Creo.PWS.Automation.PrinergyDataModelTypes.ApprovalState.Approved)
End Function
Private Function Condition2( _
ByVal item As Creo.PWS.Automation.PrinergyDataModel.PageApprovalChangedEvent) _
As Boolean
Return '<your condition here>
End Function

Sv translation
languagezh

可以编辑分支流程操作的代码,以将条件分支插入规则链中。

Anchor
Bookmark170_concept_DBB70F30D98349FABF2A
Bookmark170_concept_DBB70F30D98349FABF2A

默认情况下,用户界面会创建两个代码块:一个代码块包含分支的 True/False 条件,另一个代码块检查条件并触发Yes事件或No事件。
' ====================================================
' The ConfigureAction function implements a branch.
' It is called with the event which triggered the rule and the action.
' ============================================================
Public Sub ConfigureAction( _
ByVal triggerEvent As Creo.PWS.Automation.PrinergyDataModel.PageApprovalChangedEvent, _
ByVal action As Creo.PWS.Automation.GenericDataModel.BranchAction)
If (Me.Condition1(triggerEvent) AndAlso Me.Condition2(triggerEvent)) Then
'This is how we make the branch trigger the "Yes" event
action.SetYes
Else
'This is how we make the branch trigger the "No" event
action.SetNo
End If
End Sub

' =============================================================
' The condition functions test the event which triggered the rule
' If it returns true the Yes branch will be taken by the ConfigureAction function.
' If it returns false the No branch will be taken.
' =============================================================
Private Function Condition1( _
ByVal item As Creo.PWS.Automation.PrinergyDataModel.PageApprovalChangedEvent) _
As Boolean
Return (item.NewApprovalState = _
Creo.PWS.Automation.PrinergyDataModelTypes.ApprovalState.Approved)
End Function
Private Function Condition2( _
ByVal item As Creo.PWS.Automation.PrinergyDataModel.PageApprovalChangedEvent) _
As Boolean
Return '<your condition here>
End Function

Sv translation
languagees

Puede editar el código para la acción de flujo Circuito derivado a fin de insertar un circuito derivado condicional en una cadena de reglas.

Anchor
Bookmark170_concept_DBB70F30D98349FABF2A
Bookmark170_concept_DBB70F30D98349FABF2A

De forma predeterminada, la interfaz de usuario crea dos bloques de código: uno que contiene las condiciones True/False para el circuito derivado y otro que comprueba la condición y desencadena el evento afirmativo (Yes) o negativo (No).
' ====================================================
' The ConfigureAction function implements a branch.
' It is called with the event which triggered the rule and the action.
' ============================================================
Public Sub ConfigureAction( _
ByVal triggerEvent As Creo.PWS.Automation.PrinergyDataModel.PageApprovalChangedEvent, _
ByVal action As Creo.PWS.Automation.GenericDataModel.BranchAction)
If (Me.Condition1(triggerEvent) AndAlso Me.Condition2(triggerEvent)) Then
'This is how we make the branch trigger the "Yes" event
action.SetYes
Else
'This is how we make the branch trigger the "No" event
action.SetNo
End If
End Sub

' =============================================================
' The condition functions test the event which triggered the rule
' If it returns true the Yes branch will be taken by the ConfigureAction function.
' If it returns false the No branch will be taken.
' =============================================================
Private Function Condition1( _
ByVal item As Creo.PWS.Automation.PrinergyDataModel.PageApprovalChangedEvent) _
As Boolean
Return (item.NewApprovalState = _
Creo.PWS.Automation.PrinergyDataModelTypes.ApprovalState.Approved)
End Function
Private Function Condition2( _
ByVal item As Creo.PWS.Automation.PrinergyDataModel.PageApprovalChangedEvent) _
As Boolean
Return '<your condition here>
End Function

Sv translation
languagefr

Vous pouvez modifier le code de l'action de flux Dérivation afin d'insérer une dérivation conditionnelle dans une chaîne de règles.

Anchor
Bookmark170_concept_DBB70F30D98349FABF2A
Bookmark170_concept_DBB70F30D98349FABF2A

Par défaut, l'interface utilisateur crée deux blocs de code : l'un contenant les conditions VRAI/FAUXTrue/False de la dérivation et l'autre vérifiant la condition et déclenchant l'événement OuiYes ou l'événement Non No.
' ====================================================
' The ConfigureAction function implements a branch.
' It is called with the event which triggered the rule and the action.
' ============================================================
Public Sub ConfigureAction( _
ByVal triggerEvent As Creo.PWS.Automation.PrinergyDataModel.PageApprovalChangedEvent, _
ByVal action As Creo.PWS.Automation.GenericDataModel.BranchAction)
If (Me.Condition1(triggerEvent) AndAlso Me.Condition2(triggerEvent)) Then
'This is how we make the branch trigger the "Yes" event
action.SetYes
Else
'This is how we make the branch trigger the "No" event
action.SetNo
End If
End Sub

' =============================================================
' The condition functions test the event which triggered the rule
' If it returns true the Yes branch will be taken by the ConfigureAction function.
' If it returns false the No branch will be taken.
' =============================================================
Private Function Condition1( _
ByVal item As Creo.PWS.Automation.PrinergyDataModel.PageApprovalChangedEvent) _
As Boolean
Return (item.NewApprovalState = _
Creo.PWS.Automation.PrinergyDataModelTypes.ApprovalState.Approved)
End Function
Private Function Condition2( _
ByVal item As Creo.PWS.Automation.PrinergyDataModel.PageApprovalChangedEvent) _
As Boolean
Return '<your condition here>
End Function

Sv translation
languageja

条件分岐フロー アクションのコードを編集して、ルール チェーンに条件分岐の条件を挿入できます。

Anchor
Bookmark170_concept_DBB70F30D98349FABF2A
Bookmark170_concept_DBB70F30D98349FABF2A

ユーザー インターフェイスのデフォルトでは 2 つのコード ブロックが作成されます。1 つ目のコードには条件分岐の True/False 条件が含まれており、もう 1 つのコードでは条件をチェックして Yes または No のどちらかのイベントを起動します。
' ====================================================
' The ConfigureAction function implements a branch.
' It is called with the event which triggered the rule and the action.
' ============================================================
Public Sub ConfigureAction( _
ByVal triggerEvent As Creo.PWS.Automation.PrinergyDataModel.PageApprovalChangedEvent, _
ByVal action As Creo.PWS.Automation.GenericDataModel.BranchAction)
If (Me.Condition1(triggerEvent) AndAlso Me.Condition2(triggerEvent)) Then
'This is how we make the branch trigger the "Yes" event
action.SetYes
Else
'This is how we make the branch trigger the "No" event
action.SetNo
End If
End Sub

' =============================================================
' The condition functions test the event which triggered the rule
' If it returns true the Yes branch will be taken by the ConfigureAction function.
' If it returns false the No branch will be taken.
' =============================================================
Private Function Condition1( _
ByVal item As Creo.PWS.Automation.PrinergyDataModel.PageApprovalChangedEvent) _
As Boolean
Return (item.NewApprovalState = _
Creo.PWS.Automation.PrinergyDataModelTypes.ApprovalState.Approved)
End Function
Private Function Condition2( _
ByVal item As Creo.PWS.Automation.PrinergyDataModel.PageApprovalChangedEvent) _
As Boolean
Return '<your condition here>
End Function