@@ -97,9 +97,12 @@ public static ExperimentDecisionNotificationBuilder newExperimentDecisionNotific
9797 public static class ExperimentDecisionNotificationBuilder {
9898 public final static String EXPERIMENT_KEY = "experimentKey" ;
9999 public final static String VARIATION_KEY = "variationKey" ;
100+ public final static String EXPERIMENT_ID = "experimentId" ;
101+ public final static String VARIATION_ID = "variationId" ;
100102
101103 private String type ;
102104 private String experimentKey ;
105+ private String experimentId ;
103106 private Variation variation ;
104107 private String userId ;
105108 private Map <String , ?> attributes ;
@@ -130,6 +133,11 @@ public ExperimentDecisionNotificationBuilder withVariation(Variation variation)
130133 return this ;
131134 }
132135
136+ public ExperimentDecisionNotificationBuilder withExperimentId (Variation experimentId ) {
137+ this .experimentId = experimentId ;
138+ return this ;
139+ }
140+
133141 public DecisionNotification build () {
134142 if (type == null ) {
135143 throw new OptimizelyRuntimeException ("type not set" );
@@ -141,7 +149,9 @@ public DecisionNotification build() {
141149
142150 decisionInfo = new HashMap <>();
143151 decisionInfo .put (EXPERIMENT_KEY , experimentKey );
152+ decisionInfo .put (EXPERIMENT_ID , experimentId );
144153 decisionInfo .put (VARIATION_KEY , variation != null ? variation .getKey () : null );
154+ decisionInfo .put (VARIATION_ID , variation != null ? variation .getId () : null );
145155
146156 return new DecisionNotification (
147157 type ,
@@ -364,6 +374,8 @@ public static class FlagDecisionNotificationBuilder {
364374 public final static String RULE_KEY = "ruleKey" ;
365375 public final static String REASONS = "reasons" ;
366376 public final static String DECISION_EVENT_DISPATCHED = "decisionEventDispatched" ;
377+ public final static String EXPERIMENT_ID = "experimentId" ;
378+ public final static String VARIATION_ID = "variationId" ;
367379
368380 private String flagKey ;
369381 private Boolean enabled ;
@@ -374,6 +386,8 @@ public static class FlagDecisionNotificationBuilder {
374386 private String ruleKey ;
375387 private List <String > reasons ;
376388 private Boolean decisionEventDispatched ;
389+ private String experimentId ;
390+ private String variationId ;
377391
378392 private Map <String , Object > decisionInfo ;
379393
@@ -422,6 +436,16 @@ public FlagDecisionNotificationBuilder withDecisionEventDispatched(Boolean dispa
422436 return this ;
423437 }
424438
439+ public FlagDecisionNotificationBuilder withExperimentId (String experimentId ) {
440+ this .experimentId = experimentId ;
441+ return this ;
442+ }
443+
444+ public FlagDecisionNotificationBuilder withVariationId (String variationId ) {
445+ this .variationId = variationId ;
446+ return this ;
447+ }
448+
425449 public DecisionNotification build () {
426450 if (flagKey == null ) {
427451 throw new OptimizelyRuntimeException ("flagKey not set" );
@@ -439,6 +463,8 @@ public DecisionNotification build() {
439463 put (RULE_KEY , ruleKey );
440464 put (REASONS , reasons );
441465 put (DECISION_EVENT_DISPATCHED , decisionEventDispatched );
466+ put (EXPERIMENT_ID , experimentId );
467+ put (VARIATION_ID , variationId );
442468 }};
443469
444470 return new DecisionNotification (
0 commit comments