diff --git a/src/main/java/com/docusign/controller/maestro/examples/EG001ControllerTriggerWorkflow.java b/src/main/java/com/docusign/controller/maestro/examples/EG001ControllerTriggerWorkflow.java index a7f262e..83d2139 100644 --- a/src/main/java/com/docusign/controller/maestro/examples/EG001ControllerTriggerWorkflow.java +++ b/src/main/java/com/docusign/controller/maestro/examples/EG001ControllerTriggerWorkflow.java @@ -116,13 +116,17 @@ protected Object doWork( ModelMap model, HttpServletResponse response ) throws ApiException, IOException, NoSuchAlgorithmException, InvalidKeyException, URISyntaxException { + //ds-snippet-start:Maestro1Step2 ApiClient apiClient = createApiClient(config.getMaestroBasePath(), user.getAccessToken()); + //ds-snippet-end:Maestro1Step2 String accountId = session.getAccountId(); + //ds-snippet-start:Maestro1Step3 var workflow = TriggerWorkflowService.getWorkflowDefinition( apiClient, accountId, session.getWorkflowId()); + //ds-snippet-end:Maestro1Step3 var result = TriggerWorkflowService.triggerWorkflow( apiClient, diff --git a/src/main/java/com/docusign/controller/maestro/examples/EG002ControllerCancelWorkflow.java b/src/main/java/com/docusign/controller/maestro/examples/EG002ControllerCancelWorkflow.java index ae2eb21..677feba 100644 --- a/src/main/java/com/docusign/controller/maestro/examples/EG002ControllerCancelWorkflow.java +++ b/src/main/java/com/docusign/controller/maestro/examples/EG002ControllerCancelWorkflow.java @@ -45,7 +45,9 @@ protected Object doWork( ModelMap model, HttpServletResponse response ) throws ApiException, IOException, NoSuchAlgorithmException, InvalidKeyException, com.docusign.maestro.client.ApiException { + //ds-snippet-start:Maestro2Step2 ApiClient apiClient = createApiClient(config.getMaestroBasePath(), user.getAccessToken()); + //ds-snippet-end:Maestro2Step2 CancelResponse cancelResponse = CancelWorkflowInstanceService.cancelWorkflowInstance( apiClient, diff --git a/src/main/java/com/docusign/controller/maestro/examples/EG003ControllerGetWorkflowStatus.java b/src/main/java/com/docusign/controller/maestro/examples/EG003ControllerGetWorkflowStatus.java index 46b600b..6783fa3 100644 --- a/src/main/java/com/docusign/controller/maestro/examples/EG003ControllerGetWorkflowStatus.java +++ b/src/main/java/com/docusign/controller/maestro/examples/EG003ControllerGetWorkflowStatus.java @@ -45,7 +45,9 @@ protected Object doWork( ModelMap model, HttpServletResponse response ) throws ApiException, IOException, NoSuchAlgorithmException, InvalidKeyException, com.docusign.maestro.client.ApiException { + //ds-snippet-start:Maestro3Step2 ApiClient apiClient = createApiClient(config.getMaestroBasePath(), user.getAccessToken()); + //ds-snippet-end:Maestro3Step2 WorkflowInstance instance = GetWorkflowInstanceService.getWorkflowInstance( apiClient, diff --git a/src/main/java/com/docusign/controller/maestro/services/CancelWorkflowInstanceService.java b/src/main/java/com/docusign/controller/maestro/services/CancelWorkflowInstanceService.java index dc04017..92838db 100644 --- a/src/main/java/com/docusign/controller/maestro/services/CancelWorkflowInstanceService.java +++ b/src/main/java/com/docusign/controller/maestro/services/CancelWorkflowInstanceService.java @@ -6,6 +6,7 @@ import com.docusign.maestro.model.CancelResponse; public final class CancelWorkflowInstanceService { + //ds-snippet-start:Maestro2Step3 public static CancelResponse cancelWorkflowInstance( ApiClient apiClient, String accountId, @@ -14,4 +15,5 @@ public static CancelResponse cancelWorkflowInstance( var maestroApi = new WorkflowInstanceManagementApi(apiClient); return maestroApi.cancelWorkflowInstance(accountId, instanceId); } + //ds-snippet-end:Maestro2Step3 } diff --git a/src/main/java/com/docusign/controller/maestro/services/GetWorkflowInstanceService.java b/src/main/java/com/docusign/controller/maestro/services/GetWorkflowInstanceService.java index 1fb2b5e..f9d9c63 100644 --- a/src/main/java/com/docusign/controller/maestro/services/GetWorkflowInstanceService.java +++ b/src/main/java/com/docusign/controller/maestro/services/GetWorkflowInstanceService.java @@ -6,6 +6,7 @@ import com.docusign.maestro.model.*; public final class GetWorkflowInstanceService { + //ds-snippet-start:Maestro3Step3 public static WorkflowInstance getWorkflowInstance( ApiClient apiClient, String accountId, @@ -15,4 +16,5 @@ public static WorkflowInstance getWorkflowInstance( var maestroApi = new WorkflowInstanceManagementApi(apiClient); return maestroApi.getWorkflowInstance(accountId, workflowId, instanceId); } + //ds-snippet-end:Maestro3Step3 } diff --git a/src/main/java/com/docusign/controller/maestro/services/TriggerWorkflowService.java b/src/main/java/com/docusign/controller/maestro/services/TriggerWorkflowService.java index 4791b98..c0fce83 100644 --- a/src/main/java/com/docusign/controller/maestro/services/TriggerWorkflowService.java +++ b/src/main/java/com/docusign/controller/maestro/services/TriggerWorkflowService.java @@ -74,6 +74,7 @@ public static TriggerWorkflowViaPostResponse triggerWorkflow( emailData.put("ccEmail", ccEmail); emailData.put("ccName", ccName); + //ds-snippet-start:Maestro1Step4 var payload = new TriggerPayload().instanceName(instanceName) .metadata(new WorkflowDefinitionMetadata()) .participants(new ArrayList()) @@ -87,8 +88,11 @@ public static TriggerWorkflowViaPostResponse triggerWorkflow( WorkflowTriggerApi.TriggerWorkflowOptions options = workflowTriggerApi.new TriggerWorkflowOptions(); options.setMtid(mtid); options.setMtsec(mtsec); + //ds-snippet-end:Maestro1Step4 + //ds-snippet-start:Maestro1Step5 return workflowTriggerApi.triggerWorkflow(accountId, payload, options); + //ds-snippet-end:Maestro1Step5 } private static Map parseQueryString(String query) {