08-25-2015 03:05 PM
public void execute(DelegateExecution execution) throws Exception
{
ArrayList<String> agreements = (ArrayList<String>) execution.getVariable("agreements");
String misappropriatedSecret = (String) execution.getVariable("misappropriatedTradeSecret");
if (agreements == null)
{
agreements = new ArrayList<String>();
}
System.out.println("Current agreements:\n");
for(String agreement : agreements)
{
System.out.println(" " + agreement);
}
ProcessInstance processInstance = null;
ProcessEngine processEngine = ProcessEngineConfiguration.createProcessEngineConfigurationFromResourceDefault().buildProcessEngine();
RuntimeService runtimeService = processEngine.getRuntimeService();
// Start a process instance
runtimeService.setVariable(execution.getId(), "agreements", agreements);
runtimeService.setVariable(execution.getId(), "misappropriatedSecret", misappropriatedSecret);
processInstance = runtimeService.startProcessInstanceByKey("ThereIsMisappropriation");
List tasks = processEngine.getTaskService().createTaskQuery().processInstanceId(processInstance.getId()).list();
if (tasks == null)
{
tasks = new ArrayList<String>();
}
System.out.println("Current tasks size:\n" + tasks.size());
}
08-26-2015 01:32 AM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.