操作 类似操作 xml 节点
- package kaiyuansi;
- import java.util.List;
- import org.jbpm.JbpmConfiguration;
- import org.jbpm.JbpmContext;
- import org.jbpm.graph.def.Transition;
- import org.jbpm.taskmgmt.exe.TaskInstance;
- /**
- * 第二天的 获取任务节点的信息
- * @author Administrator
- *
- */
- public class ShowTask {
- public static void main(String[] args) {
- JbpmContext jbpmContext = JbpmConfiguration.getInstance().createJbpmContext();
- //根据用户名 取出任务列表
- List<TaskInstance> mm = jbpmContext.getTaskMgmtSession().findTaskInstances("mpconfig");
- System.out.println(mm.get(0).getActorId());
- long id = mm.get(0).getId();
- System.out.println(id);
- //得到对应的工作实例
- //JbpmContext jbpmContext = JbpmConfiguration.getInstance().createJbpmContext();
- //根据id获取任务实例
- TaskInstance ti = jbpmContext.getTaskInstance(id);
- //获取Transition
- Transition gg = (Transition) ti.getTask().getTaskNode().getLeavingTransitions().get(0);
- System.out.println(gg.getName());
- try {
- //System.out.println(trList.get(0).g);
- } catch (Exception e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- System.out.println("end");
- }
- }
转载于:https://blog.51cto.com/12772226/845371