@@ -28,6 +28,7 @@ import (
2828 "errors"
2929 "fmt"
3030 "reflect"
31+ "strings"
3132 "sync"
3233 "time"
3334
@@ -719,6 +720,14 @@ matchLoop:
719720 return nil
720721}
721722
723+ func lastPartOfActivityName (name string ) string {
724+ lastDotIdx := strings .LastIndex (name , "." )
725+ if lastDotIdx < 0 || lastDotIdx == len (name )- 1 {
726+ return name
727+ }
728+ return name [lastDotIdx + 1 :]
729+ }
730+
722731func isDecisionMatchEvent (d * s.Decision , e * s.HistoryEvent , strictMode bool ) bool {
723732 switch d .GetDecisionType () {
724733 case s .DecisionTypeScheduleActivityTask :
@@ -729,7 +738,7 @@ func isDecisionMatchEvent(d *s.Decision, e *s.HistoryEvent, strictMode bool) boo
729738 decisionAttributes := d .ScheduleActivityTaskDecisionAttributes
730739
731740 if eventAttributes .GetActivityId () != decisionAttributes .GetActivityId () ||
732- eventAttributes .ActivityType .GetName () != decisionAttributes .ActivityType .GetName () ||
741+ lastPartOfActivityName ( eventAttributes .ActivityType .GetName ()) != lastPartOfActivityName ( decisionAttributes .ActivityType .GetName () ) ||
733742 (strictMode && eventAttributes .TaskList .GetName () != decisionAttributes .TaskList .GetName ()) ||
734743 (strictMode && bytes .Compare (eventAttributes .Input , decisionAttributes .Input ) != 0 ) {
735744 return false
@@ -758,7 +767,7 @@ func isDecisionMatchEvent(d *s.Decision, e *s.HistoryEvent, strictMode bool) boo
758767 decisionAttributes := d .StartTimerDecisionAttributes
759768
760769 if eventAttributes .GetTimerId () != decisionAttributes .GetTimerId () ||
761- eventAttributes .GetStartToFireTimeoutSeconds () != decisionAttributes .GetStartToFireTimeoutSeconds () {
770+ ( strictMode && eventAttributes .GetStartToFireTimeoutSeconds () != decisionAttributes .GetStartToFireTimeoutSeconds () ) {
762771 return false
763772 }
764773
0 commit comments