Permalink
Showing with 2,055 additions and 453 deletions.
  1. +12 −0 eclipse/h2-server.launch
  2. +0 −68 ...tiviti-engine/src/main/java/org/activiti/engine/impl/cfg/spring/ApplicationContextElResolver.java
  3. +0 −198 ...s/activiti-engine/src/main/java/org/activiti/engine/impl/cfg/spring/ProcessEngineFactoryBean.java
  4. +0 −53 ...es/activiti-engine/src/main/java/org/activiti/engine/impl/cfg/spring/SpringExpressionManager.java
  5. +0 −44 ...tiviti-engine/src/main/java/org/activiti/engine/impl/cfg/spring/SpringTransactionInterceptor.java
  6. +1 −1 modules/activiti-engine/src/main/java/org/activiti/engine/test/ProcessEngineTestCase.java
  7. +0 −73 modules/activiti-engine/src/main/java/org/activiti/engine/test/SpringProcessEngineTestCase.java
  8. +43 −0 modules/activiti-engine/src/test/java/org/activiti/examples/bpmn/callactivity/CallActivityTest.java
  9. +49 −0 .../activiti-engine/src/test/java/org/activiti/examples/bpmn/event/timer/BoundaryTimerEventTest.java
  10. +46 −0 modules/activiti-engine/src/test/java/org/activiti/examples/bpmn/expression/UelExpressionTest.java
  11. +46 −0 ...s/activiti-engine/src/test/java/org/activiti/examples/bpmn/expression/UelExpressionTestOrder.java
  12. +70 −0 modules/activiti-engine/src/test/java/org/activiti/examples/bpmn/gateway/ExclusiveGatewayTest.java
  13. +91 −0 modules/activiti-engine/src/test/java/org/activiti/examples/bpmn/gateway/ParallelGatewayTest.java
  14. +40 −0 modules/activiti-engine/src/test/java/org/activiti/examples/bpmn/receivetask/ReceiveTaskTest.java
  15. +44 −0 modules/activiti-engine/src/test/java/org/activiti/examples/bpmn/scripttask/ScriptTaskTest.java
  16. +36 −0 ...les/activiti-engine/src/test/java/org/activiti/examples/bpmn/servicetask/JavaServiceTaskTest.java
  17. +35 −0 ...viti-engine/src/test/java/org/activiti/examples/bpmn/servicetask/ToUppercaseActivityBehavior.java
  18. +64 −0 modules/activiti-engine/src/test/java/org/activiti/examples/bpmn/subprocess/SubProcessTest.java
  19. +61 −0 ...activiti-engine/src/test/java/org/activiti/examples/bpmn/usertask/FinancialReportProcessTest.java
  20. +170 −0 ...iti-engine/src/test/java/org/activiti/examples/bpmn/usertask/taskcandidate/TaskCandidateTest.java
  21. +33 −0 ...i-engine/src/test/resources/org/activiti/examples/bpmn/callactivity/checkCreditProcess.bpmn20.xml
  22. +29 −0 ...ctiviti-engine/src/test/resources/org/activiti/examples/bpmn/callactivity/orderProcess.bpmn20.xml
  23. +35 −0 ...ctiviti/examples/bpmn/event/timer/BoundaryTimerEventTest.testInterruptingTimerDuration.bpmn20.xml
  24. +37 −0 ...s/org/activiti/examples/bpmn/expression/UelExpressionTest.testValueAndMethodExpression.bpmn20.xml
  25. BIN ...esources/org/activiti/examples/bpmn/expression/UelExpressionTest.testValueAndMethodExpression.png
  26. +46 −0 ...rces/org/activiti/examples/bpmn/gateway/ExclusiveGatewayTest.testDecisionFunctionality.bpmn20.xml
  27. +36 −0 ...src/test/resources/org/activiti/examples/bpmn/gateway/ParallelGatewayTest.testForkJoin.bpmn20.xml
  28. BIN .../test/resources/org/activiti/examples/bpmn/gateway/ParallelGatewayTest.testUnbalancedForkJoin.png
  29. +24 −0 ...resources/org/activiti/examples/bpmn/receivetask/ReceiveTaskTest.testWaitStateBehavior.bpmn20.xml
  30. +35 −0 ...est/resources/org/activiti/examples/bpmn/scripttask/ScriptTaskTest.testScriptExecution.bpmn20.xml
  31. +30 −0 ...s/org/activiti/examples/bpmn/servicetask/JavaServiceTaskTest.testJavaServiceDelegation.bpmn20.xml
  32. +55 −0 ...resources/org/activiti/examples/bpmn/subprocess/SubProcessTest.fixSystemFailureProcess.bpmn20.xml
  33. BIN ...c/test/resources/org/activiti/examples/bpmn/subprocess/SubProcessTest.fixSystemFailureProcess.png
  34. +45 −0 ...i-engine/src/test/resources/org/activiti/examples/bpmn/usertask/FinancialReportProcess.bpmn20.xml
  35. +33 −0 .../examples/bpmn/usertask/taskcandidate/TaskCandidateTest.testMixedCandidateUserAndGroup.bpmn20.xml
  36. +32 −0 ...iti/examples/bpmn/usertask/taskcandidate/TaskCandidateTest.testMultipleCandidateGroups.bpmn20.xml
  37. +32 −0 ...viti/examples/bpmn/usertask/taskcandidate/TaskCandidateTest.testMultipleCandidateUsers.bpmn20.xml
  38. +32 −0 ...tiviti/examples/bpmn/usertask/taskcandidate/TaskCandidateTest.testSingleCandidateGroup.bpmn20.xml
  39. +24 −0 ...c/test/resources/org/activiti/examples/taskforms/TaskFormsTest.testTaskFormUnavailable.bpmn20.xml
  40. +75 −0 ...les/activiti-engine/src/test/resources/org/activiti/examples/taskforms/VacationRequest.bpmn20.xml
  41. +44 −0 modules/activiti-engine/src/test/resources/org/activiti/examples/taskforms/adjustRequest.form
  42. +21 −0 modules/activiti-engine/src/test/resources/org/activiti/examples/taskforms/approve.form
  43. +56 −0 modules/activiti-engine/src/test/resources/org/activiti/examples/taskforms/request.form
  44. +32 −0 ...st/resources/org/activiti/examples/variables/VariablesTest.testBasicVariableOperations.bpmn20.xml
  45. +1 −0 modules/activiti-pvm/pom.xml
  46. +1 −1 modules/activiti-pvm/src/test/java/org/activiti/{pvm/test → test/pvm}/EventCollector.java
  47. +2 −1 ...es/activiti-pvm/src/test/java/org/activiti/{pvm/test → test/pvm}/PvmBasicLinearExecutionTest.java
  48. +2 −1 modules/activiti-pvm/src/test/java/org/activiti/{pvm/test → test/pvm}/PvmEmbeddedSubProcessTest.java
  49. +2 −1 modules/activiti-pvm/src/test/java/org/activiti/{pvm/test → test/pvm}/PvmEventTest.java
  50. +2 −1 modules/activiti-pvm/src/test/java/org/activiti/{pvm/test → test/pvm}/PvmParallelEndTest.java
  51. +2 −1 modules/activiti-pvm/src/test/java/org/activiti/{pvm/test → test/pvm}/PvmParallelTest.java
  52. +2 −1 modules/activiti-pvm/src/test/java/org/activiti/{pvm/test → test/pvm}/PvmProcessInstanceEndTest.java
  53. +2 −1 modules/activiti-pvm/src/test/java/org/activiti/{pvm/test → test/pvm}/PvmReusableSubProcessTest.java
  54. +2 −1 modules/activiti-pvm/src/test/java/org/activiti/{pvm/test → test/pvm}/PvmScopeAndEventsTest.java
  55. +2 −1 modules/activiti-pvm/src/test/java/org/activiti/{pvm/test → test/pvm}/PvmScopeWaitStateTest.java
  56. +2 −1 ...es/activiti-pvm/src/test/java/org/activiti/{pvm/test → test/pvm}/PvmScopesAndConcurrencyTest.java
  57. +2 −1 modules/activiti-pvm/src/test/java/org/activiti/{pvm/test → test/pvm}/PvmVariablesTest.java
  58. +9 −0 modules/activiti-spring/.classpath
  59. +23 −0 modules/activiti-spring/.project
  60. +67 −0 modules/activiti-spring/pom.xml
  61. +25 −0 modules/activiti-spring/src/test/java/org/activiti/examples/spring/Printer.java
  62. +57 −0 modules/activiti-spring/src/test/java/org/activiti/examples/spring/SpringAutoDeployTest.java
  63. +43 −0 .../activiti-spring/src/test/java/org/activiti/examples/spring/SpringTransactionIntegrationTest.java
  64. +41 −0 modules/activiti-spring/src/test/java/org/activiti/examples/spring/UserBean.java
  65. +40 −0 .../activiti-spring/src/test/resources/org/activiti/examples/spring/SpringAutoDeployTest-context.xml
  66. +47 −0 ...ring/src/test/resources/org/activiti/examples/spring/SpringTransactionIntegrationTest-context.xml
  67. +20 −0 modules/activiti-spring/src/test/resources/org/activiti/examples/spring/autodeploy.a.bpmn20.xml
  68. +20 −0 modules/activiti-spring/src/test/resources/org/activiti/examples/spring/autodeploy.b.bpmn20.xml
  69. +20 −0 modules/activiti-spring/src/test/resources/org/activiti/examples/spring/autodeploy.c.bpmn20.xml
  70. +23 −0 modules/activiti-spring/src/test/resources/org/activiti/examples/spring/hello.bpmn20.xml
  71. +2 −4 pom.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/activiti-engine-examples"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.h2.tools.Server"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-baseDir target"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="activiti-engine-examples"/>
