Object[] parameters = new Object[] { "parameter1" };
try {
workflow.startPeriodicWorkflow(activityType, parameters, options);
// WorkflowExecution is available after workflow creation
WorkflowExecution workflowExecution = workflow.getWorkflowExecution();
System.out.println("Started periodic workflow with workflowId=\"" + workflowExecution.getWorkflowId()
+ "\" and runId=\"" + workflowExecution.getRunId() + "\"");
}
catch (WorkflowExecutionAlreadyStartedException e) {
// It is expected to get this exception if start is called before workflow run is completed.
System.out.println("Periodic workflow with workflowId=\"" + workflow.getWorkflowExecution().getWorkflowId()
+ " is already running");