@@ -142,7 +142,7 @@ private class ContextImplTask implements TaskOrchestrationContext {
142142 private String appId ;
143143
144144 // LinkedHashMap to maintain insertion order when returning the list of pending actions
145- private final Map <Integer , OrchestratorActions .OrchestratorAction > pendingActions = new LinkedHashMap <>();
145+ private final Map <Integer , OrchestratorActions .WorkflowAction > pendingActions = new LinkedHashMap <>();
146146 private final Map <Integer , TaskRecord <?>> openTasks = new HashMap <>();
147147 private final Map <String , Queue <TaskRecord <?>>> outstandingEvents = new LinkedHashMap <>();
148148 private final List <HistoryEvents .HistoryEvent > unprocessedEvents = new LinkedList <>();
@@ -368,7 +368,7 @@ public <V> Task<V> callActivity(
368368
369369 TaskFactory <V > taskFactory = () -> {
370370 int id = this .sequenceNumber ++;
371- OrchestratorActions .OrchestratorAction .Builder actionBuilder = OrchestratorActions .OrchestratorAction
371+ OrchestratorActions .WorkflowAction .Builder actionBuilder = OrchestratorActions .WorkflowAction
372372 .newBuilder ()
373373 .setId (id )
374374 .setScheduleTask (scheduleTaskBuilder );
@@ -463,16 +463,16 @@ public void sendEvent(String instanceId, String eventName, Object eventData) {
463463
464464 int id = this .sequenceNumber ++;
465465 String serializedEventData = this .dataConverter .serialize (eventData );
466- Orchestration .OrchestrationInstance .Builder orchestrationInstanceBuilder =
467- Orchestration .OrchestrationInstance .newBuilder ()
466+ Orchestration .WorkflowInstance .Builder orchestrationInstanceBuilder =
467+ Orchestration .WorkflowInstance .newBuilder ()
468468 .setInstanceId (instanceId );
469469 OrchestratorActions .SendEventAction .Builder builder = OrchestratorActions
470470 .SendEventAction .newBuilder ().setInstance (orchestrationInstanceBuilder )
471471 .setName (eventName );
472472 if (serializedEventData != null ) {
473473 builder .setData (StringValue .of (serializedEventData ));
474474 }
475- OrchestratorActions .OrchestratorAction .Builder actionBuilder = OrchestratorActions .OrchestratorAction .newBuilder ()
475+ OrchestratorActions .WorkflowAction .Builder actionBuilder = OrchestratorActions .WorkflowAction .newBuilder ()
476476 .setId (id )
477477 .setSendEvent (builder );
478478
@@ -505,8 +505,8 @@ public <V> Task<V> callSubOrchestrator(
505505 }
506506
507507 String serializedInput = this .dataConverter .serialize (input );
508- OrchestratorActions .CreateSubOrchestrationAction .Builder createSubOrchestrationActionBuilder =
509- OrchestratorActions .CreateSubOrchestrationAction
508+ OrchestratorActions .CreateChildWorkflowAction .Builder createSubOrchestrationActionBuilder =
509+ OrchestratorActions .CreateChildWorkflowAction
510510 .newBuilder ().setName (name );
511511 if (serializedInput != null ) {
512512 createSubOrchestrationActionBuilder .setInput (StringValue .of (serializedInput ));
@@ -535,10 +535,10 @@ public <V> Task<V> callSubOrchestrator(
535535
536536 TaskFactory <V > taskFactory = () -> {
537537 int id = this .sequenceNumber ++;
538- OrchestratorActions .OrchestratorAction .Builder actionBuilder = OrchestratorActions .OrchestratorAction
538+ OrchestratorActions .WorkflowAction .Builder actionBuilder = OrchestratorActions .WorkflowAction
539539 .newBuilder ()
540540 .setId (id )
541- .setCreateSubOrchestration (createSubOrchestrationActionBuilder );
541+ .setCreateChildWorkflow (createSubOrchestrationActionBuilder );
542542
543543 // Set router on the OrchestratorAction for cross-app routing
544544 if (hasSourceAppId ()) {
@@ -641,7 +641,7 @@ private void handleTaskScheduled(HistoryEvents.HistoryEvent e) {
641641 // The history shows that this orchestrator created a durable task in a previous execution.
642642 // We can therefore remove it from the map of pending actions. If we can't find the pending
643643 // action, then we assume a non-deterministic code violation in the orchestrator.
644- OrchestratorActions .OrchestratorAction taskAction = this .pendingActions .remove (taskId );
644+ OrchestratorActions .WorkflowAction taskAction = this .pendingActions .remove (taskId );
645645 if (taskAction == null ) {
646646 String message = String .format (
647647 "Non-deterministic orchestrator detected: a history event scheduling an activity task with sequence "
@@ -797,7 +797,7 @@ private Task<Void> createTimer(String name, Instant finalFireAt) {
797797
798798 private CompletableTask <Void > createInstantTimer (String name , int id , Instant fireAt ) {
799799 Timestamp ts = DataConverter .getTimestampFromInstant (fireAt );
800- this .pendingActions .put (id , OrchestratorActions .OrchestratorAction .newBuilder ()
800+ this .pendingActions .put (id , OrchestratorActions .WorkflowAction .newBuilder ()
801801 .setId (id )
802802 .setCreateTimer (OrchestratorActions .CreateTimerAction .newBuilder ()
803803 .setName (name ).setFireAt (ts ))
@@ -825,7 +825,7 @@ private void handleTimerCreated(HistoryEvents.HistoryEvent e) {
825825 // The history shows that this orchestrator created a durable timer in a previous execution.
826826 // We can therefore remove it from the map of pending actions. If we can't find the pending
827827 // action, then we assume a non-deterministic code violation in the orchestrator.
828- OrchestratorActions .OrchestratorAction timerAction = this .pendingActions .remove (timerEventId );
828+ OrchestratorActions .WorkflowAction timerAction = this .pendingActions .remove (timerEventId );
829829 if (timerAction == null ) {
830830 String message = String .format (
831831 "Non-deterministic orchestrator detected: a history event creating a timer with ID %d and "
@@ -860,9 +860,9 @@ public void handleTimerFired(HistoryEvents.HistoryEvent e) {
860860
861861 private void handleSubOrchestrationCreated (HistoryEvents .HistoryEvent e ) {
862862 int taskId = e .getEventId ();
863- HistoryEvents .SubOrchestrationInstanceCreatedEvent subOrchestrationInstanceCreated =
864- e .getSubOrchestrationInstanceCreated ();
865- OrchestratorActions .OrchestratorAction taskAction = this .pendingActions .remove (taskId );
863+ HistoryEvents .ChildWorkflowInstanceCreatedEvent subOrchestrationInstanceCreated =
864+ e .getChildWorkflowInstanceCreated ();
865+ OrchestratorActions .WorkflowAction taskAction = this .pendingActions .remove (taskId );
866866 if (taskAction == null ) {
867867 String message = String .format (
868868 "Non-deterministic orchestrator detected: a history event scheduling an sub-orchestration task "
@@ -876,8 +876,8 @@ private void handleSubOrchestrationCreated(HistoryEvents.HistoryEvent e) {
876876 }
877877
878878 private void handleSubOrchestrationCompleted (HistoryEvents .HistoryEvent e ) {
879- HistoryEvents .SubOrchestrationInstanceCompletedEvent subOrchestrationInstanceCompletedEvent =
880- e .getSubOrchestrationInstanceCompleted ();
879+ HistoryEvents .ChildWorkflowInstanceCompletedEvent subOrchestrationInstanceCompletedEvent =
880+ e .getChildWorkflowInstanceCompleted ();
881881 int taskId = subOrchestrationInstanceCompletedEvent .getTaskScheduledId ();
882882 TaskRecord <?> record = this .openTasks .remove (taskId );
883883 if (record == null ) {
@@ -908,8 +908,8 @@ private void handleSubOrchestrationCompleted(HistoryEvents.HistoryEvent e) {
908908 }
909909
910910 private void handleSubOrchestrationFailed (HistoryEvents .HistoryEvent e ) {
911- HistoryEvents .SubOrchestrationInstanceFailedEvent subOrchestrationInstanceFailedEvent =
912- e .getSubOrchestrationInstanceFailed ();
911+ HistoryEvents .ChildWorkflowInstanceFailedEvent subOrchestrationInstanceFailedEvent =
912+ e .getChildWorkflowInstanceFailed ();
913913 int taskId = subOrchestrationInstanceFailedEvent .getTaskScheduledId ();
914914 TaskRecord <?> record = this .openTasks .remove (taskId );
915915 if (record == null ) {
@@ -965,9 +965,9 @@ private void completeInternal(
965965 Helpers .throwIfOrchestratorComplete (this .isComplete );
966966
967967
968- OrchestratorActions .CompleteOrchestrationAction .Builder builder = OrchestratorActions .CompleteOrchestrationAction
968+ OrchestratorActions .CompleteWorkflowAction .Builder builder = OrchestratorActions .CompleteWorkflowAction
969969 .newBuilder ();
970- builder .setOrchestrationStatus (runtimeStatus );
970+ builder .setWorkflowStatus (runtimeStatus );
971971
972972 if (rawOutput != null ) {
973973 builder .setResult (StringValue .of (rawOutput ));
@@ -986,10 +986,10 @@ private void completeInternal(
986986 }
987987
988988 int id = this .sequenceNumber ++;
989- OrchestratorActions .OrchestratorAction .Builder actionBuilder = OrchestratorActions .OrchestratorAction
989+ OrchestratorActions .WorkflowAction .Builder actionBuilder = OrchestratorActions .WorkflowAction
990990 .newBuilder ()
991991 .setId (id )
992- .setCompleteOrchestration (builder .build ());
992+ .setCompleteWorkflow (builder .build ());
993993
994994 // Add router to completion action for cross-app routing back to parent
995995 if (hasSourceAppId ()) {
@@ -1003,7 +1003,7 @@ private void completeInternal(
10031003 this .isComplete = true ;
10041004 }
10051005
1006- private void addCarryoverEvents (OrchestratorActions .CompleteOrchestrationAction .Builder builder ) {
1006+ private void addCarryoverEvents (OrchestratorActions .CompleteWorkflowAction .Builder builder ) {
10071007 // Add historyEvent in the unprocessedEvents buffer
10081008 // Add historyEvent in the new event list that haven't been added to the buffer.
10091009 // We don't check the event in the pass event list to avoid duplicated events.
@@ -1040,28 +1040,28 @@ private void processEvent(HistoryEvents.HistoryEvent e) {
10401040 } else {
10411041 this .logger .fine (() -> this .instanceId + ": Processing event: " + e .getEventTypeCase ());
10421042 switch (e .getEventTypeCase ()) {
1043- case ORCHESTRATORSTARTED :
1043+ case WORKFLOWSTARTED :
10441044 Instant instant = DataConverter .getInstantFromTimestamp (e .getTimestamp ());
10451045 this .setCurrentInstant (instant );
10461046
1047- if (StringUtils .isNotEmpty (e .getOrchestratorStarted ().getVersion ().getName ())) {
1048- this .orchestratorVersionName = e .getOrchestratorStarted ().getVersion ().getName ();
1047+ if (StringUtils .isNotEmpty (e .getWorkflowStarted ().getVersion ().getName ())) {
1048+ this .orchestratorVersionName = e .getWorkflowStarted ().getVersion ().getName ();
10491049 }
1050- for (var patch : e .getOrchestratorStarted ().getVersion ().getPatchesList ()) {
1050+ for (var patch : e .getWorkflowStarted ().getVersion ().getPatchesList ()) {
10511051 this .historyPatches .put (patch , true );
10521052 }
10531053
10541054 this .logger .fine (() -> this .instanceId + ": Workflow orchestrator started" );
10551055 break ;
1056- case ORCHESTRATORCOMPLETED :
1056+ case WORKFLOWCOMPLETED :
10571057 // No action needed
10581058 this .logger .fine (() -> this .instanceId + ": Workflow orchestrator completed" );
10591059 break ;
10601060 case EXECUTIONSTARTED :
10611061 HistoryEvents .ExecutionStartedEvent executionStarted = e .getExecutionStarted ();
10621062 this .setName (executionStarted .getName ());
10631063 this .setInput (executionStarted .getInput ().getValue ());
1064- this .setInstanceId (executionStarted .getOrchestrationInstance ().getInstanceId ());
1064+ this .setInstanceId (executionStarted .getWorkflowInstance ().getInstanceId ());
10651065 this .logger .fine (() -> this .instanceId + ": Workflow execution started" );
10661066 // For cross-app suborchestrations, if the router has a target, use that as our appID
10671067 // since that's where we're actually executing
@@ -1122,13 +1122,13 @@ private void processEvent(HistoryEvents.HistoryEvent e) {
11221122 case TIMERFIRED :
11231123 this .handleTimerFired (e );
11241124 break ;
1125- case SUBORCHESTRATIONINSTANCECREATED :
1125+ case CHILDWORKFLOWINSTANCECREATED :
11261126 this .handleSubOrchestrationCreated (e );
11271127 break ;
1128- case SUBORCHESTRATIONINSTANCECOMPLETED :
1128+ case CHILDWORKFLOWINSTANCECOMPLETED :
11291129 this .handleSubOrchestrationCompleted (e );
11301130 break ;
1131- case SUBORCHESTRATIONINSTANCEFAILED :
1131+ case CHILDWORKFLOWINSTANCEFAILED :
11321132 this .handleSubOrchestrationFailed (e );
11331133 break ;
11341134 case EVENTRAISED :
@@ -1149,14 +1149,14 @@ private void processEvent(HistoryEvents.HistoryEvent e) {
11491149 public void setVersionNotRegistered () {
11501150 this .pendingActions .clear ();
11511151
1152- OrchestratorActions .CompleteOrchestrationAction .Builder builder = OrchestratorActions .CompleteOrchestrationAction
1152+ OrchestratorActions .CompleteWorkflowAction .Builder builder = OrchestratorActions .CompleteWorkflowAction
11531153 .newBuilder ();
1154- builder .setOrchestrationStatus (Orchestration .OrchestrationStatus .ORCHESTRATION_STATUS_STALLED );
1154+ builder .setWorkflowStatus (Orchestration .OrchestrationStatus .ORCHESTRATION_STATUS_STALLED );
11551155
11561156 int id = this .sequenceNumber ++;
1157- OrchestratorActions .OrchestratorAction action = OrchestratorActions .OrchestratorAction .newBuilder ()
1157+ OrchestratorActions .WorkflowAction action = OrchestratorActions .WorkflowAction .newBuilder ()
11581158 .setId (id )
1159- .setCompleteOrchestration (builder .build ())
1159+ .setCompleteWorkflow (builder .build ())
11601160 .build ();
11611161 this .pendingActions .put (id , action );
11621162
0 commit comments