@@ -19,7 +19,7 @@ public TaskActivityExecutor(
19
19
this .logger = logger ;
20
20
}
21
21
22
- public String execute (String taskName , String input , int taskId ) throws Throwable {
22
+ public String execute (String taskName , String input , String taskExecutionKey ) throws Throwable {
23
23
TaskActivityFactory factory = this .activityFactories .get (taskName );
24
24
if (factory == null ) {
25
25
throw new IllegalStateException (
@@ -32,7 +32,7 @@ public String execute(String taskName, String input, int taskId) throws Throwabl
32
32
String .format ("The task factory '%s' returned a null TaskActivity object." , taskName ));
33
33
}
34
34
35
- TaskActivityContextImpl context = new TaskActivityContextImpl (taskName , input );
35
+ TaskActivityContextImpl context = new TaskActivityContextImpl (taskName , input , taskExecutionKey );
36
36
37
37
// Unhandled exceptions are allowed to escape
38
38
Object output = activity .run (context );
@@ -44,21 +44,29 @@ public String execute(String taskName, String input, int taskId) throws Throwabl
44
44
}
45
45
46
46
private class TaskActivityContextImpl implements TaskActivityContext {
47
+ private final String taskExecutionKey ;
47
48
private final String name ;
48
49
private final String rawInput ;
50
+
49
51
50
52
private final DataConverter dataConverter = TaskActivityExecutor .this .dataConverter ;
51
53
52
- public TaskActivityContextImpl (String activityName , String rawInput ) {
54
+ public TaskActivityContextImpl (String activityName , String rawInput , String taskExecutionKey ) {
53
55
this .name = activityName ;
54
56
this .rawInput = rawInput ;
57
+ this .taskExecutionKey = taskExecutionKey ;
55
58
}
56
59
57
60
@ Override
58
61
public String getName () {
59
62
return this .name ;
60
63
}
61
64
65
+ @ Override
66
+ public String getTaskExecutionKey () {
67
+ return this .taskExecutionKey ;
68
+ }
69
+
62
70
@ Override
63
71
public <T > T getInput (Class <T > targetType ) {
64
72
if (this .rawInput == null ) {
0 commit comments