/*
* 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.jbpm.api.Execution;
import org.jbpm.api.JbpmException;
import org.jbpm.api.activity.ActivityExecution;
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.Environment;
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.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;
/**
* @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;
IdGenerator idGenerator = processDefinition.getIdGenerator();
if (idGenerator!=null) {
this.id = idGenerator.createId(processDefinition, null, this);
}
HistoryEvent.fire(new ProcessInstanceCreate(), this);
}
// execution method : start /////////////////////////////////////////////////
public void start() {
if (!STATE_CREATED.equals(state)) {
throw new JbpmException(toString()+" is already begun: "+state);
}
this.state = STATE_ACTIVE_ROOT;
ExecutionImpl scopedExecution = initializeScopes();
fire(Event.START, getProcessDefinition());
if (getActivity()!=null) {
scopedExecution.performAtomicOperation(AtomicOperation.EXECUTE_ACTIVITY);
}
}
protected ExecutionImpl initializeScopes(
没有合适的资源?快使用搜索试试~ 我知道了~
资源详情
资源评论
资源推荐
收起资源包目录
jbpm4和spring整合例子 (1424个子文件)
ExecutionImpl.class 36KB
JpdlParser.class 25KB
ReflectUtil.class 15KB
DbSessionImpl.class 15KB
JBossIdmIdentitySessionImpl.class 14KB
WireContext.class 13KB
ObjectDescriptor.class 13KB
XmlUtil.class 13KB
TaskImpl.class 13KB
Parser.class 12KB
ScopeInstanceImpl.class 12KB
MailProducerImpl.class 12KB
ActivityImpl.class 11KB
ExceptionHandlerImpl.class 11KB
DeploymentImpl.class 11KB
DomBuilder.class 9KB
JbpmConfiguration.class 9KB
DOMWriter.class 9KB
SubProcessActivity.class 8KB
BusinessCalendar.class 8KB
HibernateConfigurationDescriptor.class 7KB
TaskServiceImpl.class 7KB
BusinessCalendarBinding.class 7KB
JuelScriptEngine.class 7KB
IdentitySessionImpl.class 7KB
HibernateConfigurationBinding.class 7KB
TypesBinding.class 7KB
TimerImpl.class 7KB
JpdlDeployer.class 7KB
ExecutionServiceImpl.class 7KB
JobExecutor.class 7KB
TaskActivity.class 7KB
RepositorySessionImpl.class 7KB
WireDefinition.class 7KB
SubscribeOperation.class 7KB
Parse.class 6KB
SubProcessBinding.class 6KB
CompositeBuilder.class 6KB
ProcessDefinitionImpl.class 6KB
TaskQueryImpl.class 6KB
ExecuteEventListenerMessage.class 6KB
Duration.class 6KB
DispatcherThread.class 6KB
IntegrationTestHelper.class 6KB
JobImpl.class 6KB
ProcessDefinitionQueryImpl.class 6KB
ObjectBinding.class 6KB
StandardTransaction.class 6KB
ExecutionType.class 6KB
Db.class 6KB
MailTemplateBinding.class 5KB
WireParser.class 5KB
JbpmDeployTask.class 5KB
TransitionImpl.class 5KB
BasicEnvironment.class 5KB
DecisionBinding.class 5KB
ActivityBuilder.class 5KB
MailSessionBinding.class 5KB
CollectionDescriptor.class 5KB
ExecuteEventListener.class 5KB
JtaTransaction.class 5KB
ProcessDefinitionBuilder.class 5KB
ExecuteJobCmd.class 4KB
HistoryTaskImpl.class 4KB
JoinActivity.class 4KB
ProblemList.class 4KB
PvmNamingStrategy.class 4KB
Variable.class 4KB
SwimlaneImpl.class 4KB
SpringConfiguration.class 4KB
HistoryActivityInstanceQueryImpl.class 4KB
LifeCycleParser.class 4KB
HistoryTaskQueryImpl.class 4KB
JbpmTestCase.class 4KB
ScriptManager.class 4KB
AcquireJobsCmd.class 4KB
IdentityServiceImpl.class 4KB
GroupActivity.class 4KB
JavaActivity.class 4KB
HibernateSessionDescriptor.class 4KB
DeleteDeploymentCmd.class 4KB
JobExceptionHandler.class 4KB
JpdlBinding.class 4KB
JbpmConfigurationParser.class 4KB
Environment.class 4KB
AbstractCollectionBinding.class 4KB
HqlActivity.class 4KB
EventImpl.class 4KB
MailTemplate.class 4KB
JuelScriptEngineFactory.class 4KB
DayPart.class 4KB
LifeCycle.class 4KB
AbstractQuery.class 4KB
MapBinding.class 4KB
ExecuteActivity.class 4KB
TimerBuilder.class 4KB
JobExecutorThread.class 4KB
HistoryProcessInstanceImpl.class 4KB
ConverterType.class 4KB
Configuration.class 4KB
共 1424 条
- 1
- 2
- 3
- 4
- 5
- 6
- 15
auqyvpl
- 粉丝: 4
- 资源: 6
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 第12章spring-mvc自定义类型转换器
- 基于PHP图书管理系统实验报告.docx
- Python爬取淘宝热卖商品并可视化分析
- 5152单片机proteus仿真和源码将按键次数写入AT24C02再读出并用1602LCD显示
- SE-SSD复现过程(Det3D的安装教程)
- 基于Python的在线学习与推荐系统设计与实现(论文+源码)-kaic
- 串口通过 YMODEM 协议进行文件传输
- 蓝桥杯2024年第十五届省赛真题-前缀总分
- com.qihoo.appstore_300101305-1.apk
- tensorflow-gpu-2.7.1-cp37-cp37m-manylinux2010-x86-64.whl
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
评论4