JBPM TaskInstance 对象创建过程

时间:2023-12-17 12:38:44

对象获得过程如下:

获得对象工厂--->工厂创建代理对象


TaskMgmtInstance tmi = executionContext.getTaskMgmtInstance();

TaskInstance ti=tmi.createTaskInstance(task, token);

TaskInstanceFactory taskInstanceFactory = (TaskInstanceFactory)org.jbpm.JbpmConfiguration.Configs.getObject("jbpm.task.instance.factory"); //创建工厂对象

taskInstanceFactory.createTaskInstance()  //通过工厂创建对象

TaskinstanceFactoryImpl->new TaskInstanceInvokeHandler().getTi();

public class TaskInstanceInvokeHandler{
private TaskInstance ti;
public TaskInstanceInvokeHandler(){
Class[] interfaces=new Class[]{TaskinstanceProxy.class};
Class c=TaskinstanceInterceptor.getProxyFactory(TaskInstance.class, interfaces);
try {
ti=(TaskInstance)TaskinstanceInterceptor.getProxyInstance(c,new TaskinstanceInterceptor());//获得代理对象
} catch (InstantiationException e) {
e.printStackTrace();
} catch (IllegalAccessException e) {
e.printStackTrace();
}
}
public TaskInstance getTi() {
return ti;
}
}