Page tree

フィルタフロー アクション用のコードを編集して、特定イベントの内容を 2 つのグループに分割できます。
たとえば、ページの承認時にサイズの大きいページをある方法でプルーフし、残りのページを別の方法でプルーフする場合などがあります。フィルタフロー アクションを使用すると、この種類の分割を実行できます。
ユーザー インターフェイスのデフォルトでは 2 つのコード ブロックが作成されます。1 つ目のコードにはフィルタ用の True/False 条件が含まれており、もう 1 つのコードでは必要な各アイテムの条件をチェックして、[Accepted]リストまたは[Rejected]リストに追加します。
' =======================================================
' The ConfigureAction function implements a filter.
' It is called with the event which triggered the rule and the action.
' ================================================================
Public Sub ConfigureAction( _
ByVal triggerEvent As Creo.PWS.Automation.PrinergyDataModel.SurfaceFullEvent, _
ByVal action As Creo.PWS.Automation.GenericDataModel.FilterAction)
'Create a counter variable and initialize to the value 0
Dim idx0 As Integer = 0
'Next we create a loop that will go through all the input files (until
'the counter reaches the end of the list)
Do While (idx0 < triggerEvent.Surfaces.Length)
Dim idx1 As Integer = 0
Do While (idx1 < triggerEvent.Surfaces(idx0).Separations.Length)
'Check to see if this item is Accepted or Rejected
If Me.IsAccepted(triggerEvent.Surfaces(idx0).Separations(idx1)) Then
'This is how we add an item to the Accepted list for the filter
action.AddAcceptedItem(triggerEvent.Surfaces(idx0).Separations(idx1))
Else
'This is how we add an item to the Rejected list for the filter
action.AddRejectedItem(triggerEvent.Surfaces(idx0).Separations(idx1))
End If
idx1 = (idx1 + 1)
Loop
idx0 = (idx0 + 1)
Loop
End Sub

' ==============================================================
' The condition functions test each item selected by the filter.
' If it returns true the item will be added to a list of items accepted by the filter.
' If it returns false the item will be added to a list of items rejected by the filter.
' =============================================================
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 Condition1( _
ByVal candidate As Creo.PWS.Automation.PrinergyDataModel.Separation) As Boolean
'We return a TRUE if this item is accepted by the filter, a FALSE value if not
Return candidate.Color.IsProcessYellow
End Function

  • No labels