+</launchConfiguration>
@@ -1,68 +0,0 @@
-/* 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.engine.impl.cfg.spring;
-
-import java.beans.FeatureDescriptor;
-import java.util.Iterator;
-
-import javax.el.ELContext;
-import javax.el.ELResolver;
-
-import org.springframework.context.ApplicationContext;
-
-
-/**
- * @author Tom Baeyens
- */
-public class ApplicationContextElResolver extends ELResolver {
-
- protected ApplicationContext applicationContext;
-
- public ApplicationContextElResolver(ApplicationContext applicationContext) {
- this.applicationContext = applicationContext;
- }
-
- public Object getValue(ELContext context, Object base, Object property) {
- if (base == null) {
- // according to javadoc, can only be a String
- String key = (String) property;
-
- if (applicationContext.containsBean(key)) {
- context.setPropertyResolved(true);
- return applicationContext.getBean(key);
- }
- }
-
- return null;
- }
-
- public boolean isReadOnly(ELContext context, Object base, Object property) {
- return true;
- }
-
- public void setValue(ELContext context, Object base, Object property, Object value) {
- }
-
- public Class< ? > getCommonPropertyType(ELContext context, Object arg) {
- return Object.class;
- }
-
- public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object arg) {
- return null;
- }
-
- public Class< ? > getType(ELContext context, Object arg1, Object arg2) {
- return Object.class;
- }
-}
@@ -1,198 +0,0 @@
-/* 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.engine.impl.cfg.spring;
-
-import java.io.IOException;
-import java.util.zip.ZipInputStream;
-
-import javax.sql.DataSource;
-
-import org.activiti.engine.DbSchemaStrategy;
-import org.activiti.engine.HistoryService;
-import org.activiti.engine.IdentityService;
-import org.activiti.engine.ProcessEngine;
-import org.activiti.engine.RepositoryService;
-import org.activiti.engine.impl.ProcessEngineImpl;
-import org.activiti.engine.impl.cfg.IdGenerator;
-import org.activiti.engine.impl.cfg.ProcessEngineConfiguration;
-import org.activiti.engine.impl.interceptor.CommandExecutor;
-import org.activiti.engine.impl.interceptor.DefaultCommandExecutor;
-import org.activiti.engine.impl.jobexecutor.JobExecutor;
-import org.activiti.engine.impl.variable.VariableTypes;
-import org.activiti.engine.repository.DeploymentBuilder;
-import org.springframework.beans.BeansException;
-import org.springframework.beans.factory.DisposableBean;
-import org.springframework.beans.factory.FactoryBean;
-import org.springframework.context.ApplicationContext;
-import org.springframework.context.ApplicationContextAware;
-import org.springframework.core.io.ByteArrayResource;
-import org.springframework.core.io.ContextResource;
-import org.springframework.core.io.Resource;
-import org.springframework.transaction.PlatformTransactionManager;
-
-/**
- * @author Dave Syer
- * @author Christian Stettler
- * @author Tom Baeyens
- */
-public class ProcessEngineFactoryBean implements FactoryBean<ProcessEngine>, DisposableBean, ApplicationContextAware {
-
- protected ProcessEngineConfiguration processEngineConfiguration = new ProcessEngineConfiguration();
- protected PlatformTransactionManager transactionManager;
- protected ApplicationContext applicationContext;
- protected String deploymentName = "SpringAutoDeployment";
- protected Resource[] deploymentResources = new Resource[0];
- protected ProcessEngineImpl processEngine;
-
- public void destroy() throws Exception {
- if (processEngine != null) {
- processEngine.close();
- }
- }
-
- public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
- this.applicationContext = applicationContext;
- }
-
- public ProcessEngine getObject() throws Exception {
- initializeSpringTransactionInterceptor();
- initializeExpressionManager();
-
- processEngine = (ProcessEngineImpl) processEngineConfiguration.buildProcessEngine();
-
- if (deploymentResources.length > 0) {
- autoDeployResources();
- }
-
- return processEngine;
-
- }
-
- private void initializeSpringTransactionInterceptor() {
- processEngineConfiguration.setLocalTransactions(transactionManager == null);
-
- if (transactionManager != null) {
- DefaultCommandExecutor commandExecutor = (DefaultCommandExecutor) processEngineConfiguration.getCommandExecutor();
- commandExecutor.addCommandInterceptor(new SpringTransactionInterceptor(transactionManager));
- processEngineConfiguration.setCommandExecutor(commandExecutor);
- }
- }
-
- protected void initializeExpressionManager() {
- processEngineConfiguration.setExpressionManager(new SpringExpressionManager(applicationContext));
- }
-
- public Class< ? > getObjectType() {
- return ProcessEngine.class;
- }
-
- public boolean isSingleton() {
- return true;
- }
-
- protected void autoDeployResources() throws IOException {
- RepositoryService repositoryService = processEngine.getRepositoryService();
-
- DeploymentBuilder deploymentBuilder = repositoryService
- .createDeployment()
- .enableDuplicateFiltering()
- .name(deploymentName);
-
- for (Resource resource : deploymentResources) {
- String resourceName = null;
-
- if (resource instanceof ContextResource) {
- resourceName = ((ContextResource) resource).getPathWithinContext();
-
- } else if (resource instanceof ByteArrayResource) {
- resourceName = resource.getDescription();
-
- } else {
- try {
- resourceName = resource.getFile().getAbsolutePath();
- } catch (IOException e) {
- resourceName = resource.getFilename();
- }
- }
-
- if ( resourceName.endsWith(".bar")
- || resourceName.endsWith(".zip")
- || resourceName.endsWith(".jar") ) {
- deploymentBuilder.addZipInputStream(new ZipInputStream(resource.getInputStream()));
- } else {
- deploymentBuilder.addInputStream(resourceName, resource.getInputStream());
- }
- }
-
- deploymentBuilder.deploy();
- }
-
- // getters and setters //////////////////////////////////////////////////////
-
- public void setTransactionManager(PlatformTransactionManager transactionManager) {
- this.transactionManager = transactionManager;
- }
-
- public void setDeploymentName(String deploymentName) {
- this.deploymentName = deploymentName;
- }
-
- public void setDeploymentResources(Resource[] deploymentResources) {
- this.deploymentResources = deploymentResources;
- }
-
- public void setCommandExecutor(CommandExecutor commandExecutor) {
- processEngineConfiguration.setCommandExecutor(commandExecutor);
- }
-
- public void setDataBaseName(String dataBaseName) {
- processEngineConfiguration.setDatabaseName(dataBaseName);
- }
-
- public void setDataSource(DataSource dataSource) {
- processEngineConfiguration.setDataSource(dataSource);
- }
-
- public void setDbSchemaStrategy(DbSchemaStrategy dbSchemaStrategy) {
- processEngineConfiguration.setDbSchemaStrategy(dbSchemaStrategy);
- }
-
- public void setHistoricDataService(HistoryService historicDataService) {
- processEngineConfiguration.setHistoricDataService(historicDataService);
- }
-
- public void setIdentityService(IdentityService identityService) {
- processEngineConfiguration.setIdentityService(identityService);
- }
-
- public void setIdGenerator(IdGenerator idGenerator) {
- processEngineConfiguration.setIdGenerator(idGenerator);
- }
-
- public void setJobExecutor(JobExecutor jobExecutor) {
- processEngineConfiguration.setJobExecutor(jobExecutor);
- }
-
- public void setJobExecutorAutoActivate(boolean jobExecutorAutoActivate) {
- processEngineConfiguration.setJobExecutorAutoActivate(jobExecutorAutoActivate);
- }
-
- public void setProcessEngineName(String processEngineName) {
- processEngineConfiguration.setProcessEngineName(processEngineName);
- }
-
- public void setVariableTypes(VariableTypes variableTypes) {
- processEngineConfiguration.setVariableTypes(variableTypes);
- }
-}
@@ -1,53 +0,0 @@
-/* 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.engine.impl.cfg.spring;
-
-import javax.el.ArrayELResolver;
-import javax.el.BeanELResolver;
-import javax.el.CompositeELResolver;
-import javax.el.ELResolver;
-import javax.el.ListELResolver;
-import javax.el.MapELResolver;
-
-import org.activiti.engine.impl.el.ExecutionVariableElResolver;
-import org.activiti.engine.impl.el.ExpressionManager;
-import org.activiti.pvm.impl.runtime.ExecutionImpl;
-import org.springframework.context.ApplicationContext;
-
-
-/**
- * @author Tom Baeyens
- */
-public class SpringExpressionManager extends ExpressionManager {
-
- protected ApplicationContext applicationContext;
-
- public SpringExpressionManager(ApplicationContext applicationContext) {
- this.applicationContext = applicationContext;
- }
-
- @Override
- protected ELResolver createElResolver(ExecutionImpl execution) {
- CompositeELResolver compositeElResolver = new CompositeELResolver();
- compositeElResolver.add(new ExecutionVariableElResolver(execution));
- compositeElResolver.add(new ApplicationContextElResolver(applicationContext));
- compositeElResolver.add(new ArrayELResolver());
- compositeElResolver.add(new ListELResolver());
- compositeElResolver.add(new MapELResolver());
- compositeElResolver.add(new BeanELResolver());
- return compositeElResolver;
- }
-
-
-}
@@ -1,44 +0,0 @@
-/* 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.engine.impl.cfg.spring;
-
-import org.activiti.engine.impl.interceptor.Command;
-import org.activiti.engine.impl.interceptor.CommandExecutor;
-import org.activiti.engine.impl.interceptor.CommandInterceptor;
-import org.springframework.transaction.PlatformTransactionManager;
-import org.springframework.transaction.TransactionStatus;
-import org.springframework.transaction.support.TransactionCallback;
-import org.springframework.transaction.support.TransactionTemplate;
-
-/**
- * @author Dave Syer
- * @author Tom Baeyens
- */
-public class SpringTransactionInterceptor implements CommandInterceptor {
-
- protected PlatformTransactionManager transactionManager;
-
- public SpringTransactionInterceptor(PlatformTransactionManager transactionManager) {
- this.transactionManager = transactionManager;
- }
-
- public <T> T invoke(final CommandExecutor next, final Command<T> command) {
- @SuppressWarnings("unchecked")
- T result = (T) new TransactionTemplate(transactionManager).execute(new TransactionCallback() {
- public Object doInTransaction(TransactionStatus status) {
- return next.execute(command);
- }
- });
- return result;
- }
-}
@@ -141,7 +141,7 @@ public void runBare() throws Throwable {
}
}
- void initializeProcessEngine() {
+ protected void initializeProcessEngine() {
log.fine("==== BUILDING PROCESS ENGINE ========================================================================");
processEngine = new ProcessEngineBuilder()
.configureFromPropertiesResource(configurationResource)
Oops, something went wrong.

0 comments on commit b10b278

Please sign in to comment.