コードを編集することにより、ルール パラメータ エディタで選択できないパラメータを割り当てることができます。
アクションにパラメータを割り当てるためのコードは、以下のようになります。
Public Sub ConfigureAction( _
ByVal triggerEvent As Creo.PWS.Automation.PrinergyDataModel.InputFileCreatedEvent, _
ByVal action As Creo.PWS.Automation.PrinergyDataModel.RefineAction)
' — Assign the value of the action parameter "InputFiles" —
action.InputFiles = triggerEvent.InputFiles
' — Assign the value of the action parameter "ProcessTemplatePath" —
action.ProcessTemplatePath = "Storage:Archive:Archive:ArchiveAll"
' — Assign the value of the action parameter "Comment" —
' action.Comment = some value expression
End Sub
ユーザー インターフェイスでパラメータに値を割り当てない場合、パラメータはコード内にコメントとして表示されます。このパラメータに値を設定するには、非コメント化する必要があります。
静的な値の割り当て
静的な値とは、ルールが起動しても例外なく変化しない値のことです。たとえば、使用するプロセス テンプレート、送信先の E-メール アドレス、使用する優先順位などがあります。
'--- Assign the value of the Action Parameter "Comment" ----
action.Comment = "This is a test comment"
'--- Assign the value of the Action Parameter "Priority" ----
action.Priority = 2
イベント プロパティの割り当て
イベント プロパティとは、動的な値、つまりルールが起動するたびに変化する値のことです。イベント プロパティをアクションのパラメータに割り当てるには、以下のコードを記述します。
'--- Assign the value of the Action Parameter "Job" —
action.Job = triggerEvent.Job
'--- Assign the value of the Action Parameter "UserName" —
action.UserName = triggerEvent.Process.UserName
プロパティが埋め込まれた文字列の割り当て
静的な値とイベント プロパティ値を組み合わせて文字列を構成する必要がある場合があります。これは、特に E-メール メッセージで役立ちます。
'--- Assign the value of the Action Parameter "Subject" —
action.Subject = ("Failed refine in Job " + triggerEvent.Process.Job.Name + ".")
Overview
Content Tools