return taskInstance;
}
TaskInstance instantiateNewTaskInstance(ExecutionContext executionContext) {
TaskInstance newTaskInstance = null;
TaskInstanceFactory taskInstanceFactory = (TaskInstanceFactory) JbpmConfiguration.Configs.getObject("jbpm.task.instance.factory");
try {
newTaskInstance = taskInstanceFactory.createTaskInstance(executionContext);
} catch (NullPointerException e) {
throw new JbpmException("jbpm.task.instance.factory was not configured in jbpm.cfg.xml", e);
} catch (Exception e) {
e.printStackTrace();
throw new JbpmException("couldn't instantiate task instance with task instance factory '"+taskInstanceFactory+"'", e);