@@ -59,6 +59,13 @@ Method UserAction(Type As %Integer, Name As %String, InternalName As %String, Se
59
59
set filename = ##class (SourceControl.Git.Utils ).FullExternalName (.InternalName )
60
60
do ##class (SourceControl.Git.Change ).GetUncommitted (filename ,.tAction )
61
61
do ..GetStatus (.InternalName , .isInSourceControl , .isEditable ,.isCheckedOut ,.userCheckedOut )
62
+
63
+ // Deal with Business Processes and Rules
64
+ // Note: Business Processes and Rules do not have a 'new document' User Action, and thus must be added like this
65
+ if (('isInSourceControl )) {
66
+ do ..CheckBusinessProcessesAndRules (InternalName )
67
+ }
68
+
62
69
if '$data (tAction ) {
63
70
set user = " " , inNamespace = " "
64
71
if 'isEditable || ##class (SourceControl.Git.Utils ).Locked () {
@@ -371,6 +378,8 @@ Method OnAfterSave(InternalName As %String, Object As %RegisteredObject = {$$$NU
371
378
$$$ThrowOnError(##class (SourceControl.Git.Change ).SetUncommitted (filename , " edit" , InternalName , $username , " " , 1 , " " , " " , 0 ))
372
379
}
373
380
}
381
+ } else {
382
+ do ..CheckBusinessProcessesAndRules (InternalName )
374
383
}
375
384
}
376
385
} catch e {
@@ -535,4 +544,18 @@ Method CheckCommitterIdentity(Settings As SourceControl.Git.Settings, ByRef Acti
535
544
return 0
536
545
}
537
546
547
+ /// Deal with Business Processes and Rules
548
+ Method CheckBusinessProcessesAndRules (InternalName As %String ) As %Status
549
+ {
550
+ // Note: Business Processes and Rules are not added through normal user action processes because of upstream hook issues,
551
+ // so we have to add them like this
552
+ if (##class (SourceControl.Git.Utils ).Type (InternalName ) = " cls" ) {
553
+ set name = $piece (InternalName ," .CLS" ,1 )
554
+ set exists = ##class (%Dictionary.CompiledClass ).%ExistsId (name )
555
+ if (exists && ($classmethod (name ," %Extends" ," Ens.BusinessProcess" ) || $classmethod (name ," %Extends" ," Ens.Rule.Definition" ))) {
556
+ do ..AddToSourceControl (InternalName )
557
+ }
558
+ }
559
+ }
560
+
538
561
}
0 commit comments