03-22-2011 03:57 PM
String processName = getProcessName();
String businessKey = getBusinessKey();
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
RuntimeService runTimeService = processEngine.getRuntimeService();
ProcessInstance processInstance = runTimeService.startProcessInstanceByKey(processName, businessKey);
the process runs and then waits at the first user task to be externally signalled via a TaskListener attached to the User Task … so in my
public class GenericHumanTaskListener implements TaskListener {
public void notify (DelegateTask delegateTask) { … }
}
function I am trying to retrieve the business key that the process started with through the delegateTask object … is there a way to do so?03-23-2011 03:47 AM
ProcessInstanceQuery processInstanceQuery = runtimeService.createProcessInstanceQuery();
ProcessInstance result = processInstanceQuery.processInstanceId(delegateExecution.getProcessInstanceId()).singleResult();
String businessKey = result.getBusinessKey();
03-23-2011 04:10 AM
03-23-2011 10:21 AM
public class GenericRequest {
…
…
private void startWorkflow() {
String processName = determineProcessNameFromFields();
ProcessEngine processEngine = ProcessEngines.getDefaultProcessEngine();
RuntimeService runTimeService = processEngine.getRuntimeService();
ProcessInstance processInstance = runTimeService.startProcessInstanceByKey(
processName,
this.businessKey,
CollectionUtil.singletonMap(
"RequisitionId",
this.businessKey
)
);
}
…
…
}
public class GenericHumanTaskListener implements TaskListener {
…
…
@Override
public void notify (DelegateTask delegateTask) {
String wfeTaskID = delegateTask.getId();
String taskName = delegateTask.getName();
String businessKey = delegateTask.getVariable("RequisitionId").toString();
…
}
…
…
}
03-24-2011 03:00 AM
03-25-2011 12:39 PM
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.