/*
* JBoss, Home of Professional Open Source
* Copyright 2005, JBoss Inc., and individual contributors as indicated
* by the @authors tag. See the copyright.txt in the distribution for a
* full listing of individual contributors.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not, write to the Free
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
*/
package org.jbpm.pvm.internal.model;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.Set;
import java.util.StringTokenizer;
import org.hibernate.Session;
import org.jbpm.api.Execution;
import org.jbpm.api.JbpmException;
import org.jbpm.api.activity.ActivityExecution;
import org.jbpm.api.cmd.Environment;
import org.jbpm.api.job.Job;
import org.jbpm.api.job.Timer;
import org.jbpm.api.listener.EventListenerExecution;
import org.jbpm.api.model.Event;
import org.jbpm.api.model.OpenExecution;
import org.jbpm.api.task.Assignable;
import org.jbpm.api.task.AssignmentHandler;
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.client.ClientProcessDefinition;
import org.jbpm.pvm.internal.client.ClientProcessInstance;
import org.jbpm.pvm.internal.env.Context;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.ExecutionContext;
import org.jbpm.pvm.internal.history.HistoryEvent;
import org.jbpm.pvm.internal.history.events.ActivityEnd;
import org.jbpm.pvm.internal.history.events.ActivityStart;
import org.jbpm.pvm.internal.history.events.AutomaticEnd;
import org.jbpm.pvm.internal.history.events.DecisionEnd;
import org.jbpm.pvm.internal.history.events.ProcessInstanceCreate;
import org.jbpm.pvm.internal.history.events.ProcessInstanceEnd;
import org.jbpm.pvm.internal.id.DbidGenerator;
import org.jbpm.pvm.internal.id.IdComposer;
import org.jbpm.pvm.internal.job.JobImpl;
import org.jbpm.pvm.internal.job.MessageImpl;
import org.jbpm.pvm.internal.model.op.AtomicOperation;
import org.jbpm.pvm.internal.model.op.MoveToChildActivity;
import org.jbpm.pvm.internal.model.op.Signal;
import org.jbpm.pvm.internal.script.ScriptManager;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.session.MessageSession;
import org.jbpm.pvm.internal.session.RepositorySession;
import org.jbpm.pvm.internal.session.TimerSession;
import org.jbpm.pvm.internal.task.AssignableDefinitionImpl;
import org.jbpm.pvm.internal.task.SwimlaneDefinitionImpl;
import org.jbpm.pvm.internal.task.SwimlaneImpl;
import org.jbpm.pvm.internal.type.Variable;
import org.jbpm.pvm.internal.util.EqualsUtil;
import org.jbpm.pvm.internal.util.Priority;
import org.jbpm.pvm.internal.wire.usercode.UserCodeReference;
/**
* @author Tom Baeyens
*/
public class ExecutionImpl extends ScopeInstanceImpl
implements ClientProcessInstance,
ActivityExecution,
EventListenerExecution,
Serializable {
private static final long serialVersionUID = 1L;
private static final Log log = Log.getLog(ExecutionImpl.class.getName());
/** an optional name for this execution. can be used to
* differentiate concurrent paths of execution like e.g.
* the 'shipping' and 'billing' paths. */
protected String name;
/** a key for this execution. typically this is an externally provided reference
* that is unique within the scope of the process definition. */
protected String key;
/** a unique id for this execution. */
protected String id;
/** are concurrent executions that related to this execution. */
protected Collection<ExecutionImpl> executions = new ArrayList<ExecutionImpl>();
/** the parent child relation of executions is convenient for some forms of
* concurrency. */
protected ExecutionImpl parent = null;
protected ExecutionImpl processInstance;
/** the super process link in case this is a sub process execution */
protected ExecutionImpl superProcessExecution;
/** the sub process link in case of sub process execution */
protected ExecutionImpl subProcessInstance;
/** swimlanes */
protected Map<String, SwimlaneImpl> swimlanes = new HashMap<String, SwimlaneImpl>();
/** reference to the current activity instance history record */
protected Long historyActivityInstanceDbid;
/** start time of the activity for history purposes (not persisted) */
protected Date historyActivityStart;
protected int priority = Priority.NORMAL;
protected Map<String, Variable> systemVariables = new HashMap<String, Variable>();
// persistent indicators of the current position ////////////////////////////
/** persistent process definition reference */
protected String processDefinitionId;
/** persistent activity reference */
protected String activityName;
// transient cached indicators of the current position //////////////////////
/** transient cached process definition. persistence is managed in {@link #processDefinitionId} */
protected ProcessDefinitionImpl processDefinition;
/** transient cached current activity pointer. persistence is managed in {@link #activityName} */
private ActivityImpl activity;
/** transition is not to be made persistable by default */
protected TransitionImpl transition;
protected EventImpl event;
protected AtomicOperation eventCompletedOperation;
protected int eventListenerIndex;
protected ObservableElementImpl eventSource;
// cached named executions //////////////////////////////////////////////////
/** caches the child executions by execution name. This member might be
* null and is only created from the executions in case its needed. Note
* that not all executions are forced to have a name and duplicates are allowed.
* In case the {@link #executions} change, the executionsMap can be nulled or
* also updated (but a check needs to be added whether it exists). */
protected transient Map<String, Execution> executionsMap = null;
/** the queue of atomic operations to be performed for this execution. */
protected Queue<AtomicOperation> atomicOperations;
public enum Propagation {
UNSPECIFIED, WAIT, EXPLICIT
}
protected Propagation propagation = null;
// construction /////////////////////////////////////////////////////////////
public void initializeProcessInstance(ProcessDefinitionImpl processDefinition, String key) {
setProcessDefinition(processDefinition);
setActivity ( (ActivityImpl) processDefinition.getInitial() );
this.processInstance = this;
this.state = STATE_CREATED;
this.key = key;
save();
composeIds();
HistoryEvent.fire(new ProcessInstanceCreate(), this);
}
protected void save() {
this.dbid = DbidGenerator.getDbidGenerator().getNextId();
DbSession dbSession = EnvironmentImpl.getFromCurrent(DbSession.class, false);
if (dbSession!=null) {
dbSession.save(this);
}
}
protected void composeIds() {
this.id = IdComposer.getIdComposer().createId(processDefinition, parent, this);
}
// execution method : start /////////////////////////////////////////////////
public
没有合适的资源?快使用搜索试试~ 我知道了~
jbpm流程引擎框架源码
共744个文件
java:699个
xml:21个
html:18个
需积分: 13 10 下载量 150 浏览量
2011-08-09
16:58:52
上传
评论
收藏 923KB RAR 举报
温馨提示
jbpm流程引擎框架源码,一套流行的流程引擎框架代码
资源推荐
资源详情
资源评论
收起资源包目录
jbpm流程引擎框架源码 (744个子文件)
wirecontext.gif 5KB
environment.gif 4KB
package.html 1KB
package.html 279B
package.html 206B
package.html 196B
package.html 146B
package.html 135B
package.html 130B
package.html 117B
package.html 112B
package.html 102B
package.html 92B
package.html 77B
package.html 73B
package.html 71B
package.html 69B
package.html 50B
package.html 46B
package.html 39B
ExecutionImpl.java 43KB
JpdlParser.java 30KB
WireContext.java 27KB
DomBuilder.java 25KB
Parser.java 20KB
ObjectDescriptor.java 17KB
XmlUtil.java 17KB
DOMWriter.java 16KB
DbSessionImpl.java 16KB
XPathScriptEngine.java 15KB
ActivityImpl.java 15KB
GroovyScriptEngine.java 15KB
MailProducerImpl.java 14KB
JBossIdmIdentitySessionImpl.java 14KB
TaskImpl.java 13KB
JbpmTestCase.java 12KB
JmsActivity.java 12KB
DeploymentImpl.java 12KB
ScopeInstanceImpl.java 12KB
HibernateConfigurationDescriptor.java 11KB
ReflectUtil.java 11KB
WireParser.java 11KB
ProcessEngineImpl.java 11KB
BshScriptEngine.java 11KB
ExceptionHandlerImpl.java 10KB
EnvironmentImpl.java 10KB
Execution.java 10KB
JmsExtensions.java 9KB
ScriptContextEngineView.java 9KB
HibernateConfigurationBinding.java 9KB
ProcessDeployer.java 9KB
Parse.java 9KB
BusinessCalendarImpl.java 8KB
JuelScriptEngine.java 8KB
Duration.java 8KB
TaskService.java 8KB
RepositorySessionImpl.java 8KB
BusinessCalendarBinding.java 8KB
ClientExecution.java 8KB
TypesBinding.java 8KB
JpdlDeployer.java 8KB
StandardTransaction.java 8KB
TaskServiceImpl.java 7KB
JobExecutor.java 7KB
SubscribeOperation.java 7KB
ExecuteEventListenerMessage.java 7KB
Db.java 7KB
PropertyImpl.java 7KB
TaskActivity.java 7KB
SubProcessActivity.java 7KB
WireDefinition.java 7KB
ProcessDefinitionQueryImpl.java 7KB
ExecutionService.java 7KB
ExecutionServiceImpl.java 7KB
ConfigurationImpl.java 7KB
SubProcessBinding.java 7KB
ObjectBinding.java 7KB
DispatcherThread.java 6KB
ProcessDefinitionImpl.java 6KB
IdentitySessionImpl.java 6KB
TaskQueryImpl.java 6KB
InstanceMigrator.java 6KB
InitializePropertiesCmd.java 6KB
TimerImpl.java 6KB
MailTemplateBinding.java 6KB
MailSessionBinding.java 6KB
JobImpl.java 6KB
QueryAssertions.java 6KB
ProblemList.java 5KB
Variable.java 5KB
ExecuteEventListener.java 5KB
VersionTimestampPolicy.java 5KB
JtaTransaction.java 5KB
OpenExecution.java 5KB
ScriptManager.java 5KB
ConfigurationParser.java 5KB
GroovyScriptEngineFactory.java 5KB
AbstractQuery.java 5KB
HistoryTaskImpl.java 5KB
CompositeBuilder.java 5KB
共 744 条
- 1
- 2
- 3
- 4
- 5
- 6
- 8
资源评论
li9581
- 粉丝: 10
- 资源: 12
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 功能强大的Java库,旨在简化与Milvus向量数据库的交互,为开发者提供类似MyBatis-Plus注解和方法调用的直观API
- ITK中基于B样条BSpline的可变形配准样例的输入输出图像
- 05-09 周四 vLLM的部署和实践
- WEB访问日志分析与入侵检测可视化系统源码(95分以上课设).zip
- UE4-UE5的官方预览模型
- 电子通信设计资料自动关断继电器驱动电路
- 基于Python使用递归和动态规划解决背包问题.zip
- 从0开始建立dSPACE RT Simulink工程:CAN通信(Bus Manager方法)DBC
- 轮胎X光缺陷检测数据集VOC+YOLO格式1903张4类别.zip
- 基于Matlab和遗传算法解决组合优化背包问题.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功