JBPM TaskInstance 对象创建过程

对象获得过程如下:

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


 

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;
    }
}


 

posted on 2015-09-25 10:59  rigidwang  阅读(826)  评论(0编辑  收藏  举报