ITeye博客

(3)jBPM websale代码学习: home.jsp(启动流程)

hongsoft · 2006-05-07 19:18 · Markdown

1)用下面的方法,得到最新的流程定义

JbpmContext.getCurrentJbpmContext().getGraphSession().findLatestProcessDefinitions();

2)上面的方法,返回的是流程定义的列表,在页面上分别显示出来。

比如:显示启动节点的名称的方法是:

processDefinition.getTaskMgmtDefinition().getStartTask().getName();

3)JSP上传递的是流程定义ID,在servlet中,用下面方法得到ProcessDefinition:

ProcessDefinition processDefinition = graphSession.loadProcessDefinition(processDefinitionId);
4)完成开始节点:

ProcessInstance processInstance = new ProcessInstance(processDefinition);

    // create a new taskinstance for the start task
    TaskInstance taskInstance = processInstance.getTaskMgmtInstance().createStartTaskInstance();

    // Save the process instance along with the task instance
    jbpmContext.save(processInstance);

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。