Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting the Workflow Execution ID? #27

Open
xnickmx opened this issue Mar 25, 2014 · 3 comments
Open

Setting the Workflow Execution ID? #27

xnickmx opened this issue Mar 25, 2014 · 3 comments

Comments

@xnickmx
Copy link

xnickmx commented Mar 25, 2014

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&#379028.

@claymccoy
Copy link
Contributor

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

@xnickmx
Copy link
Author

xnickmx commented Mar 26, 2014

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#

@jodem
Copy link

jodem commented Aug 10, 2015

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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants