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

📄 cancelworkontaskcommand.java

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

import org.jbpm.JbpmContext;
import org.jbpm.taskmgmt.exe.TaskInstance;

/**
 * The current authorizes actor starts to work on the TaskInstance
 * so the actor is set to the given actor
 * 
 *  see some more information why we need that in the
 *  <a href="http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4018785">jbpm forum</a>	
 * 
 * @author Bernd Ruecker
 */
public class CancelWorkOnTaskCommand implements Command {

	private static final long serialVersionUID = -172457633891242288L;

	private long taskInstanceId;

	public CancelWorkOnTaskCommand(long taskInstanceId) {
		this.taskInstanceId = taskInstanceId;	
	}

	public CancelWorkOnTaskCommand() {		
	}
	
	public Object execute(JbpmContext jbpmContext) throws Exception {	
		TaskInstance ti = jbpmContext.getTaskInstance(taskInstanceId);
		ti.setActorId(null);
		ti.setStart(null);
		return null;
	}

	public long getTaskInstanceId() {
		return taskInstanceId;
	}

	public void setTaskInstanceId(long taskInstanceId) {
		this.taskInstanceId = taskInstanceId;
	}

}

⌨️ 快捷键说明

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