Open xnickmx opened 10 years ago
The link you posted doesn't work for others. What is an execution ID? Are you referring to the workflow ID and run ID for a workflow execution? I don't know of any way to set them, but you can retrieve the generated ones. I updated the wiki to make it more clear: https://github.com/Netflix/glisten/wiki/Basics
// Perhaps you need the ids of the workflow execution. InterfaceBasedWorkflowClient is a WorkflowClientExternal.
WorkflowExecution workflowExecution = client.workflowExecution
Thanks, that was a big help. I am now using the WorkflowExecution to check the status of the running workflow.
Sorry for the private AWS forum link. Here's a link that doesn't require authentication: https://forums.aws.amazon.com/thread.jspa?messageID=379028#
For those who may ask here is how you can cancel or terminate a workflow with just the runId and workflowId, this can be useful when you need to perfom operation on a workflow without the original worfklowExecution in memory. (could be added to wiki)
//create the workflowExection reference (workflowId and runId)
WorkflowExecution execution = new WorkflowExecution().withRunId("runId","workflowId");
WorkflowClientFactory clientFactory = new WorkflowClientFactory(simpleWorkflow, workflowConfig.getDomain(), workflowConfig.getTaskList());
//request a cancel (need decider to be alive)
clientFactory.getWorkflowClient(execution).requestCancelWorkflowExecution();
//terminate (no need of a live decider)
clientFactory.getWorkflowClient(execution).terminateWorkflowExecution("reason","detail",ChildPolicy.TERMINATE);
Is there a way to set a workflow's execution ID before running it? I couldn't find one in Glisten.
Alternatively, is there a way to retrieve the auto-generated workflow execution ID from the workflow object?
The only way I've figured out how to find the ID is to check in the AWS console (or use the API) to narrow down which workflow execution it is based on the name and the time it was started. That's not ideal in cases where you want to always have the execution ID and there may be many workflows starting at a similar time.
FYI, AWS's Flow framework does provide a way to set the workflow execution ID, but it relies on the generated client factories that we don't use when using Glisten. See https://forums.aws.amazon.com/thread.jspa?messageID=379028񜢔.