---
title: "(3)jBPM websale代码学习: home.jsp(启动流程）"
author: "hongsoft"
date: "2006-05-07T19:18:00Z"
tags: []
slug: "3-jbpm-websale-home-jsp"
draft: false
lastmod: "2006-05-07T19:18:00Z"
id: 287431
url: "https://hongsoft.iteye.com/blog/287431"
---

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