@@ -19,7 +19,7 @@ public TaskActivityExecutor(
19
19
this .logger = logger ;
20
20
}
21
21
22
- public String execute (String taskName , String input , String taskExecutionId ) throws Throwable {
22
+ public String execute (String taskName , String input , String taskExecutionId , int taskId ) 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, String taskExecutionId) thr
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 , taskExecutionId );
35
+ TaskActivityContextImpl context = new TaskActivityContextImpl (taskName , input , taskExecutionId , taskId );
36
36
37
37
// Unhandled exceptions are allowed to escape
38
38
Object output = activity .run (context );
@@ -47,13 +47,15 @@ private class TaskActivityContextImpl implements TaskActivityContext {
47
47
private final String name ;
48
48
private final String rawInput ;
49
49
private final String taskExecutionId ;
50
+ private final int taskId ;
50
51
51
52
private final DataConverter dataConverter = TaskActivityExecutor .this .dataConverter ;
52
53
53
- public TaskActivityContextImpl (String activityName , String rawInput , String taskExecutionId ) {
54
+ public TaskActivityContextImpl (String activityName , String rawInput , String taskExecutionId , int taskId ) {
54
55
this .name = activityName ;
55
56
this .rawInput = rawInput ;
56
57
this .taskExecutionId = taskExecutionId ;
58
+ this .taskId = taskId ;
57
59
}
58
60
59
61
@ Override
@@ -74,5 +76,10 @@ public <T> T getInput(Class<T> targetType) {
74
76
public String getTaskExecutionId () {
75
77
return this .taskExecutionId ;
76
78
}
79
+
80
+ @ Override
81
+ public int getTaskId () {
82
+ return this .taskId ;
83
+ }
77
84
}
78
85
}
0 commit comments