⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 startprocessinstancecommand.java

📁 workflow first jbpm
💻 JAVA
字号:
package org.jbpm.command;

import org.jbpm.JbpmContext;
import org.jbpm.graph.exe.ProcessInstance;

/**
 * Graph command to start a new process and signal it immidiatly.
 * The transition named in <code>startTransitionName</code> is used (or the default transition if it is null).
 * 
 * The result of this command, if requested, is a {@link Long} value containing
 * the process instance id.
 * 
 * @author Jim Rigsbee, Tom Baeyens, Bernd Ruecker
 */
public class StartProcessInstanceCommand extends NewProcessInstanceCommand
		implements Command {

	private static final long serialVersionUID = -2428234069404269048L;

	/**
	 * this transition name is used for signalling (if null, the default
	 * transition is used)
	 */
	private String startTransitionName = null;

	public Object execute(JbpmContext jbpmContext) throws Exception {
		Object object = super.execute(jbpmContext);
		if (object instanceof ProcessInstance) {
			ProcessInstance processInstance = (ProcessInstance) object;
			if (startTransitionName == null
					|| startTransitionName.length() == 0)
				processInstance.signal();
			else
				processInstance.signal(startTransitionName);
		}
		return object;
	}

	public String getStartTransitionName() {
		return startTransitionName;
	}

	public void setStartTransitionName(String startTransitionName) {
		this.startTransitionName = startTransitionName;
	}

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -