@@ -97,9 +97,12 @@ public static ExperimentDecisionNotificationBuilder newExperimentDecisionNotific
97
97
public static class ExperimentDecisionNotificationBuilder {
98
98
public final static String EXPERIMENT_KEY = "experimentKey" ;
99
99
public final static String VARIATION_KEY = "variationKey" ;
100
+ public final static String EXPERIMENT_ID = "experimentId" ;
101
+ public final static String VARIATION_ID = "variationId" ;
100
102
101
103
private String type ;
102
104
private String experimentKey ;
105
+ private String experimentId ;
103
106
private Variation variation ;
104
107
private String userId ;
105
108
private Map <String , ?> attributes ;
@@ -130,6 +133,11 @@ public ExperimentDecisionNotificationBuilder withVariation(Variation variation)
130
133
return this ;
131
134
}
132
135
136
+ public ExperimentDecisionNotificationBuilder withExperimentId (Variation experimentId ) {
137
+ this .experimentId = experimentId ;
138
+ return this ;
139
+ }
140
+
133
141
public DecisionNotification build () {
134
142
if (type == null ) {
135
143
throw new OptimizelyRuntimeException ("type not set" );
@@ -141,7 +149,9 @@ public DecisionNotification build() {
141
149
142
150
decisionInfo = new HashMap <>();
143
151
decisionInfo .put (EXPERIMENT_KEY , experimentKey );
152
+ decisionInfo .put (EXPERIMENT_ID , experimentId );
144
153
decisionInfo .put (VARIATION_KEY , variation != null ? variation .getKey () : null );
154
+ decisionInfo .put (VARIATION_ID , variation != null ? variation .getId () : null );
145
155
146
156
return new DecisionNotification (
147
157
type ,
@@ -364,6 +374,8 @@ public static class FlagDecisionNotificationBuilder {
364
374
public final static String RULE_KEY = "ruleKey" ;
365
375
public final static String REASONS = "reasons" ;
366
376
public final static String DECISION_EVENT_DISPATCHED = "decisionEventDispatched" ;
377
+ public final static String EXPERIMENT_ID = "experimentId" ;
378
+ public final static String VARIATION_ID = "variationId" ;
367
379
368
380
private String flagKey ;
369
381
private Boolean enabled ;
@@ -374,6 +386,8 @@ public static class FlagDecisionNotificationBuilder {
374
386
private String ruleKey ;
375
387
private List <String > reasons ;
376
388
private Boolean decisionEventDispatched ;
389
+ private String experimentId ;
390
+ private String variationId ;
377
391
378
392
private Map <String , Object > decisionInfo ;
379
393
@@ -422,6 +436,16 @@ public FlagDecisionNotificationBuilder withDecisionEventDispatched(Boolean dispa
422
436
return this ;
423
437
}
424
438
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
+
425
449
public DecisionNotification build () {
426
450
if (flagKey == null ) {
427
451
throw new OptimizelyRuntimeException ("flagKey not set" );
@@ -439,6 +463,8 @@ public DecisionNotification build() {
439
463
put (RULE_KEY , ruleKey );
440
464
put (REASONS , reasons );
441
465
put (DECISION_EVENT_DISPATCHED , decisionEventDispatched );
466
+ put (EXPERIMENT_ID , experimentId );
467
+ put (VARIATION_ID , variationId );
442
468
}};
443
469
444
470
return new DecisionNotification (
0 commit comments