; Define your Customer Rules to control Objects.P.State depending on JobResults.
; #Doc.: Date of Template : 05.05.2017/J.Fes

; #ToDo: Delete not Used Examples, and Edit Rules as required.

; #Doc1: to change State of other Process.Groupes add def at the end of the Rule.
; #Doc1: |-> #Example: [P01.Stat=RUN] [P02.Stat=RUN] [PRf.Stat=RUN]

; #Doc2: to reset status to previous state when result code is empty use def [P.Stat={PreState}]
; #Doc2: |-> #Example: [RuleID=PreState] [O.Type=*] [J.ResCode=] [J.ResMsg=*] [J.ResWarn=*] [P.Stat={PreState}]

; #Doc3: to set other P.Results Rule with definitions: [P.ResCode=??] [P.ResMsg=Cutom Message] [P.ResWarn=0/1] [P.ResLink=]
; #Doc3: |-> #Example: [RuleID=Custom P.def] [O.Type=*]  [J.ResCode=*]  [J.ResMsg=*SUCCESS*]        [J.ResWarn=*] [P.Stat=D.01.OK]  [P.ResCode=0]  [P.ResMsg=CustomMsg:SUCCESS WELL Done] [P.ResWarn=false] [P.ResLink=www.plmjobmanager.com]
; #Doc3: |-> #Example: [RuleID=Custom P.def] [O.Type=*]  [J.ResCode=*]  [J.ResMsg=*Part not found*] [J.ResWarn=*] [P.Stat=D.02.ERR] [P.ResCode=02] [P.ResMsg=CustomMsg:Part not found]    [P.ResWarn=false] [P.ResLink=www.plmjobmanager.com]

;-- #Rule: Test
[RuleID=OK]      [O.Type=*] [J.ResCode=0]  [J.ResMsg=*] [J.ResWarn=0] [P.Stat=D.T.OK]
[RuleID=WRN]     [O.Type=*] [J.ResCode=0]  [J.ResMsg=*] [J.ResWarn=1] [P.Stat=D.T.WRN]
[RuleID=ERR]     [O.Type=*] [J.ResCode<>0] [J.ResMsg=*] [J.ResWarn=*] [P.Stat=D.T.ERR]
;-- #Rule: Standard
[RuleID=OK]      [O.Type=*] [J.ResCode=0]  [J.ResMsg=*] [J.ResWarn=0] [P.Stat=D.OK]
[RuleID=WRN]     [O.Type=*] [J.ResCode=0]  [J.ResMsg=*] [J.ResWarn=1] [P.Stat=D.WRN]
[RuleID=ERR]     [O.Type=*] [J.ResCode<>0] [J.ResMsg=*] [J.ResWarn=*] [P.Stat=D.ERR]
;-- #Rule: Refile: RUN1
[RuleID=OK]      [O.Type=*] [J.ResCode=0]  [J.ResMsg=*] [J.ResWarn=0] [P.Stat=D.OK]
[RuleID=WRN]     [O.Type=*] [J.ResCode=0]  [J.ResMsg=*] [J.ResWarn=1] [P.Stat=D.WRN]
[RuleID=ERR]     [O.Type=*] [J.ResCode<>0] [J.ResMsg=*] [J.ResWarn=*] [P.Stat=D.RUN1.ERR]
;-- #Rule: Refile: RUN2
[RuleID=OK]      [O.Type=*] [J.ResCode=0]  [J.ResMsg=*] [J.ResWarn=0] [P.Stat=D.OK]
[RuleID=WRN]     [O.Type=*] [J.ResCode=0]  [J.ResMsg=*] [J.ResWarn=1] [P.Stat=D.WRN]
[RuleID=ERR]     [O.Type=*] [J.ResCode<>0] [J.ResMsg=*] [J.ResWarn=*] [P.Stat=D.RUN2.ERR]
;-- #Rule: Refile: RUN3
[RuleID=OK]      [O.Type=*] [J.ResCode=0]  [J.ResMsg=*] [J.ResWarn=0] [P.Stat=D.OK]
[RuleID=WRN]     [O.Type=*] [J.ResCode=0]  [J.ResMsg=*] [J.ResWarn=1] [P.Stat=D.WRN]
[RuleID=ERR]     [O.Type=*] [J.ResCode<>0] [J.ResMsg=*] [J.ResWarn=*] [P.Stat=D.RUN3.ERR]
;-- #Rule: Refile: AP Basis
[RuleID=OK]      [O.Type=UGMASTER]  [J.ResCode=0]  [J.ResMsg=*] [J.ResWarn=0] [P.Stat=D.RfBa.OK]
[RuleID=OK]      [O.Type<>UGMASTER] [J.ResCode=0]  [J.ResMsg=*] [J.ResWarn=0] [P.Stat=D.Rf.OK]
[RuleID=WRN]     [O.Type=*]         [J.ResCode=0]  [J.ResMsg=*] [J.ResWarn=1] [P.Stat=D.RfBa.WRN]
[RuleID=ERR]     [O.Type=*]         [J.ResCode<>0] [J.ResMsg=*] [J.ResWarn=*] [P.Stat=D.RfBa.ERR]
;-- #Rule: Refile: AP MCS
[RuleID=OK]      [O.Type=*] [J.ResCode=0]  [J.ResMsg=*] [J.ResWarn=0] [P.Stat=D.Rf.OK]
[RuleID=WRN]     [O.Type=*] [J.ResCode=0]  [J.ResMsg=*] [J.ResWarn=1] [P.Stat=D.RfMc.WRN]
[RuleID=ERR]     [O.Type=*] [J.ResCode<>0] [J.ResMsg=*] [J.ResWarn=*] [P.Stat=D.RfMc.ERR]
;-- #Rule: CB Extract 01
[RuleID=AutoRedo][O.Type=*] [J.ResCode=CBExtr-01] [J.ResMsg=*] [J.ResWarn=*] [P.Stat={PreState}]
[RuleID=OK]      [O.Type=*] [J.ResCode=0]         [J.ResMsg=*] [J.ResWarn=0] [P.Stat=D.OK]  [P02.Stat=RUN1]
[RuleID=WRN]     [O.Type=*] [J.ResCode=0]         [J.ResMsg=*] [J.ResWarn=1] [P.Stat=D.WRN] [P02.Stat=RUN1]
[RuleID=ERR]     [O.Type=*] [J.ResCode<>0]        [J.ResMsg=*] [J.ResWarn=*] [P.Stat=D.ERR] [P02.Stat=RUN1]
;-- #Rule: CB Extract 02
[RuleID=AutoRedo][O.Type=*] [J.ResCode=CBExtr-01] [J.ResMsg=*] [J.ResWarn=*] [P.Stat={PreState}]
[RuleID=OK]      [O.Type=*] [J.ResCode=0]         [J.ResMsg=*] [J.ResWarn=0] [P.Stat=D.OK]  [P03.Stat=RUN1]
[RuleID=WRN]     [O.Type=*] [J.ResCode=0]         [J.ResMsg=*] [J.ResWarn=1] [P.Stat=D.WRN] [P03.Stat=RUN1]
[RuleID=ERR]     [O.Type=*] [J.ResCode<>0]        [J.ResMsg=*] [J.ResWarn=*] [P.Stat=D.ERR] [P03.Stat=RUN1]
