Skip to content

Commit

Permalink
adding codeDepot markers
Browse files Browse the repository at this point in the history
  • Loading branch information
paigesrossi committed Apr 11, 2024
1 parent fce0daa commit 8e5acd3
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -14,4 +15,5 @@ public static CancelResponse cancelWorkflowInstance(
var maestroApi = new WorkflowInstanceManagementApi(apiClient);
return maestroApi.cancelWorkflowInstance(accountId, instanceId);
}
//ds-snippet-end:Maestro2Step3
}
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -15,4 +16,5 @@ public static WorkflowInstance getWorkflowInstance(
var maestroApi = new WorkflowInstanceManagementApi(apiClient);
return maestroApi.getWorkflowInstance(accountId, workflowId, instanceId);
}
//ds-snippet-end:Maestro3Step3
}
Original file line number Diff line number Diff line change
Expand Up @@ -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<Participant>())
Expand All @@ -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<String, String> parseQueryString(String query) {
Expand Down

0 comments on commit 8e5acd3

Please sign in to comment.