@@ -19,7 +19,7 @@ public TaskActivityExecutor(
1919 this .logger = logger ;
2020 }
2121
22- public String execute (String taskName , String input , int taskId ) throws Throwable {
22+ public String execute (String taskName , String input , String taskExecutionKey ) throws Throwable {
2323 TaskActivityFactory factory = this .activityFactories .get (taskName );
2424 if (factory == null ) {
2525 throw new IllegalStateException (
@@ -32,7 +32,7 @@ public String execute(String taskName, String input, int taskId) throws Throwabl
3232 String .format ("The task factory '%s' returned a null TaskActivity object." , taskName ));
3333 }
3434
35- TaskActivityContextImpl context = new TaskActivityContextImpl (taskName , input );
35+ TaskActivityContextImpl context = new TaskActivityContextImpl (taskName , input , taskExecutionKey );
3636
3737 // Unhandled exceptions are allowed to escape
3838 Object output = activity .run (context );
@@ -44,21 +44,29 @@ public String execute(String taskName, String input, int taskId) throws Throwabl
4444 }
4545
4646 private class TaskActivityContextImpl implements TaskActivityContext {
47+ private final String taskExecutionKey ;
4748 private final String name ;
4849 private final String rawInput ;
50+
4951
5052 private final DataConverter dataConverter = TaskActivityExecutor .this .dataConverter ;
5153
52- public TaskActivityContextImpl (String activityName , String rawInput ) {
54+ public TaskActivityContextImpl (String activityName , String rawInput , String taskExecutionKey ) {
5355 this .name = activityName ;
5456 this .rawInput = rawInput ;
57+ this .taskExecutionKey = taskExecutionKey ;
5558 }
5659
5760 @ Override
5861 public String getName () {
5962 return this .name ;
6063 }
6164
65+ @ Override
66+ public String getTaskExecutionKey () {
67+ return this .taskExecutionKey ;
68+ }
69+
6270 @ Override
6371 public <T > T getInput (Class <T > targetType ) {
6472 if (this .rawInput == null ) {
0 commit comments