提交 39885ee8 编写于 作者: T tombaeyens

ACT-60 moving engine stuff from org.activiti.impl into org.activiti.engine.impl packages

上级 e10a436f
......@@ -4,7 +4,7 @@
package org.activiti.test.jobexecutor;
import org.activiti.engine.impl.ProcessEngineImpl;
import org.activiti.impl.cmd.DeleteJobsCmd;
import org.activiti.engine.impl.cmd.DeleteJobsCmd;
import org.activiti.impl.interceptor.Command;
import org.activiti.impl.interceptor.CommandContext;
import org.activiti.impl.interceptor.CommandExecutor;
......
......@@ -16,7 +16,7 @@
</property>
</bean>
<bean id="processEngine" class="org.activiti.impl.cfg.spring.ProcessEngineFactoryBean">
<bean id="processEngine" class="org.activiti.engine.impl.cfg.spring.ProcessEngineFactoryBean">
<property name="dataBaseName" value="${database}" />
<property name="dataSource" ref="dataSource" />
<property name="transactionManager" ref="transactionManager" />
......
......@@ -16,7 +16,7 @@ import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import org.activiti.impl.cfg.ProcessEngineConfiguration;
import org.activiti.engine.impl.cfg.ProcessEngineConfiguration;
/**
* builds a process engine based on a couple of simple properties.
......
......@@ -17,17 +17,17 @@ import java.util.List;
import org.activiti.engine.IdentityService;
import org.activiti.engine.identity.Group;
import org.activiti.engine.identity.User;
import org.activiti.impl.cmd.CheckPassword;
import org.activiti.impl.cmd.CreateMembershipCmd;
import org.activiti.impl.cmd.DeleteGroupCmd;
import org.activiti.impl.cmd.DeleteMembershipCmd;
import org.activiti.impl.cmd.DeleteUserCmd;
import org.activiti.impl.cmd.FindGroupCmd;
import org.activiti.impl.cmd.FindGroupsByUserCmd;
import org.activiti.impl.cmd.FindUserCmd;
import org.activiti.impl.cmd.FindUsersByGroupCmd;
import org.activiti.impl.cmd.SaveGroupCmd;
import org.activiti.impl.cmd.SaveUserCmd;
import org.activiti.engine.impl.cmd.CheckPassword;
import org.activiti.engine.impl.cmd.CreateMembershipCmd;
import org.activiti.engine.impl.cmd.DeleteGroupCmd;
import org.activiti.engine.impl.cmd.DeleteMembershipCmd;
import org.activiti.engine.impl.cmd.DeleteUserCmd;
import org.activiti.engine.impl.cmd.FindGroupCmd;
import org.activiti.engine.impl.cmd.FindGroupsByUserCmd;
import org.activiti.engine.impl.cmd.FindUserCmd;
import org.activiti.engine.impl.cmd.FindUsersByGroupCmd;
import org.activiti.engine.impl.cmd.SaveGroupCmd;
import org.activiti.engine.impl.cmd.SaveUserCmd;
import org.activiti.impl.identity.GroupImpl;
import org.activiti.impl.identity.UserImpl;
import org.activiti.impl.interceptor.CommandExecutor;
......
......@@ -18,8 +18,8 @@ import org.activiti.engine.JobQuery;
import org.activiti.engine.ManagementService;
import org.activiti.engine.TableMetaData;
import org.activiti.engine.TablePageQuery;
import org.activiti.impl.cmd.GetTableCountCmd;
import org.activiti.impl.cmd.GetTableMetaDataCmd;
import org.activiti.engine.impl.cmd.GetTableCountCmd;
import org.activiti.engine.impl.cmd.GetTableMetaDataCmd;
import org.activiti.impl.interceptor.CommandExecutor;
import org.activiti.impl.job.JobQueryImpl;
import org.activiti.impl.query.TablePageQueryImpl;
......
......@@ -22,8 +22,8 @@ import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessService;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.TaskService;
import org.activiti.engine.impl.cfg.ProcessEngineConfiguration;
import org.activiti.engine.impl.persistence.db.DbSqlSessionFactory;
import org.activiti.impl.cfg.ProcessEngineConfiguration;
import org.activiti.impl.jobexecutor.JobExecutor;
import org.activiti.impl.persistence.PersistenceSessionFactory;
......
......@@ -19,15 +19,15 @@ import org.activiti.engine.Execution;
import org.activiti.engine.ProcessInstance;
import org.activiti.engine.ProcessInstanceQuery;
import org.activiti.engine.ProcessService;
import org.activiti.impl.cmd.DeleteProcessInstanceCmd;
import org.activiti.impl.cmd.FindExecutionCmd;
import org.activiti.impl.cmd.FindExecutionInActivityCmd;
import org.activiti.impl.cmd.FindProcessInstanceCmd;
import org.activiti.impl.cmd.GetExecutionVariableCmd;
import org.activiti.impl.cmd.GetExecutionVariablesCmd;
import org.activiti.impl.cmd.SendEventCmd;
import org.activiti.impl.cmd.SetExecutionVariablesCmd;
import org.activiti.impl.cmd.StartProcessInstanceCmd;
import org.activiti.engine.impl.cmd.DeleteProcessInstanceCmd;
import org.activiti.engine.impl.cmd.FindExecutionCmd;
import org.activiti.engine.impl.cmd.FindExecutionInActivityCmd;
import org.activiti.engine.impl.cmd.FindProcessInstanceCmd;
import org.activiti.engine.impl.cmd.GetExecutionVariableCmd;
import org.activiti.engine.impl.cmd.GetExecutionVariablesCmd;
import org.activiti.engine.impl.cmd.SendEventCmd;
import org.activiti.engine.impl.cmd.SetExecutionVariablesCmd;
import org.activiti.engine.impl.cmd.StartProcessInstanceCmd;
import org.activiti.impl.execution.ProcessInstanceQueryImpl;
/**
......
......@@ -20,15 +20,15 @@ import org.activiti.engine.Deployment;
import org.activiti.engine.DeploymentBuilder;
import org.activiti.engine.ProcessDefinition;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.impl.cmd.DeleteDeploymentCmd;
import org.activiti.engine.impl.cmd.DeployCmd;
import org.activiti.engine.impl.cmd.FindDeploymentResourcesCmd;
import org.activiti.engine.impl.cmd.FindDeploymentsCmd;
import org.activiti.engine.impl.cmd.FindProcessDefinitionCmd;
import org.activiti.engine.impl.cmd.FindProcessDefinitionsCmd;
import org.activiti.engine.impl.cmd.GetDeploymentResourceCmd;
import org.activiti.engine.impl.cmd.GetFormCmd;
import org.activiti.engine.impl.persistence.repository.DeploymentBuilderImpl;
import org.activiti.impl.cmd.DeleteDeploymentCmd;
import org.activiti.impl.cmd.DeployCmd;
import org.activiti.impl.cmd.FindDeploymentResourcesCmd;
import org.activiti.impl.cmd.FindDeploymentsCmd;
import org.activiti.impl.cmd.FindProcessDefinitionCmd;
import org.activiti.impl.cmd.FindProcessDefinitionsCmd;
import org.activiti.impl.cmd.GetDeploymentResourceCmd;
import org.activiti.impl.cmd.GetFormCmd;
/**
......
......@@ -12,8 +12,8 @@
*/
package org.activiti.engine.impl;
import org.activiti.impl.cfg.ProcessEngineConfiguration;
import org.activiti.impl.cfg.ProcessEngineConfigurationAware;
import org.activiti.engine.impl.cfg.ProcessEngineConfiguration;
import org.activiti.engine.impl.cfg.ProcessEngineConfigurationAware;
import org.activiti.impl.interceptor.CommandExecutor;
......
......@@ -19,14 +19,14 @@ import org.activiti.engine.Page;
import org.activiti.engine.Task;
import org.activiti.engine.TaskQuery;
import org.activiti.engine.TaskService;
import org.activiti.impl.cmd.AddTaskInvolvementCmd;
import org.activiti.impl.cmd.ClaimTaskCmd;
import org.activiti.impl.cmd.CompleteTaskCmd;
import org.activiti.impl.cmd.DeleteTaskCmd;
import org.activiti.impl.cmd.FindSingleTaskCmd;
import org.activiti.impl.cmd.GetFormCmd;
import org.activiti.impl.cmd.SaveTaskCmd;
import org.activiti.impl.cmd.SetTaskPriorityCmd;
import org.activiti.engine.impl.cmd.AddTaskInvolvementCmd;
import org.activiti.engine.impl.cmd.ClaimTaskCmd;
import org.activiti.engine.impl.cmd.CompleteTaskCmd;
import org.activiti.engine.impl.cmd.DeleteTaskCmd;
import org.activiti.engine.impl.cmd.FindSingleTaskCmd;
import org.activiti.engine.impl.cmd.GetFormCmd;
import org.activiti.engine.impl.cmd.SaveTaskCmd;
import org.activiti.engine.impl.cmd.SetTaskPriorityCmd;
import org.activiti.impl.interceptor.CommandExecutor;
import org.activiti.impl.task.TaskImpl;
import org.activiti.impl.task.TaskInvolvementType;
......
......@@ -20,13 +20,13 @@ import java.util.logging.Logger;
import org.activiti.engine.impl.bpmn.parser.BpmnParse;
import org.activiti.engine.impl.bpmn.parser.BpmnParser;
import org.activiti.engine.impl.calendar.BusinessCalendarManager;
import org.activiti.engine.impl.cfg.ProcessEngineConfiguration;
import org.activiti.engine.impl.cfg.ProcessEngineConfigurationAware;
import org.activiti.engine.impl.persistence.repository.Deployer;
import org.activiti.engine.impl.persistence.repository.DeploymentEntity;
import org.activiti.engine.impl.persistence.repository.ProcessDefinitionEntity;
import org.activiti.engine.impl.persistence.repository.ResourceEntity;
import org.activiti.impl.calendar.BusinessCalendarManager;
import org.activiti.impl.cfg.ProcessEngineConfiguration;
import org.activiti.impl.cfg.ProcessEngineConfigurationAware;
import org.activiti.impl.el.ExpressionManager;
import org.activiti.impl.scripting.ScriptingEngines;
......
......@@ -39,10 +39,10 @@ import org.activiti.engine.impl.bpmn.ServiceInvocationActivityBehaviour;
import org.activiti.engine.impl.bpmn.SubProcessActivity;
import org.activiti.engine.impl.bpmn.TaskActivity;
import org.activiti.engine.impl.bpmn.UserTaskActivity;
import org.activiti.engine.impl.calendar.BusinessCalendar;
import org.activiti.engine.impl.calendar.BusinessCalendarManager;
import org.activiti.engine.impl.calendar.DurationBusinessCalendar;
import org.activiti.engine.impl.persistence.repository.ProcessDefinitionEntity;
import org.activiti.impl.calendar.BusinessCalendar;
import org.activiti.impl.calendar.BusinessCalendarManager;
import org.activiti.impl.calendar.DurationBusinessCalendar;
import org.activiti.impl.definition.ActivityImpl;
import org.activiti.impl.definition.FormReference;
import org.activiti.impl.definition.ProcessDefinitionImpl;
......
......@@ -12,7 +12,7 @@
*/
package org.activiti.engine.impl.bpmn.parser;
import org.activiti.impl.calendar.BusinessCalendarManager;
import org.activiti.engine.impl.calendar.BusinessCalendarManager;
import org.activiti.impl.el.ExpressionManager;
import org.activiti.impl.scripting.ScriptingEngines;
import org.activiti.impl.xml.Parser;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.calendar;
package org.activiti.engine.impl.calendar;
import java.util.Date;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.calendar;
package org.activiti.engine.impl.calendar;
/**
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.calendar;
package org.activiti.engine.impl.calendar;
import java.util.Calendar;
import java.util.Date;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.calendar;
package org.activiti.engine.impl.calendar;
import java.util.Calendar;
import java.util.Date;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.calendar;
package org.activiti.engine.impl.calendar;
import java.util.HashMap;
import java.util.Map;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cfg;
package org.activiti.engine.impl.cfg;
import java.util.ArrayList;
import java.util.HashMap;
......@@ -36,14 +36,14 @@ import org.activiti.engine.impl.ProcessServiceImpl;
import org.activiti.engine.impl.RepositoryServiceImpl;
import org.activiti.engine.impl.TaskServiceImpl;
import org.activiti.engine.impl.bpmn.deployer.BpmnDeployer;
import org.activiti.engine.impl.calendar.BusinessCalendarManager;
import org.activiti.engine.impl.calendar.DurationBusinessCalendar;
import org.activiti.engine.impl.calendar.MapBusinessCalendarManager;
import org.activiti.engine.impl.persistence.RepositorySession;
import org.activiti.engine.impl.persistence.db.DbRepositorySessionFactory;
import org.activiti.engine.impl.persistence.db.DbSqlSession;
import org.activiti.engine.impl.persistence.db.DbSqlSessionFactory;
import org.activiti.engine.impl.persistence.repository.Deployer;
import org.activiti.impl.calendar.BusinessCalendarManager;
import org.activiti.impl.calendar.DurationBusinessCalendar;
import org.activiti.impl.calendar.MapBusinessCalendarManager;
import org.activiti.impl.db.IdGenerator;
import org.activiti.impl.el.ExpressionManager;
import org.activiti.impl.event.DefaultProcessEventBus;
......
......@@ -11,7 +11,7 @@
* limitations under the License.
*/
package org.activiti.impl.cfg.spring;
package org.activiti.engine.impl.cfg.spring;
import java.io.IOException;
import java.util.zip.ZipInputStream;
......@@ -26,7 +26,7 @@ import org.activiti.engine.IdentityService;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.RepositoryService;
import org.activiti.engine.impl.ProcessEngineImpl;
import org.activiti.impl.cfg.ProcessEngineConfiguration;
import org.activiti.engine.impl.cfg.ProcessEngineConfiguration;
import org.activiti.impl.db.IdGenerator;
import org.activiti.impl.interceptor.Command;
import org.activiti.impl.interceptor.CommandExecutor;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import org.activiti.engine.ActivitiException;
import org.activiti.impl.interceptor.CommandContext;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import org.activiti.impl.identity.UserImpl;
import org.activiti.impl.interceptor.Command;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import org.activiti.engine.ActivitiException;
import org.activiti.impl.interceptor.CommandContext;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import org.activiti.impl.interceptor.Command;
import org.activiti.impl.interceptor.CommandContext;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import java.util.Map;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import org.activiti.impl.interceptor.Command;
import org.activiti.impl.interceptor.CommandContext;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import org.activiti.engine.Task;
import org.activiti.impl.interceptor.Command;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import java.util.List;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import org.activiti.impl.interceptor.CommandContext;
......
......@@ -11,7 +11,7 @@
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import java.util.ArrayList;
import java.util.List;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import org.activiti.impl.interceptor.CommandContext;
import org.activiti.impl.persistence.PersistenceSession;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import org.activiti.impl.interceptor.CommandContext;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import org.activiti.engine.ActivitiException;
import org.activiti.impl.interceptor.CommandContext;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import org.activiti.impl.interceptor.CommandContext;
import org.activiti.impl.persistence.PersistenceSession;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import java.util.Arrays;
import java.util.Map;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import java.util.ArrayList;
import java.util.List;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import java.util.List;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import java.util.List;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import java.util.List;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import org.activiti.engine.Execution;
import org.activiti.impl.interceptor.Command;
......
......@@ -11,7 +11,7 @@
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import org.activiti.engine.Execution;
import org.activiti.impl.execution.ExecutionImpl;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import org.activiti.engine.identity.Group;
import org.activiti.impl.interceptor.Command;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import java.util.List;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import org.activiti.impl.definition.ProcessDefinitionImpl;
import org.activiti.impl.interceptor.Command;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import java.util.List;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import org.activiti.engine.ProcessInstance;
import org.activiti.impl.interceptor.Command;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import org.activiti.engine.Task;
import org.activiti.impl.interceptor.Command;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import java.util.List;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import org.activiti.engine.identity.User;
import org.activiti.impl.interceptor.Command;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import java.util.List;
......
......@@ -10,13 +10,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import org.activiti.engine.impl.persistence.repository.ResourceEntity;
import org.activiti.impl.bytes.ByteArrayImpl;
import org.activiti.engine.impl.persistence.runtime.ByteArrayImpl;
import org.activiti.impl.interceptor.Command;
import org.activiti.impl.interceptor.CommandContext;
import org.activiti.impl.persistence.PersistenceSession;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import org.activiti.impl.db.execution.DbExecutionImpl;
import org.activiti.impl.interceptor.Command;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import java.util.Map;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import org.activiti.engine.ActivitiException;
import org.activiti.engine.impl.persistence.RepositorySession;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import org.activiti.impl.db.DbidBlock;
import org.activiti.impl.interceptor.Command;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import java.util.Map;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import org.activiti.engine.TableMetaData;
import org.activiti.impl.interceptor.Command;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import org.activiti.impl.identity.GroupImpl;
import org.activiti.impl.interceptor.CommandContext;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import org.activiti.engine.Task;
import org.activiti.impl.interceptor.CommandContext;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import org.activiti.engine.identity.User;
import org.activiti.impl.identity.UserImpl;
......
......@@ -11,7 +11,7 @@
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import org.activiti.engine.ActivitiException;
import org.activiti.impl.db.execution.DbExecutionImpl;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import java.util.Map;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import org.activiti.engine.ActivitiException;
import org.activiti.impl.interceptor.CommandContext;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.cmd;
package org.activiti.engine.impl.cmd;
import java.util.Map;
......
......@@ -17,10 +17,10 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.activiti.engine.impl.cfg.ProcessEngineConfiguration;
import org.activiti.engine.impl.cfg.ProcessEngineConfigurationAware;
import org.activiti.engine.impl.persistence.repository.Deployer;
import org.activiti.engine.impl.persistence.repository.ProcessDefinitionEntity;
import org.activiti.impl.cfg.ProcessEngineConfiguration;
import org.activiti.impl.cfg.ProcessEngineConfigurationAware;
import org.activiti.impl.interceptor.SessionFactory;
import org.activiti.impl.tx.Session;
......
......@@ -26,9 +26,9 @@ import java.util.logging.Logger;
import org.activiti.engine.ActivitiException;
import org.activiti.engine.ActivitiWrongDbException;
import org.activiti.engine.ProcessEngine;
import org.activiti.engine.impl.cfg.ProcessEngineConfiguration;
import org.activiti.engine.impl.cfg.ProcessEngineConfigurationAware;
import org.activiti.engine.impl.util.ClassNameUtil;
import org.activiti.impl.cfg.ProcessEngineConfiguration;
import org.activiti.impl.cfg.ProcessEngineConfigurationAware;
import org.activiti.impl.db.IdGenerator;
import org.activiti.impl.interceptor.SessionFactory;
import org.activiti.impl.persistence.IbatisPersistenceSessionFactory;
......
......@@ -10,7 +10,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.bytes;
package org.activiti.engine.impl.persistence.runtime;
import java.io.Serializable;
......
......@@ -14,7 +14,7 @@
package org.activiti.engine.test;
import org.activiti.engine.impl.ProcessEngineImpl;
import org.activiti.impl.cfg.ProcessEngineConfiguration;
import org.activiti.engine.impl.cfg.ProcessEngineConfiguration;
import org.activiti.impl.util.LogUtil.ThreadLogMode;
......
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl;
import org.activiti.impl.json.JSONObject;
/**
* @author Tom Baeyens
*/
public interface Jsonnable {
JSONObject toJsonObject();
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.bpmn;
import org.activiti.engine.ActivitiException;
import org.activiti.pvm.ActivityExecution;
/**
* implementation of the boundary timer event logic.
*
* @author Joram Barrez
*/
public class BoundaryTimerEventActivity extends BpmnActivity {
protected boolean interrupting;
public void execute(ActivityExecution execution) throws Exception {
if (interrupting) {
leave(execution);
} else {
throw new ActivitiException("Non-interrupting boundary timer event not yet implemented");
}
}
public boolean isInterrupting() {
return interrupting;
}
public void setInterrupting(boolean interrupting) {
this.interrupting = interrupting;
}
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.bpmn;
import org.activiti.pvm.ActivityExecution;
import org.activiti.pvm.EventActivityBehavior;
/**
* superclass for all 'connectable' BPMN 2.0 process elements.
* This means that any subclass can be the source or target of a sequenceflow.
*
* Corresponds with the notion of the 'flownode' in BPMN 2.0.
*
* @author Joram Barrez
*/
public abstract class BpmnActivity implements EventActivityBehavior {
protected BpmnActivityBehavior bpmnActivityBehavior = new BpmnActivityBehavior();
/**
* Default behaviour: just leave the activity with no extra functionality.
*/
public void execute(ActivityExecution execution) throws Exception {
leave(execution);
}
/**
* Default way of leaving a BPMN 2.0 activity: evaluate the conditions on the
* outgoing sequence flow and take those that evaluate to true.
*/
protected void leave(ActivityExecution execution) {
bpmnActivityBehavior.performDefaultOutgoingBehavior(execution);
}
protected void leaveIgnoreConditions(ActivityExecution execution) {
bpmnActivityBehavior.performIgnoreConditionsOutgoingBehavior(execution);
}
public void event(ActivityExecution execution, Object event) throws Exception {
// Default behaviour: do nothing
}
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.bpmn;
import java.util.ArrayList;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.activiti.impl.execution.ConcurrencyController;
import org.activiti.pvm.ActivityExecution;
import org.activiti.pvm.Transition;
/**
* helper class for implementing BPMN 2.0 activities, offering convience methods
* specific to BPMN 2.0.
*
* This class can be used by inheritance or aggregation.
*
* @author Joram Barrez
*/
public class BpmnActivityBehavior {
private static Logger log = Logger.getLogger(BpmnActivityBehavior.class.getName());
/**
* Performs the default outgoing BPMN 2.0 behavior, which is having parallel
* paths of executions for the outgoing sequence flow.
*
* More precisely: every sequence flow that has a condition which evaluates to
* true (or which doesn't have a condition), is selected for continuation
* of the process instance. If multiple sequencer flow are selected,
* multiple, parallel paths of executions are created.
*/
public void performDefaultOutgoingBehavior(ActivityExecution execution) {
performOutgoingBehavior(execution, true);
}
/**
* Performs the default outgoing BPMN 2.0 behavior (@see
* {@link #performDefaultOutgoingBehavior(ActivityExecution)}), but without
* checking the conditions on the outgoing sequence flow.
*
* This means that every outgoing sequence flow is selected for continuing the
* process instance, regardless of having a condition or not. In case of
* multiple outgoing sequence flow, multiple parallel paths of executions will
* be created.
*/
public void performIgnoreConditionsOutgoingBehavior(ActivityExecution execution) {
performOutgoingBehavior(execution, false);
}
/**
* Actual implementation of leaving an activity.
*/
protected void performOutgoingBehavior(ActivityExecution execution, boolean checkConditions) {
if (log.isLoggable(Level.FINE)) {
log.fine("Leaving activity '" + execution.getActivity().getId() + "'");
}
List<Transition> outgoingTransitions = execution.getOutgoingTransitions();
if (outgoingTransitions.size() == 1) {
execution.take(outgoingTransitions.get(0));
} else if (outgoingTransitions.size() > 1) {
ConcurrencyController concurrencyController = new ConcurrencyController(execution);
concurrencyController.inactivate();
List<ActivityExecution> joinedExecutions = new ArrayList<ActivityExecution>();
joinedExecutions.add(execution);
List<Transition> transitionsToTake = new ArrayList<Transition>();
for (Transition outgoingTransition: outgoingTransitions) {
if (outgoingTransition.getCondition() == null
|| !checkConditions
|| outgoingTransition.getCondition().evaluate(execution)) {
transitionsToTake.add(outgoingTransition);
}
}
concurrencyController.takeAll(transitionsToTake, joinedExecutions);
} else {
if (log.isLoggable(Level.FINE)) {
log.fine("No outgoing sequence flow found for " + execution.getActivity().getId()
+ ". Ending execution.");
}
execution.end();
}
}
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.bpmn;
import java.io.ByteArrayInputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
import org.activiti.engine.impl.persistence.repository.Deployer;
import org.activiti.engine.impl.persistence.repository.DeploymentEntity;
import org.activiti.engine.impl.persistence.repository.ProcessDefinitionEntity;
import org.activiti.engine.impl.persistence.repository.ResourceEntity;
import org.activiti.impl.bpmn.parser.BpmnParse;
import org.activiti.impl.bpmn.parser.BpmnParser;
import org.activiti.impl.calendar.BusinessCalendarManager;
import org.activiti.impl.cfg.ProcessEngineConfiguration;
import org.activiti.impl.cfg.ProcessEngineConfigurationAware;
import org.activiti.impl.el.ExpressionManager;
import org.activiti.impl.scripting.ScriptingEngines;
/**
* @author Tom Baeyens
*/
public class BpmnDeployer implements Deployer, ProcessEngineConfigurationAware {
private static final Logger LOG = Logger.getLogger(BpmnDeployer.class.getName());;
public static final String BPMN_RESOURCE_SUFFIX = "bpmn20.xml";
protected ExpressionManager expressionManager;
protected ScriptingEngines scriptingEngines;
protected BusinessCalendarManager businessCalendarManager;
public void configurationCompleted(ProcessEngineConfiguration processEngineConfiguration) {
this.expressionManager = processEngineConfiguration.getExpressionManager();
this.scriptingEngines = processEngineConfiguration.getScriptingEngines();
this.businessCalendarManager = processEngineConfiguration.getBusinessCalendarManager();
}
public List<ProcessDefinitionEntity> deploy(DeploymentEntity deployment) {
List<ProcessDefinitionEntity> processDefinitions = new ArrayList<ProcessDefinitionEntity>();
Map<String, ResourceEntity> resources = deployment.getResources();
for (String resourceName : resources.keySet()) {
LOG.info("Processing resource " + resourceName);
if (resourceName.endsWith(BPMN_RESOURCE_SUFFIX)) {
ResourceEntity resource = resources.get(resourceName);
byte[] bytes = resource.getBytes();
ByteArrayInputStream inputStream = new ByteArrayInputStream(bytes);
BpmnParse bpmnParse = new BpmnParser(expressionManager, scriptingEngines, businessCalendarManager)
.createParse()
.processDefinitionClass(ProcessDefinitionEntity.class)
.sourceInputStream(inputStream)
.execute();
processDefinitions.addAll(bpmnParse.getProcessDefinitions());
}
}
return processDefinitions;
}
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.bpmn;
import java.util.Collection;
import java.util.HashMap;
import java.util.Map;
/**
* An Interface defines a set of operations that are implemented by services
* external to the process.
*
* @author Joram Barrez
*/
public class BpmnInterface {
protected String id;
protected String name;
/**
* Mapping of the operations of this interface.
* The key of the map is the id of the operation, for easy retrieval.
*/
protected Map<String, Operation> operations = new HashMap<String, Operation>();
public BpmnInterface() {
}
public BpmnInterface(String id, String name) {
setId(id);
setName(name);
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public void addOperation(Operation operation) {
operations.put(operation.getId(), operation);
}
public Operation getOperation(String operationId) {
return operations.get(operationId);
}
public Collection<Operation> getOperations() {
return operations.values();
}
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.bpmn;
import org.activiti.engine.impl.persistence.RepositorySession;
import org.activiti.impl.definition.ProcessDefinitionImpl;
import org.activiti.impl.interceptor.CommandContext;
import org.activiti.impl.persistence.PersistenceSession;
import org.activiti.pvm.ActivityExecution;
import org.activiti.pvm.ObjectProcessInstance;
/**
* Implementation of the BPMN 2.0 call activity
* (limited currently to calling a subprocess and not (yet) a global task).
*
* @author Joram Barrez
*/
public class CallActivityBehaviour extends BpmnActivity {
protected String processDefinitonKey;
public CallActivityBehaviour(String processDefinitionKey) {
this.processDefinitonKey = processDefinitionKey;
}
public void execute(ActivityExecution execution) throws Exception {
RepositorySession repositorySession = CommandContext.getCurrent().getRepositorySession();
ProcessDefinitionImpl processDefinition = repositorySession.findDeployedLatestProcessDefinitionByKey(processDefinitonKey);
ObjectProcessInstance processInstance = execution.createSubProcessInstance(processDefinition);
processInstance.start();
}
public void event(ActivityExecution execution, Object event) throws Exception {
leave(execution);
}
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.bpmn;
import java.util.Iterator;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.activiti.engine.ActivitiException;
import org.activiti.pvm.ActivityExecution;
import org.activiti.pvm.Condition;
import org.activiti.pvm.Transition;
/**
* implementation of the Exclusive Gateway/XOR gateway/exclusive data=based gateway
* as defined in the BPMN specification.
*
* @author Joram Barrez
*/
public class ExclusiveGatewayActivity extends GatewayActivity {
private static Logger log = Logger.getLogger(ExclusiveGatewayActivity.class.getName());
/**
* The default behaviour of BPMN, taking every outgoing sequence flow
* (where the condition evaluates to true), is not valid for an exclusive
* gateway.
*
* Hence, this behaviour is overriden and replaced by the correct behavior:
* selecting the first sequence flow which condition evaluates to true
* (or which hasn't got a condition) and leaving the activity through that
* sequence flow.
*/
@Override
protected void leave(ActivityExecution execution) {
if (log.isLoggable(Level.FINE)) {
log.fine("Leaving activity '" + execution.getActivity().getId() + "'");
}
Transition outgoingSeqFlow = null;
Iterator<Transition> seqFlowIterator = execution.getOutgoingTransitions().iterator();
while (outgoingSeqFlow == null && seqFlowIterator.hasNext()) {
Transition seqFlow = seqFlowIterator.next();
Condition condition = seqFlow.getCondition();
if ( condition==null || condition.evaluate(execution) ) {
if (log.isLoggable(Level.FINE)) {
log.fine("Sequence flow '" + seqFlow.getId() + " '"
+ "selected as outgoing sequence flow.");
}
outgoingSeqFlow = seqFlow;
}
}
if (outgoingSeqFlow != null) {
execution.take(outgoingSeqFlow);
} else {
//No sequence flow could be found
throw new ActivitiException("No outgoing sequence flow of the exclusive gateway '"
+ execution.getActivity().getId() + "' could be selected for continuing the process");
}
}
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.bpmn;
/**
* super class for all gateway activity implementations.
*
* @author Joram Barrez
*/
public abstract class GatewayActivity extends BpmnActivity {
// TODO: implement diverging/converging
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.bpmn;
/**
* Implementation of the BPMN 2.0 'manual task': a task that is external to the
* BPMS and to which there is no reference to IT systems whatsoever.
*
* Given this definition, this activity will behave simply as a pass-though step
* in the process.
*
* @author Joram Barrez
*/
public class ManualTaskActivity extends TaskActivity {
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.bpmn;
import org.activiti.impl.definition.ActivityImpl;
import org.activiti.pvm.ActivityExecution;
/**
* @author Joram Barrez
*/
public class NoneEndEventActivity extends BpmnActivity {
public void execute(ActivityExecution execution) throws Exception {
// TODO: needs cleanup!
ActivityImpl currentActivity = (ActivityImpl) execution.getActivity();
ActivityImpl parentActivity = (ActivityImpl) currentActivity.getParentActivity();
if (parentActivity != null &&
parentActivity.getActivityBehavior() instanceof SubProcessActivity) {
// No need to end the execution, see ExecutionImpl.destroyScope
execution.setActivity(parentActivity);
leave(execution);
} else {
// Need to locally store the parent, since end() will remove the child-parent relation
ActivityExecution parent = execution.getParent();
execution.end();
// Special case for BPMN 2.0: when the parent is a process instance,
// but is not more active and has no children anymore
// Then the process instance cannot continue anymore:
//
// eg. start -> fork -> task1 -> end1
// -> task2 -> end2
if (parent != null
&& parent.isProcessInstance()
&& parent.getExecutions().isEmpty()
&& !parent.isActive()) {
parent.end();
}
}
}
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.bpmn;
/**
* implementation of the 'none start event': a start event that has no
* specific trigger but the programmatic one (processService.startProcessInstanceXXX()).
*
*
* @author Joram Barrez
*/
public class NoneStartEventActivity extends BpmnActivity {
// Nothing to see here.
// The default behaviour of the BpmnActivity is exactly what
// a none start event should be doing.
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.bpmn;
/**
* An Operation is part of an {@link BpmnInterface} and it defines Messages that are consumed and
* (optionally) produced when the Operation is called.
*
* @author Joram Barrez
*/
public class Operation {
protected String id;
protected String name;
/**
* The interface to which this operations belongs
*/
protected BpmnInterface bpmnInterface;
public Operation() {
}
public Operation(String id, String name, BpmnInterface bpmnInterface) {
setId(id);
setName(name);
setInterface(bpmnInterface);
}
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public BpmnInterface getInterface() {
return bpmnInterface;
}
public void setInterface(BpmnInterface bpmnInterface) {
this.bpmnInterface = bpmnInterface;
}
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.bpmn;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.activiti.impl.execution.ConcurrencyController;
import org.activiti.pvm.Activity;
import org.activiti.pvm.ActivityExecution;
/**
* Implementation of the Parallel Gateway/AND gateway as definined in the BPMN
* 2.0 specification.
*
* The Parallel Gateway can be used for splitting a path of execution into
* multiple paths of executions (AND-split/fork behavior), one for every
* outgoing sequence flow.
*
* The Parallel Gateway can also be used for merging or joining paths of
* execution (AND-join). In this case, on every incoming sequence flow an
* execution needs to arrive, before leaving the Parallel Gateway (and
* potentially then doing the fork behavior in case of multiple outgoing
* sequence flow).
*
* Note that a Parallel Gateway having one incoming and multiple ougoing
* sequence flow, is the same as having multiple outgoing sequence flow on a
* given activity. However, a parallel gateway does NOT check conditions on the
* outgoing sequence flow.
*
* @author Joram Barrez
* @author Tom Baeyens
*/
public class ParallelGatewayActivity extends GatewayActivity {
private static Logger log = Logger.getLogger(ParallelGatewayActivity.class.getName());
public void execute(ActivityExecution execution) throws Exception {
Activity activity = execution.getActivity();
ConcurrencyController concurrencyController = new ConcurrencyController(execution);
concurrencyController.inactivate();
List<ActivityExecution> joinedExecutions = concurrencyController.findInactiveConcurrentExecutions(activity);
int nbrOfExecutionsToJoin = execution.getIncomingTransitions().size();
int nbrOfExecutionsJoined = joinedExecutions.size();
if (nbrOfExecutionsJoined==nbrOfExecutionsToJoin) {
log.fine("parallel gateway '"+activity.getId()+"' activates: "+nbrOfExecutionsJoined+" of "+nbrOfExecutionsToJoin+" joined");
concurrencyController.takeAll(execution.getOutgoingTransitions(), joinedExecutions);
} else if (log.isLoggable(Level.FINE)){
log.fine("parallel gateway '"+activity.getId()+"' does not activate: "+nbrOfExecutionsJoined+" of "+nbrOfExecutionsToJoin+" joined");
}
}
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.bpmn;
import org.activiti.engine.ProcessService;
import org.activiti.pvm.ActivityExecution;
/**
* A receive task is a wait state that waits for the receival of some message.
*
* Currently, the only message that is supported is the external trigger,
* given by calling the {@link ProcessService#sendEvent(String)} operation.
*
* @author Joram Barrez
*/
public class ReceiveTaskActivity extends TaskActivity {
public void execute(ActivityExecution execution) throws Exception {
// Do nothing: waitstate behavior
}
public void event(ActivityExecution execution, Object event) throws Exception {
leave(execution);
}
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.bpmn;
import org.activiti.impl.execution.ExecutionImpl;
import org.activiti.impl.scripting.ScriptingEngines;
import org.activiti.pvm.ActivityExecution;
/**
* activity implementation of the BPMN 2.0 script task.
*
* @author Joram Barrez
*/
public class ScriptTaskActivity extends TaskActivity {
private final String script;
private final String language;
private final ScriptingEngines scriptingEngines;
public ScriptTaskActivity(ScriptingEngines scriptingEngines, String script, String language) {
this.scriptingEngines = scriptingEngines;
this.script = script;
this.language = language;
}
public void execute(ActivityExecution execution) throws Exception {
scriptingEngines.evaluate(script, language, (ExecutionImpl) execution);
leave(execution);
}
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.bpmn;
import org.activiti.engine.ActivitiException;
import org.activiti.impl.el.ActivitiValueExpression;
import org.activiti.impl.execution.ExecutionImpl;
import org.activiti.impl.util.ReflectUtil;
import org.activiti.pvm.ActivityBehavior;
import org.activiti.pvm.ActivityExecution;
/**
* @author dsyer
*/
public class ServiceInvocationActivityBehaviour implements ActivityBehavior {
private final ActivitiValueExpression expression;
public ServiceInvocationActivityBehaviour(ActivitiValueExpression expression) {
this.expression = expression;
}
public void execute(ActivityExecution execution) throws Exception {
// FIXME: downcast
Object object = expression.getValue((ExecutionImpl) execution);
if (object instanceof String) {
String className = (String) object;
if (className != null) {
object = ReflectUtil.instantiate(className);
}
}
if (object instanceof ActivityBehavior) {
((ActivityBehavior) object).execute(execution);
} else {
throw new ActivitiException("Service " + object + " is used in a serviceTask, but does not" + " implement the "
+ ActivityBehavior.class.getCanonicalName() + " interface");
}
}
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.bpmn;
import org.activiti.impl.definition.ActivityImpl;
import org.activiti.pvm.Activity;
import org.activiti.pvm.ActivityExecution;
/**
* Implementation of the BPMN 2.0 subprocess (formely know as 'embedded' subprocess):
* a subprocess defined within another process definition.
*
* @author Joram Barrez
*/
public class SubProcessActivity extends BpmnActivity {
public void execute(ActivityExecution execution) throws Exception {
Activity activity = execution.getActivity();
ActivityImpl initialActivity = ((ActivityImpl) activity).getInitial();
execution.setActivity(initialActivity);
initialActivity.getActivityBehavior().execute(execution);
}
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.bpmn;
/**
* Parent class for all BPMN 2.0 task types such as ServiceTask, ScriptTask, UserTask, etc.
*
* When used on its own, it behaves just as a pass-through activity.
*
* @author Joram Barrez
*/
public class TaskActivity extends BpmnActivity {
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.bpmn;
import org.activiti.impl.el.ExpressionManager;
import org.activiti.impl.execution.ExecutionImpl;
import org.activiti.impl.task.TaskDefinition;
import org.activiti.impl.task.TaskImpl;
import org.activiti.pvm.ActivityExecution;
/**
* activity implementation for the user task.
*
* @author Joram Barrez
*/
public class UserTaskActivity extends TaskActivity {
private final TaskDefinition taskDefinition;
private final ExpressionManager expressionManager;
public UserTaskActivity(ExpressionManager expressionManager, TaskDefinition taskDefinition) {
this.expressionManager = expressionManager;
this.taskDefinition = taskDefinition;
}
public void execute(ActivityExecution execution) throws Exception {
TaskImpl task = TaskImpl.createAndInsert();
task.setExecution(execution);
if (taskDefinition.getName() != null) {
String name = evaluateExpression(taskDefinition.getName(), execution);
task.setName(name);
}
if (taskDefinition.getDescription() != null) {
String description = evaluateExpression(taskDefinition.getDescription(), execution);
task.setDescription(description);
}
handleAssignments(task, execution);
}
public void event(ActivityExecution execution, Object event) throws Exception {
leave(execution);
}
protected void handleAssignments(TaskImpl task, ActivityExecution execution) {
if (taskDefinition.getAssignee() != null) {
task.setAssignee(evaluateExpression(taskDefinition.getAssignee(), execution));
}
if (!taskDefinition.getCandidateGroupIds().isEmpty()) {
for (String groupId : taskDefinition.getCandidateGroupIds()) {
task.addCandidateGroup(evaluateExpression(groupId, execution));
}
}
if (!taskDefinition.getCandidateUserIds().isEmpty()) {
for (String userId : taskDefinition.getCandidateUserIds()) {
task.addCandidateUser(evaluateExpression(userId, execution));
}
}
}
protected String evaluateExpression(String expr, ActivityExecution execution) {
// FIXME: downcast
return (String) expressionManager.createValueExpression(expr).getValue((ExecutionImpl) execution);
}
}
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.activiti.impl.db;
import java.io.InputStream;
import java.sql.Connection;
import java.sql.Statement;
import java.util.StringTokenizer;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.activiti.engine.ActivitiException;
import org.activiti.engine.ActivitiWrongDbException;
import org.activiti.engine.ProcessEngine;
import org.activiti.impl.util.IoUtil;
import org.apache.ibatis.session.ExecutorType;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
/**
* Wrapper around various core SQL Database functions,
* such as creating and upgrading schemas.
* Note that this class is likely to undergo a lot of
* work as we move to supporting multiple databases,
* and again as we support cloud storage.
* @author Tom Baeyens
*/
public class Db {
private static Logger log = Logger.getLogger(Db.class.getName());
public static void dbSchemaCreate(SqlSessionFactory sqlSessionFactory) {
executeSchemaResource("create", sqlSessionFactory);
log.fine("activiti db schema creation successful");
}
public static void dbSchemaCheckVersion(SqlSessionFactory sqlSessionFactory) {
SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH); // Not quite sure if this is the right setting? We do want multiple updates to be batched for performance ...
boolean success = false;
try {
String dbVersion = (String) sqlSession.selectOne("selectDbSchemaVersion");
if (!ProcessEngine.VERSION.equals(dbVersion)) {
throw new ActivitiWrongDbException(ProcessEngine.VERSION, dbVersion);
}
success = true;
} catch(Exception e) {
String exceptionMessage = e.getMessage();
if ( (exceptionMessage.indexOf("Table")!=-1)
&& (exceptionMessage.indexOf("not found")!=-1)
) {
throw new ActivitiException("no activiti tables in db. set property 'db.schema.strategy' to value 'create-drop' in activiti.properties for automatic schema creation", e);
} else {
if (e instanceof RuntimeException) {
throw (RuntimeException) e;
} else {
throw new ActivitiException("couldn't get db schema version", e);
}
}
} finally {
if (success) {
sqlSession.commit(true);
} else {
sqlSession.rollback(true);
}
sqlSession.close();
}
log.fine("activiti db schema check successful");
}
public static void dbSchemaDrop(SqlSessionFactory sqlSessionFactory) {
executeSchemaResource("drop", sqlSessionFactory);
}
public static void executeSchemaResource(String operation, SqlSessionFactory sqlSessionFactory) {
SqlSession sqlSession = sqlSessionFactory.openSession(ExecutorType.BATCH); // Not quite sure if this is the right setting? We do want multiple updates to be batched for performance ...
boolean success = false;
try {
Connection connection = sqlSession.getConnection();
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
String resource = "org/activiti/db/"+operation+"/activiti.h2."+operation+".sql";
InputStream inputStream = classLoader.getResourceAsStream(resource);
if (inputStream==null) {
throw new ActivitiException("resource '"+resource+"' is not available for creating the schema");
}
Exception exception = null;
byte[] bytes = IoUtil.readInputStream(inputStream, resource);
String ddlStatements = new String(bytes);
StringTokenizer tokenizer = new StringTokenizer(ddlStatements, ";");
while (tokenizer.hasMoreTokens()) {
String ddlStatement = tokenizer.nextToken().trim();
if (!ddlStatement.startsWith("#")) {
Statement jdbcStatement = connection.createStatement();
try {
log.fine("\n"+ddlStatement);
jdbcStatement.execute(ddlStatement);
jdbcStatement.close();
} catch (Exception e) {
if (exception==null) {
exception = e;
}
log.log(Level.SEVERE, "problem during schema "+operation+", statement '"+ddlStatement, e);
}
}
}
if (exception!=null) {
throw exception;
}
success = true;
} catch(Exception e) {
throw new ActivitiException("couldn't create db schema", e);
} finally {
if (success) {
sqlSession.commit(true);
} else {
sqlSession.rollback(true);
}
sqlSession.close();
}
log.fine("activiti db schema creation successful");
}
}
......@@ -12,9 +12,9 @@
*/
package org.activiti.impl.db;
import org.activiti.impl.cfg.ProcessEngineConfiguration;
import org.activiti.impl.cfg.ProcessEngineConfigurationAware;
import org.activiti.impl.cmd.GetNextDbidBlockCmd;
import org.activiti.engine.impl.cfg.ProcessEngineConfiguration;
import org.activiti.engine.impl.cfg.ProcessEngineConfigurationAware;
import org.activiti.engine.impl.cmd.GetNextDbidBlockCmd;
import org.activiti.impl.interceptor.CommandExecutor;
......
......@@ -15,7 +15,7 @@ package org.activiti.impl.definition;
import java.util.ArrayList;
import java.util.List;
import org.activiti.impl.calendar.BusinessCalendar;
import org.activiti.engine.impl.calendar.BusinessCalendar;
import org.activiti.impl.timer.TimerDeclarationImpl;
import org.activiti.pvm.Activity;
import org.activiti.pvm.ActivityBehavior;
......
......@@ -19,7 +19,7 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.activiti.impl.calendar.BusinessCalendar;
import org.activiti.engine.impl.calendar.BusinessCalendar;
import org.activiti.impl.timer.TimerDeclarationImpl;
import org.activiti.pvm.Listener;
......
......@@ -18,8 +18,8 @@ import javax.el.ExpressionFactory;
import javax.el.MethodExpression;
import javax.el.ValueExpression;
import org.activiti.impl.cfg.ProcessEngineConfiguration;
import org.activiti.impl.cfg.ProcessEngineConfigurationAware;
import org.activiti.engine.impl.cfg.ProcessEngineConfiguration;
import org.activiti.engine.impl.cfg.ProcessEngineConfigurationAware;
import org.activiti.impl.execution.ExecutionImpl;
/**
......
......@@ -17,7 +17,7 @@ import javax.el.ExpressionFactory;
import javax.el.ValueExpression;
import org.activiti.engine.ActivitiException;
import org.activiti.impl.bytes.ByteArrayImpl;
import org.activiti.engine.impl.persistence.runtime.ByteArrayImpl;
import org.activiti.impl.repository.DeploymentImpl;
import org.activiti.impl.task.TaskImpl;
......
......@@ -20,7 +20,7 @@ import org.activiti.engine.HistoricDataService;
import org.activiti.engine.history.HistoricActivityInstance;
import org.activiti.engine.history.HistoricProcessInstance;
import org.activiti.engine.impl.ServiceImpl;
import org.activiti.impl.cfg.ProcessEngineConfiguration;
import org.activiti.engine.impl.cfg.ProcessEngineConfiguration;
import org.activiti.impl.event.ActivityEndedEvent;
import org.activiti.impl.event.ActivityStartedEvent;
import org.activiti.impl.event.ProcessInstanceEndedEvent;
......
......@@ -19,8 +19,8 @@ import java.util.logging.Level;
import java.util.logging.Logger;
import org.activiti.engine.ActivitiException;
import org.activiti.engine.impl.cfg.ProcessEngineConfiguration;
import org.activiti.engine.impl.persistence.RepositorySession;
import org.activiti.impl.cfg.ProcessEngineConfiguration;
import org.activiti.impl.msg.MessageSession;
import org.activiti.impl.persistence.PersistenceSession;
import org.activiti.impl.timer.TimerSession;
......
......@@ -13,7 +13,7 @@
*/
package org.activiti.impl.interceptor;
import org.activiti.impl.cfg.ProcessEngineConfiguration;
import org.activiti.engine.impl.cfg.ProcessEngineConfiguration;
/**
......
......@@ -19,9 +19,9 @@ import java.util.List;
import java.util.logging.Logger;
import org.activiti.engine.ActivitiException;
import org.activiti.engine.impl.cfg.ProcessEngineConfiguration;
import org.activiti.engine.impl.cfg.ProcessEngineConfigurationAware;
import org.activiti.engine.impl.util.ClassNameUtil;
import org.activiti.impl.cfg.ProcessEngineConfiguration;
import org.activiti.impl.cfg.ProcessEngineConfigurationAware;
/**
* @author Tom Baeyens
......
......@@ -21,8 +21,8 @@ import java.util.concurrent.TimeUnit;
import java.util.logging.Logger;
import org.activiti.engine.ActivitiException;
import org.activiti.impl.cfg.ProcessEngineConfiguration;
import org.activiti.impl.cfg.ProcessEngineConfigurationAware;
import org.activiti.engine.impl.cfg.ProcessEngineConfiguration;
import org.activiti.engine.impl.cfg.ProcessEngineConfigurationAware;
import org.activiti.impl.interceptor.CommandExecutor;
import org.activiti.impl.job.JobHandlers;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册