JBoss JBPM SVN: r5479 - in jbpm4/tags/jbpm-4.0/modules/db: scripts and 1 other directory.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-08-14 01:01:17 -0400 (Fri, 14 Aug 2009)
New Revision: 5479
Modified:
jbpm4/tags/jbpm-4.0/modules/db/pom.xml
jbpm4/tags/jbpm-4.0/modules/db/scripts/antrun-schema.xml
Log:
[JBPM-1995] pack schema create/drop scripts in jbpm-db.jar
Modified: jbpm4/tags/jbpm-4.0/modules/db/pom.xml
===================================================================
--- jbpm4/tags/jbpm-4.0/modules/db/pom.xml 2009-08-14 01:57:23 UTC (rev 5478)
+++ jbpm4/tags/jbpm-4.0/modules/db/pom.xml 2009-08-14 05:01:17 UTC (rev 5479)
@@ -45,10 +45,6 @@
<groupId>postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
- <dependency>
- <groupId>net.sourceforge.jtds</groupId>
- <artifactId>jtds</artifactId>
- </dependency>
</dependencies>
<build>
@@ -57,17 +53,15 @@
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
- <id>create-db-schemas</id>
- <phase>process-resources</phase>
+ <id>create-drop-script</id>
+ <phase>generate-resources</phase>
<goals>
<goal>run</goal>
</goals>
<configuration>
<tasks>
- <property name="maven.runtime.classpath" refid="maven.runtime.classpath"/>
- <ant antfile="scripts/antrun-schema.xml"
- target="create-schema">
- </ant>
+ <property name="project.output.dir" value="${project.build.outputDirectory}"/>
+ <ant antfile="scripts/antrun-schema.xml" target="create-schema" inheritRefs="yes"/>
</tasks>
</configuration>
</execution>
@@ -76,4 +70,4 @@
</plugins>
</build>
-</project>
\ No newline at end of file
+</project>
Modified: jbpm4/tags/jbpm-4.0/modules/db/scripts/antrun-schema.xml
===================================================================
--- jbpm4/tags/jbpm-4.0/modules/db/scripts/antrun-schema.xml 2009-08-14 01:57:23 UTC (rev 5478)
+++ jbpm4/tags/jbpm-4.0/modules/db/scripts/antrun-schema.xml 2009-08-14 05:01:17 UTC (rev 5479)
@@ -15,14 +15,11 @@
<!-- ================================================================== -->
<target name="create-schema">
- <echo message="${maven.runtime.classpath}"/>
-
<taskdef name="schemaexport"
- classname="org.hibernate.tool.hbm2ddl.SchemaExportTask">
- <classpath path="${maven.runtime.classpath}"/>
- </taskdef>
+ classname="org.hibernate.tool.hbm2ddl.SchemaExportTask"
+ classpathref="maven.compile.classpath" />
- <mkdir dir="target"/>
+ <mkdir dir="${project.output.dir}" />
<!-- HsqlDB -->
<create-ddl db="hsqldb"/>
@@ -30,7 +27,7 @@
<!-- MySQL -->
<create-ddl db="mysql"/>
<!--TODO: https://jira.jboss.org/jira/browse/JBPM-2071 -->
- <replace file="target/jbpm.mysql.create.sql" token="BLOB_VALUE_ blob" value="BLOB_VALUE_ longblob" />
+ <replace file="${project.output.dir}/jbpm.mysql.create.sql" token="BLOB_VALUE_ blob" value="BLOB_VALUE_ longblob" />
<!-- Oracle -->
<create-ddl db="oracle"/>
@@ -50,22 +47,20 @@
<attribute name="db"/>
<sequential>
- <echo></echo>
<echo>=====================</echo>
<echo>Create DDL @{db}</echo>
- <schemaexport output="target/jbpm.(a){db}.create.sql"
+ <schemaexport output="${project.output.dir}/jbpm.(a){db}.create.sql"
create="yes" drop="no"
config="src/main/config/(a){db}.hibernate.cfg.xml"
text="yes" delimiter=";"
quiet="yes"/>
- <schemaexport output="target/jbpm.(a){db}.drop.sql"
+ <schemaexport output="${project.output.dir}/jbpm.(a){db}.drop.sql"
create="no" drop="yes"
config="src/main/config/(a){db}.hibernate.cfg.xml"
text="yes" delimiter=";"
quiet="yes"/>
- <echo>Done.</echo>
<echo>=====================</echo>
</sequential>
</macrodef>
14 years, 9 months
JBoss JBPM SVN: r5478 - jbpm4/branches.
by do-not-reply@jboss.org
Author: alex.guizar(a)jboss.com
Date: 2009-08-13 21:57:23 -0400 (Thu, 13 Aug 2009)
New Revision: 5478
Removed:
jbpm4/branches/email/
Log:
drop email branch, relevant updates have been merged into trunk
14 years, 9 months
JBoss JBPM SVN: r5477 - in jbpm4/branches/tbaeyens: modules/api/src/main/java/org/jbpm/api/cmd and 57 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-08-13 13:10:34 -0400 (Thu, 13 Aug 2009)
New Revision: 5477
Added:
jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/api/cmd/
jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/api/cmd/Command.java
jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/api/cmd/Environment.java
jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/api/cmd/ParamCommand.java
jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/api/cmd/VoidCommand.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/EnvironmentImpl.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/resources/jbpm.tx.cmd.cfg.xml
jbpm4/branches/tbaeyens/modules/test-base/src/main/java/org/jbpm/test/tx/
jbpm4/branches/tbaeyens/modules/test-base/src/main/java/org/jbpm/test/tx/TxCommand.java
jbpm4/branches/tbaeyens/modules/test-base/src/main/java/org/jbpm/test/tx/TxTemplate.java
jbpm4/branches/tbaeyens/modules/test-base/src/main/java/org/jbpm/test/tx/VoidTxCommand.java
jbpm4/branches/tbaeyens/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.cfg.xml
jbpm4/branches/tbaeyens/qa/hudson-jbpm4-cfg.bat
Removed:
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/Command.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Environment.java
jbpm4/branches/tbaeyens/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/TxCommand.java
jbpm4/branches/tbaeyens/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/TxTemplate.java
jbpm4/branches/tbaeyens/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.cfg.xml
jbpm4/branches/tbaeyens/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.tx.hibernate.cfg.xml
Modified:
jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/api/ProcessEngine.java
jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandExecutorSLSB.java
jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandReceiverMDB.java
jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EjbLocalCommandService.java
jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EjbRemoteCommandService.java
jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EjbTimerSession.java
jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/ExecuteTimerCmd.java
jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/LocalCommandExecutor.java
jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/RemoteCommandExecutor.java
jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/InsertCommentCmd.java
jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/RemoveCommentCmd.java
jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/CommandReceiverTest.java
jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/EjbTimerSessionTest.java
jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/TimerTest.java
jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/test/enterprise/EnvironmentServletTestCase.java
jbpm4/branches/tbaeyens/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessEnginePluginImpl.java
jbpm4/branches/tbaeyens/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java
jbpm4/branches/tbaeyens/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java
jbpm4/branches/tbaeyens/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/ProcessFormDispatcher.java
jbpm4/branches/tbaeyens/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskFormDispatcher.java
jbpm4/branches/tbaeyens/modules/integration/graphView-plugin/src/main/java/org/jbpm/integration/console/graphView/GraphViewerPluginImpl.java
jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionHandlerActivity.java
jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/HqlActivity.java
jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JavaActivity.java
jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JoinActivity.java
jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/MailActivity.java
jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/MailListener.java
jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ScriptActivity.java
jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ScriptBinding.java
jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java
jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java
jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/SpringConfiguration.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AbstractCommand.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddParticipationCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddReplyCommentCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddTaskCommentCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AssignTaskCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CommandService.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CompleteTaskCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CompositeCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateDeploymentQueryCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateHistoryActivityInstanceQueryCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateHistoryDetailQueryCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateHistoryProcessInstanceQueryCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateHistoryTaskQueryCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateJobQueryCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateProcessDefinitionQueryCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateProcessInstanceQueryCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateTaskQueryCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteCommentCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteDeploymentCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessDefinitionCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessInstance.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteTaskCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeployCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/EndProcessInstance.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionByKeyCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionByIdCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionKeysCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionsByKeyCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetActivityCoordinatesCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetExecutionVariableNamesCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetExecutionVariablesCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetOutcomes.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetParticipantsCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetResourceAsStreamCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetStartActivityNamesCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetStartFormResourceNameCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetSubTasksCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskCommentsCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskVariableNamesCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskVariablesCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/NewTaskCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/RemoveParticipantCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ResumeDeploymentCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SaveTaskCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SendMessageCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SetExecutionVariablesCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SetTaskVariablesCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SignalCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceInLatestCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SuspendDeploymentCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/VariablesCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/DefaultAddressResolver.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/MailProducerImpl.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/BasicEnvironment.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Context.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/EnvironmentDefaults.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/EnvironmentFactory.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/DbSessionImpl.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistoryEvent.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ActivityEnd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ActivityStart.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceCreate.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceEnd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskActivityStart.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskAssign.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskComplete.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskCreated.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskDelete.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskUpdated.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/VariableCreate.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/VariableUpdate.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryDetailImpl.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateGroupCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateMembershipCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateUserCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteGroupCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteMembershipCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteUserCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroupCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroupsCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUserCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUsersCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JbpmIdentityStore.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/CommandMessage.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/JobImpl.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/AcquireJobsCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/DispatcherThread.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/GetNextDueDateCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExceptionHandler.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutor.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorMessageSession.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/lob/Lob.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/DefaultIdGenerator.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerSynchronization.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ObjectReference.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeInstanceImpl.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableDefinitionImpl.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableOutDefinitionSet.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteActivityMessage.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListenerMessage.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/SignalMessage.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionStartActivityMessage.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/AbstractQuery.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/AvgDurationPerActivityQueryCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ChoiceDistributionQueryCmd.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/TaskQueryImpl.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/ProcessDeployer.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/EnvironmentBindings.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/CommandTransactionCallback.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AsyncCommandMessage.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AsyncCommandService.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AuthorizationInterceptor.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AuthorizationSession.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/DefaultCommandService.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/EnvironmentInterceptor.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/FindGroupIds.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/RetryInterceptor.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/SerializeInterceptor.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/test/JobTestHelper.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionInterceptor.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/StandardTransactionInterceptor.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaRetryInterceptor.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransactionInterceptor.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/Variable.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/matcher/HibernateIdMatcher.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/variable/BlobVariable.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/EnvRefBinding.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/VersionTimestampPolicy.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ContextRefDescriptor.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/EnvDescriptor.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/EnvironmentDescriptor.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateSessionDescriptor.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JbossIdmIdentitySessionDescriptor.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/TransactionRefDescriptor.java
jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/SubscribeOperation.java
jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/env/BasicEnvironmentTest.java
jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/env/EnvironmentSearchOrderTest.java
jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/env/EnvironmentTypeLookupTest.java
jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/env/NestedEnvironmentTest.java
jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/GroovyExpressionTest.java
jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/JuelExpressionTest.java
jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/EnlistTest.java
jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/TransactionFailingCommitTest.java
jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/TransactionResourcesCommitTest.java
jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/TransactionResourcesSetRollbackOnlyTest.java
jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ClassWireTest.java
jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ContextBlockSubscriptionTest.java
jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ContextTest.java
jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/EnvWireTest.java
jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/MethodSubscriptionTest.java
jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ObjectSubscriptionTest.java
jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/WireEventsSubscriptionTest.java
jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/WireObservableTest.java
jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/test/EnvironmentTestCase.java
jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/tx/BasicTransactionTest.java
jbpm4/branches/tbaeyens/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/HibernateLongIdTest.java
jbpm4/branches/tbaeyens/modules/test-cfg/src/test/java/org/jbpm/test/hibernatestringid/HibernateStringIdTest.java
jbpm4/branches/tbaeyens/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.hibernate.cfg.xml
jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/LoadTestCase.java
jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/ContinuationTest.java
jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveMessagesTest.java
jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveTestCommand.java
jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceMessageTest.java
jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceTestCommand.java
jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingMessageTest.java
jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingTestCommand.java
jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/GenerateExceptionTestCommand.java
jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/JobExecutorTestCase.java
jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageCommand.java
jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageTest.java
jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/messages/AddCommentCmd.java
jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/messages/MessageProcessingTest.java
Log:
user commands work
Modified: jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/api/ProcessEngine.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/api/ProcessEngine.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/api/ProcessEngine.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -23,7 +23,9 @@
import java.sql.Connection;
+import org.jbpm.api.cmd.Command;
+
/** central starting point for all process engine API
* interactions. This is a thread safe object so it can be
* kept in a static member field or in JNDI or something
@@ -81,4 +83,6 @@
* a service method in the same thread.
* This method returns the process engine for convenient method concatenations. */
ProcessEngine setJdbcConnection(Connection jdbcConnection);
+
+ <T> T execute(Command<T> command);
}
Copied: jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/api/cmd/Command.java (from rev 5474, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/Command.java)
===================================================================
--- jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/api/cmd/Command.java (rev 0)
+++ jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/api/cmd/Command.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -0,0 +1,14 @@
+package org.jbpm.api.cmd;
+
+import java.io.Serializable;
+
+import org.jbpm.api.ProcessEngine;
+
+/** commands that can be {@link ProcessEngine#execute(Command) executed by the process engine}.
+ *
+ * @author Tom Baeyens
+ */
+public interface Command<T> extends Serializable {
+
+ T execute(Environment environment) throws Exception;
+}
Property changes on: jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/api/cmd/Command.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:mergeinfo
+
Name: svn:eol-style
+ LF
Copied: jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/api/cmd/Environment.java (from rev 5474, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Environment.java)
===================================================================
--- jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/api/cmd/Environment.java (rev 0)
+++ jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/api/cmd/Environment.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -0,0 +1,43 @@
+/*
+ * 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.api.cmd;
+
+/** exposes configured process engine scope objects and
+ * transaction scope objects {@link Command to command implementations}.
+ *
+ * @author Tom Baeyens
+ */
+public interface Environment {
+
+ /**
+ * searches a named object in all the contexts in the default search order.
+ * @return the object if it exists in the environment, <code>null</code> if there is no object with the given name in the environment.
+ */
+ public abstract Object get(String name);
+
+ /** searches an object based on type. The search doesn take superclasses of the context elements
+ * into account.
+ * @return the first object of the given type or null in case no such element was found.
+ */
+ public abstract <T> T get(Class<T> type);
+
+}
\ No newline at end of file
Property changes on: jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/api/cmd/Environment.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Added: jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/api/cmd/ParamCommand.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/api/cmd/ParamCommand.java (rev 0)
+++ jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/api/cmd/ParamCommand.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -0,0 +1,42 @@
+/*
+ * 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.api.cmd;
+
+import java.util.HashMap;
+import java.util.Map;
+
+
+/** command with support for parameter passing from the client to the implementation.
+ *
+ * @author Tom Baeyens
+ */
+public abstract class ParamCommand<T> implements Command<T> {
+
+ private static final long serialVersionUID = 1L;
+
+ protected Map<String, Object> params = new HashMap<String, Object>();
+
+ public ParamCommand<T> setParam(String name, Object value) {
+ params.put(name, value);
+ return this;
+ }
+}
Property changes on: jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/api/cmd/ParamCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/api/cmd/VoidCommand.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/api/cmd/VoidCommand.java (rev 0)
+++ jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/api/cmd/VoidCommand.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -0,0 +1,38 @@
+/*
+ * 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.api.cmd;
+
+
+/** convenience for commands without return value.
+ *
+ * @author Tom Baeyens
+ */
+public abstract class VoidCommand implements Command<Void> {
+
+ public Void execute(Environment environment) throws Exception {
+ executeVoid(environment);
+ return null;
+ }
+
+ public abstract void executeVoid(Environment environment);
+
+}
Property changes on: jbpm4/branches/tbaeyens/modules/api/src/main/java/org/jbpm/api/cmd/VoidCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandExecutorSLSB.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandExecutorSLSB.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandExecutorSLSB.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -34,10 +34,10 @@
import org.jbpm.api.Configuration;
import org.jbpm.api.ProcessEngine;
+import org.jbpm.api.cmd.Command;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.cmd.CommandService;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
/**
@@ -80,7 +80,7 @@
private ProcessEngine processEngine = null;
/*public <T> T execute(Command<T> command) {
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
log.debug("executing command " + command);
return command.execute(environment);
Modified: jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandReceiverMDB.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandReceiverMDB.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/CommandReceiverMDB.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -40,9 +40,9 @@
import javax.naming.NameNotFoundException;
import javax.naming.NamingException;
+import org.jbpm.api.cmd.Command;
import org.jbpm.api.job.Job;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.cmd.ExecuteJobCmd;
/**
Modified: jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EjbLocalCommandService.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EjbLocalCommandService.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EjbLocalCommandService.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -24,7 +24,7 @@
import javax.ejb.CreateException;
import org.jbpm.api.JbpmException;
-import org.jbpm.pvm.internal.cmd.Command;
+import org.jbpm.api.cmd.Command;
import org.jbpm.pvm.internal.cmd.CommandService;
/**
Modified: jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EjbRemoteCommandService.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EjbRemoteCommandService.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EjbRemoteCommandService.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -28,9 +28,9 @@
import javax.naming.InitialContext;
import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Command;
import org.jbpm.enterprise.internal.wire.binding.EjbRemoteCommandServiceBinding;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.cmd.CommandService;
Modified: jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EjbTimerSession.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EjbTimerSession.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/EjbTimerSession.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -30,7 +30,7 @@
import org.jbpm.api.JbpmException;
import org.jbpm.api.job.Timer;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.job.TimerImpl;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.session.TimerSession;
@@ -51,7 +51,7 @@
log.debug("scheduling "+timer);
// flush timer to database
- DbSession dbSession = Environment.getCurrent().get(DbSession.class);
+ DbSession dbSession = EnvironmentImpl.getCurrent().get(DbSession.class);
dbSession.save(timer);
dbSession.flush();
Modified: jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/ExecuteTimerCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/ExecuteTimerCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/ExecuteTimerCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -23,9 +23,9 @@
import java.util.Date;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.job.TimerImpl;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/LocalCommandExecutor.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/LocalCommandExecutor.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/LocalCommandExecutor.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,7 @@
*/
package org.jbpm.enterprise.internal.ejb;
-import org.jbpm.pvm.internal.cmd.Command;
+import org.jbpm.api.cmd.Command;
/**
* EJB2 local interface for the command executor.
Modified: jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/RemoteCommandExecutor.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/RemoteCommandExecutor.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/enterprise/src/main/java/org/jbpm/enterprise/internal/ejb/RemoteCommandExecutor.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -23,7 +23,7 @@
import java.rmi.RemoteException;
-import org.jbpm.pvm.internal.cmd.Command;
+import org.jbpm.api.cmd.Command;
/**
* EJB2 remote interface for the command executor.
Modified: jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/InsertCommentCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/InsertCommentCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/InsertCommentCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,8 +21,8 @@
*/
package org.jbpm.enterprise.internal.custom;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
/**
* @author Alejandro Guizar
Modified: jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/RemoveCommentCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/RemoveCommentCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/custom/RemoveCommentCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -26,8 +26,8 @@
import org.hibernate.Session;
import org.hibernate.criterion.Restrictions;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
/**
Modified: jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/CommandReceiverTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/CommandReceiverTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/CommandReceiverTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -37,11 +37,11 @@
import org.apache.cactus.ServletTestCase;
+import org.jbpm.api.cmd.Command;
import org.jbpm.enterprise.internal.custom.InsertCommentCmd;
import org.jbpm.enterprise.internal.custom.RemoveCommentCmd;
import org.jbpm.enterprise.internal.ejb.CommandReceiverMDB;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.test.enterprise.IntegrationTestSetup;
/**
Modified: jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/EjbTimerSessionTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/EjbTimerSessionTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/EjbTimerSessionTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -28,15 +28,14 @@
import junit.framework.Test;
import org.jbpm.api.ExecutionService;
-import org.jbpm.api.RepositoryService;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.enterprise.internal.custom.HappyListener;
import org.jbpm.enterprise.internal.custom.WaitState;
import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
import org.jbpm.pvm.internal.client.ClientProcessDefinition;
-import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.cmd.CommandService;
import org.jbpm.pvm.internal.cmd.StartProcessInstanceCmd;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.job.TimerImpl;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.session.TimerSession;
Modified: jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/TimerTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/TimerTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/enterprise/internal/ejb/TimerTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -30,15 +30,15 @@
import org.jbpm.api.Execution;
import org.jbpm.api.ExecutionService;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.enterprise.internal.custom.HappyListener;
import org.jbpm.enterprise.internal.custom.NoisyListener;
import org.jbpm.enterprise.internal.custom.WaitState;
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
import org.jbpm.pvm.internal.client.ClientProcessDefinition;
-import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.cmd.CommandService;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.job.TimerImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/test/enterprise/EnvironmentServletTestCase.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/test/enterprise/EnvironmentServletTestCase.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/enterprise/src/test/java/org/jbpm/test/enterprise/EnvironmentServletTestCase.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -28,7 +28,7 @@
import org.jbpm.api.Configuration;
import org.jbpm.api.JbpmException;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
/**
@@ -37,7 +37,7 @@
public abstract class EnvironmentServletTestCase extends ServletTestCase {
private final String configResource;
- protected Environment environment;
+ protected EnvironmentImpl environment;
protected Log log = Log.getLog(getClass().getName());
private static final Map<String, EnvironmentFactory> environmentFactories = new HashMap<String, EnvironmentFactory>();
Modified: jbpm4/branches/tbaeyens/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessEnginePluginImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessEnginePluginImpl.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessEnginePluginImpl.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -27,7 +27,7 @@
import org.jbpm.api.*;
import org.jbpm.api.job.Job;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import java.util.ArrayList;
import java.util.List;
@@ -48,7 +48,7 @@
{
List<DeploymentRef> results = new ArrayList<DeploymentRef>();
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
@@ -95,7 +95,7 @@
public void deleteDeployment(String id)
{
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
@@ -111,7 +111,7 @@
public void suspendDeployment(String id, boolean isSuspended)
{
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
@@ -132,7 +132,7 @@
{
List<JobRef> results = new ArrayList<JobRef>();
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
@@ -171,7 +171,7 @@
public void executeJob(String jobId)
{
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
Modified: jbpm4/branches/tbaeyens/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/integration/console/src/main/java/org/jbpm/integration/console/ProcessManagementImpl.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -37,7 +37,7 @@
import org.jbpm.api.RepositoryService;
import org.jbpm.api.history.HistoryProcessInstance;
import org.jbpm.api.history.HistoryProcessInstanceQuery;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.model.ExecutionImpl;
@@ -49,7 +49,7 @@
public List<ProcessDefinitionRef> getProcessDefinitions()
{
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
@@ -93,7 +93,7 @@
public ProcessDefinitionRef getProcessDefinition(String procDefId)
{
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
@@ -112,7 +112,7 @@
public List<ProcessDefinitionRef> removeProcessDefinition(String procDefId)
{
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
@@ -134,7 +134,7 @@
public List<ProcessInstanceRef> getProcessInstances(String procDefId)
{
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
@@ -168,7 +168,7 @@
private List<ProcessInstanceRef> adoptProcessInstances(List<ProcessInstance> processInstances)
{
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
@@ -197,7 +197,7 @@
public ProcessInstanceRef getProcessInstance(String instanceId)
{
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
@@ -218,7 +218,7 @@
{
Map<String, Object> data = new HashMap<String, Object>();
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
@@ -241,7 +241,7 @@
public ProcessInstanceRef newInstance(String definitionId)
{
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
@@ -257,7 +257,7 @@
public ProcessInstanceRef newInstance(String definitionId, Map<String, Object> processVars)
{
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
@@ -274,7 +274,7 @@
public void endInstance(String instanceId, ProcessInstanceRef.RESULT result)
{
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
@@ -295,7 +295,7 @@
public void deleteInstance(String instanceId)
{
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
@@ -323,7 +323,7 @@
public void signalExecution(String executionId, String signal)
{
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
Modified: jbpm4/branches/tbaeyens/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/integration/console/src/main/java/org/jbpm/integration/console/TaskManagementImpl.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -30,7 +30,7 @@
import org.jbpm.api.TaskService;
import org.jbpm.api.task.Participation;
import org.jbpm.api.task.Task;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
@@ -41,7 +41,7 @@
{
public List<TaskRef> getAssignedTasks(String idRef)
{
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
@@ -61,7 +61,7 @@
public List<TaskRef> getUnassignedTasks(String idRef, String participationType)
{
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
@@ -96,7 +96,7 @@
public TaskRef getTaskById(long taskId)
{
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
@@ -111,7 +111,7 @@
public void assignTask(long taskId, String idRef, String performingUser)
{
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
@@ -125,7 +125,7 @@
public void releaseTask(long taskId, String performingUser)
{
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
@@ -139,7 +139,7 @@
public void completeTask(long taskId, Map data, String performingUser)
{
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
@@ -156,7 +156,7 @@
public void completeTask(long taskId, String outcome, Map data, String performingUser)
{
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
Modified: jbpm4/branches/tbaeyens/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/ProcessFormDispatcher.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/ProcessFormDispatcher.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/ProcessFormDispatcher.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -25,7 +25,7 @@
import org.jboss.bpm.console.server.plugin.FormDispatcherPlugin;
import org.jbpm.api.ProcessDefinition;
import org.jbpm.api.RepositoryService;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import javax.activation.DataHandler;
@@ -74,7 +74,7 @@
{
String name = null;
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
RepositoryService repoService = processEngine.getRepositoryService();
@@ -100,7 +100,7 @@
public DataHandler provideForm(FormAuthorityRef ref)
{
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
DataHandler result = null;
Modified: jbpm4/branches/tbaeyens/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskFormDispatcher.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskFormDispatcher.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/integration/form-plugin/src/main/java/org/jbpm/integration/console/forms/TaskFormDispatcher.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -25,7 +25,7 @@
import org.jboss.bpm.console.server.plugin.FormDispatcherPlugin;
import org.jbpm.api.*;
import org.jbpm.api.task.Task;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.model.Transition;
@@ -78,7 +78,7 @@
{
boolean result = false;
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
TaskService taskService = processEngine.getTaskService();
@@ -95,7 +95,7 @@
public DataHandler provideForm(FormAuthorityRef ref)
{
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
Modified: jbpm4/branches/tbaeyens/modules/integration/graphView-plugin/src/main/java/org/jbpm/integration/console/graphView/GraphViewerPluginImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/integration/graphView-plugin/src/main/java/org/jbpm/integration/console/graphView/GraphViewerPluginImpl.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/integration/graphView-plugin/src/main/java/org/jbpm/integration/console/graphView/GraphViewerPluginImpl.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -41,7 +41,7 @@
import org.jbpm.api.ProcessInstanceQuery;
import org.jbpm.api.RepositoryService;
import org.jbpm.api.model.ActivityCoordinates;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.integration.spi.mgmt.ServerConfig;
@@ -86,7 +86,7 @@
public byte[] getProcessImage(String processId)
{
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
@@ -140,7 +140,7 @@
List<ActiveNodeInfo> results = new ArrayList<ActiveNodeInfo>();
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
try
{
@@ -195,7 +195,7 @@
URL result = null;
// check resource availability
- Environment env = ((EnvironmentFactory)processEngine).openEnvironment();
+ EnvironmentImpl env = ((EnvironmentFactory)processEngine).openEnvironment();
boolean hasImageResource = false;
try
Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionHandlerActivity.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionHandlerActivity.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/DecisionHandlerActivity.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -24,7 +24,7 @@
import org.jbpm.api.JbpmException;
import org.jbpm.api.activity.ActivityExecution;
import org.jbpm.api.jpdl.DecisionHandler;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.model.Activity;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.model.Transition;
@@ -55,7 +55,7 @@
usedDecisionHandler = decisionHandler;
} else if (decisionHandlerName!=null) {
- Environment environment = Environment.getCurrent();
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
Object object = environment.get(decisionHandlerName);
if (object==null) {
throw new JbpmException("decision handler for "+activity+" is null");
Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/HqlActivity.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/HqlActivity.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/HqlActivity.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -26,7 +26,7 @@
import org.jbpm.api.JbpmException;
import org.jbpm.api.model.OpenExecution;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.wire.Descriptor;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.descriptor.ListDescriptor;
@@ -47,7 +47,7 @@
protected boolean isResultUnique;
public void perform(OpenExecution execution) {
- Environment environment = Environment.getCurrent();
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
if (environment==null) {
throw new JbpmException("no environment for jpdl activity "+HqlBinding.TAG);
}
Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JavaActivity.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JavaActivity.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JavaActivity.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -26,7 +26,7 @@
import org.jbpm.api.JbpmException;
import org.jbpm.api.model.OpenExecution;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentDefaults;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.script.ScriptManager;
Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JoinActivity.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JoinActivity.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/JoinActivity.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -29,7 +29,7 @@
import org.jbpm.api.Execution;
import org.jbpm.api.JbpmException;
import org.jbpm.api.activity.ActivityExecution;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.model.Activity;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.model.Transition;
@@ -64,7 +64,7 @@
} else if (Execution.STATE_ACTIVE_CONCURRENT.equals(execution.getState())) {
// force version increment in the parent execution
- Session session = Environment.getFromCurrent(Session.class);
+ Session session = EnvironmentImpl.getFromCurrent(Session.class);
session.lock(execution.getParent(), lockMode);
execution.setState(Execution.STATE_INACTIVE_JOIN);
Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/MailActivity.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/MailActivity.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/MailActivity.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -28,7 +28,7 @@
import org.jbpm.api.model.OpenExecution;
import org.jbpm.pvm.internal.email.spi.MailProducer;
import org.jbpm.pvm.internal.email.spi.MailSession;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
/**
* @author Alejandro Guizar
@@ -41,7 +41,7 @@
void perform(OpenExecution execution) throws Exception {
Collection<Message> messages = mailProducer.produce(execution);
- Environment.getFromCurrent(MailSession.class).send(messages);
+ EnvironmentImpl.getFromCurrent(MailSession.class).send(messages);
}
public void setMailProducer(MailProducer mailProducer) {
Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/MailListener.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/MailListener.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/MailListener.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -29,7 +29,7 @@
import org.jbpm.api.listener.EventListenerExecution;
import org.jbpm.pvm.internal.email.spi.MailProducer;
import org.jbpm.pvm.internal.email.spi.MailSession;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.TaskContext;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.task.TaskImpl;
@@ -45,7 +45,7 @@
public void notify(EventListenerExecution execution) throws Exception {
// find current task
- Environment environment = Environment.getCurrent();
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
DbSession dbSession = environment.get(DbSession.class);
TaskImpl task = dbSession.findTaskByExecution(execution);
Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ScriptActivity.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ScriptActivity.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ScriptActivity.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,7 +22,7 @@
package org.jbpm.jpdl.internal.activity;
import org.jbpm.api.model.OpenExecution;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.script.ScriptManager;
@@ -39,7 +39,7 @@
protected String variableName;
public void perform(OpenExecution execution) {
- ScriptManager scriptManager = Environment.getFromCurrent(ScriptManager.class);
+ ScriptManager scriptManager = EnvironmentImpl.getFromCurrent(ScriptManager.class);
Object returnValue = scriptManager.evaluateScript(script, language);
if (variableName!=null) {
Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ScriptBinding.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ScriptBinding.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/ScriptBinding.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,7 @@
*/
package org.jbpm.jpdl.internal.activity;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.script.ScriptManager;
import org.jbpm.pvm.internal.util.XmlUtil;
import org.jbpm.pvm.internal.xml.Parse;
@@ -46,7 +46,7 @@
String script = XmlUtil.attribute(element, "expr");
Element textElement = XmlUtil.element(element, "text");
if(script!=null) {
- ScriptManager scriptManager = Environment.getFromCurrent(ScriptManager.class);
+ ScriptManager scriptManager = EnvironmentImpl.getFromCurrent(ScriptManager.class);
language = scriptManager.getDefaultExpressionLanguage();
if (textElement!=null) {
parse.addProblem("in <script ...> attribute expr can't be combined with a nexted text element", element);
Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/SubProcessActivity.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -27,7 +27,7 @@
import org.jbpm.api.activity.ActivityExecution;
import org.jbpm.pvm.internal.client.ClientProcessDefinition;
import org.jbpm.pvm.internal.env.Context;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.ExecutionContext;
import org.jbpm.pvm.internal.model.Activity;
import org.jbpm.pvm.internal.model.ExecutionImpl;
@@ -56,7 +56,7 @@
public void execute(ActivityExecution execution) {
ExecutionImpl executionImpl = (ExecutionImpl) execution;
- RepositorySession repositorySession = Environment.getFromCurrent(RepositorySession.class);
+ RepositorySession repositorySession = EnvironmentImpl.getFromCurrent(RepositorySession.class);
ClientProcessDefinition processDefinition = null;
@@ -100,7 +100,7 @@
ExecutionContext originalExecutionContext = null;
ExecutionContext subProcessExecutionContext = null;
- Environment environment = Environment.getCurrent();
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
if (environment!=null) {
originalExecutionContext = (ExecutionContext) environment.removeContext(Context.CONTEXTNAME_EXECUTION);
subProcessExecutionContext = new ExecutionContext((ExecutionImpl) subProcessInstance);
@@ -120,7 +120,7 @@
String subProcessActivityName = subProcessInstance.getActivityName();
if (outcomeExpression!=null) {
- ScriptManager scriptManager = Environment.getFromCurrent(ScriptManager.class);
+ ScriptManager scriptManager = EnvironmentImpl.getFromCurrent(ScriptManager.class);
Object value = scriptManager.evaluateExpression(outcomeExpression, null);
// if the value is a String and matches the name of an outgoing transition
if ( (value instanceof String)
Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/activity/TaskActivity.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -28,7 +28,7 @@
import org.jbpm.api.activity.ActivityExecution;
import org.jbpm.api.task.Task;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.history.HistoryEvent;
import org.jbpm.pvm.internal.history.events.TaskActivityStart;
import org.jbpm.pvm.internal.model.Activity;
@@ -58,7 +58,7 @@
}
public void execute(ExecutionImpl execution) {
- DbSession dbSession = Environment.getFromCurrent(DbSession.class);
+ DbSession dbSession = EnvironmentImpl.getFromCurrent(DbSession.class);
TaskImpl task = (TaskImpl) dbSession.createTask();
task.setTaskDefinition(taskDefinition);
task.setExecution(execution);
@@ -111,7 +111,7 @@
execution.fire(signalName, activity);
- DbSession taskDbSession = Environment
+ DbSession taskDbSession = EnvironmentImpl
.getFromCurrent(DbSession.class);
TaskImpl task = (TaskImpl) taskDbSession.findTaskByExecution(execution);
task.setSignalling(false);
Modified: jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/jpdl/src/main/java/org/jbpm/jpdl/internal/xml/JpdlParser.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -43,7 +43,7 @@
import org.jbpm.pvm.internal.email.impl.MailTemplate;
import org.jbpm.pvm.internal.email.impl.MailTemplateRegistry;
import org.jbpm.pvm.internal.email.spi.MailProducer;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.model.ActivityCoordinatesImpl;
import org.jbpm.pvm.internal.model.ActivityImpl;
import org.jbpm.pvm.internal.model.CompositeElementImpl;
@@ -316,7 +316,7 @@
timerDefinition.setDueDateDescription(duedate);
} else if (duedatetime!=null) {
- String dueDateTimeFormatText = (String) Environment.getFromCurrent("jbpm.duedatetime.format");
+ String dueDateTimeFormatText = (String) EnvironmentImpl.getFromCurrent("jbpm.duedatetime.format");
if (dueDateTimeFormatText==null) {
dueDateTimeFormatText = "HH:mm dd/MM/yyyy";
}
@@ -666,7 +666,7 @@
}
private static MailTemplate findTemplate(Element element, Parse parse, String templateName) {
- MailTemplateRegistry templateRegistry = Environment.getFromCurrent(MailTemplateRegistry.class);
+ MailTemplateRegistry templateRegistry = EnvironmentImpl.getFromCurrent(MailTemplateRegistry.class);
if (templateRegistry != null) {
MailTemplate template = templateRegistry.getTemplate(templateName);
if (template != null) return template;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/JbpmConfiguration.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -37,9 +37,11 @@
import org.jbpm.api.ProcessEngine;
import org.jbpm.api.RepositoryService;
import org.jbpm.api.TaskService;
+import org.jbpm.api.cmd.Command;
import org.jbpm.internal.log.Log;
+import org.jbpm.pvm.internal.cmd.CommandService;
import org.jbpm.pvm.internal.env.Context;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.env.JbpmConfigurationParser;
import org.jbpm.pvm.internal.env.PvmEnvironment;
@@ -195,7 +197,7 @@
return processEngineWireContext.get(RepositoryService.class);
}
- public Environment openEnvironment() {
+ public EnvironmentImpl openEnvironment() {
PvmEnvironment environment = new PvmEnvironment(this);
if (log.isTraceEnabled()) log.trace("opening " + environment);
@@ -207,7 +209,7 @@
return environment;
}
- protected void installAuthenticatedUserId(Environment environment) {
+ protected void installAuthenticatedUserId(EnvironmentImpl environment) {
String authenticatedUserId = authenticatedUserIdThreadLocal.get();
if (authenticatedUserId!=null) {
environment.setAuthenticatedUserId(authenticatedUserId);
@@ -220,13 +222,13 @@
// add the environment block context to the environment
environment.setContext(transactionContext);
- Environment.pushEnvironment(environment);
+ EnvironmentImpl.pushEnvironment(environment);
try {
// finish the creation of the environment wire context
transactionContext.create();
} catch (RuntimeException e) {
- Environment.popEnvironment();
+ EnvironmentImpl.popEnvironment();
throw e;
}
}
@@ -313,4 +315,13 @@
}
environmentObjects.add(userProvidedEnvironmentObject);
}
+
+ public <T> T execute(Command<T> command) {
+ EnvironmentImpl environment = openEnvironment();
+ try {
+ return get(CommandService.class).execute(command);
+ } finally {
+ environment.close();
+ }
+ }
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/SpringConfiguration.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/SpringConfiguration.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cfg/SpringConfiguration.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -27,7 +27,7 @@
import org.jbpm.api.ProcessEngine;
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.env.Context;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.env.PvmEnvironment;
import org.jbpm.pvm.internal.env.SpringContext;
@@ -81,7 +81,7 @@
return super.buildProcessEngine();
}
- public Environment openEnvironment() {
+ public EnvironmentImpl openEnvironment() {
PvmEnvironment environment = new PvmEnvironment(this);
if (log.isTraceEnabled())
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AbstractCommand.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AbstractCommand.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AbstractCommand.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,9 @@
*/
package org.jbpm.pvm.internal.cmd;
+import org.jbpm.api.cmd.Command;
+
/**
* @author Tom Baeyens
*/
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddParticipationCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddParticipationCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddParticipationCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -23,7 +23,7 @@
import org.hibernate.Session;
import org.jbpm.api.JbpmException;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.task.TaskImpl;
/**
@@ -48,7 +48,7 @@
}
public Object execute(Environment environment) throws Exception {
- Session session = Environment.getFromCurrent(Session.class);
+ Session session = environment.get(Session.class);
if (taskId!=null) {
TaskImpl task = (TaskImpl) session.get(TaskImpl.class, Long.parseLong(taskId));
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddReplyCommentCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddReplyCommentCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddReplyCommentCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,8 +22,8 @@
package org.jbpm.pvm.internal.cmd;
import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.api.history.HistoryComment;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.history.model.HistoryCommentImpl;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddTaskCommentCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddTaskCommentCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AddTaskCommentCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,8 +22,8 @@
package org.jbpm.pvm.internal.cmd;
import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.api.history.HistoryComment;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.history.model.HistoryCommentImpl;
import org.jbpm.pvm.internal.history.model.HistoryTaskImpl;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AssignTaskCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AssignTaskCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/AssignTaskCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.cmd;
import org.jbpm.api.JbpmException;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.history.HistoryEvent;
import org.jbpm.pvm.internal.history.events.TaskAssign;
import org.jbpm.pvm.internal.session.DbSession;
Deleted: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/Command.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/Command.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/Command.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -1,10 +0,0 @@
-package org.jbpm.pvm.internal.cmd;
-
-import java.io.Serializable;
-
-import org.jbpm.pvm.internal.env.Environment;
-
-public interface Command<T> extends Serializable {
-
- T execute(Environment environment) throws Exception;
-}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CommandService.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CommandService.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CommandService.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -1,6 +1,7 @@
package org.jbpm.pvm.internal.cmd;
import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Command;
/**
* abstract extensible session facade. Developers can use this directly or
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CompleteTaskCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CompleteTaskCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CompleteTaskCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.cmd;
import org.jbpm.api.JbpmException;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.task.TaskImpl;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CompositeCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CompositeCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CompositeCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -24,7 +24,8 @@
import java.util.ArrayList;
import java.util.List;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
/** container for executing multiple commands in one transaction.
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateDeploymentQueryCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateDeploymentQueryCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateDeploymentQueryCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,8 @@
*/
package org.jbpm.pvm.internal.cmd;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.query.DeploymentQueryImpl;
import org.jbpm.pvm.internal.query.JobQueryImpl;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateHistoryActivityInstanceQueryCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateHistoryActivityInstanceQueryCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateHistoryActivityInstanceQueryCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,8 @@
*/
package org.jbpm.pvm.internal.cmd;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.query.HistoryActivityInstanceQueryImpl;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateHistoryDetailQueryCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateHistoryDetailQueryCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateHistoryDetailQueryCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,8 @@
*/
package org.jbpm.pvm.internal.cmd;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.query.HistoryDetailQueryImpl;
import org.jbpm.pvm.internal.query.HistoryProcessInstanceQueryImpl;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateHistoryProcessInstanceQueryCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateHistoryProcessInstanceQueryCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateHistoryProcessInstanceQueryCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,8 @@
*/
package org.jbpm.pvm.internal.cmd;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.query.HistoryProcessInstanceQueryImpl;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateHistoryTaskQueryCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateHistoryTaskQueryCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateHistoryTaskQueryCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,8 @@
*/
package org.jbpm.pvm.internal.cmd;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.query.HistoryTaskQueryImpl;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateJobQueryCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateJobQueryCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateJobQueryCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,8 @@
*/
package org.jbpm.pvm.internal.cmd;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.query.JobQueryImpl;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateProcessDefinitionQueryCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateProcessDefinitionQueryCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateProcessDefinitionQueryCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,8 @@
*/
package org.jbpm.pvm.internal.cmd;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.query.ProcessDefinitionQueryImpl;
import org.jbpm.pvm.internal.session.RepositorySession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateProcessInstanceQueryCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateProcessInstanceQueryCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateProcessInstanceQueryCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,8 @@
*/
package org.jbpm.pvm.internal.cmd;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.query.ProcessInstanceQueryImpl;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateTaskQueryCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateTaskQueryCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/CreateTaskQueryCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,8 @@
*/
package org.jbpm.pvm.internal.cmd;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.query.TaskQueryImpl;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteCommentCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteCommentCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteCommentCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.cmd;
import org.jbpm.api.JbpmException;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteDeploymentCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteDeploymentCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteDeploymentCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -27,8 +27,9 @@
import org.jbpm.api.JbpmException;
import org.jbpm.api.ProcessDefinition;
import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.repository.DeploymentImpl;
import org.jbpm.pvm.internal.repository.RepositoryCache;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessDefinitionCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessDefinitionCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessDefinitionCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.cmd;
import org.jbpm.api.JbpmException;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.wire.binding.DbSessionBinding;
@@ -49,7 +49,7 @@
}
public Void execute(Environment environment) {
- DbSession dbSession = Environment.getFromCurrent(DbSession.class);
+ DbSession dbSession = environment.get(DbSession.class);
if (dbSession==null) {
throw new JbpmException("no "+DbSessionBinding.TAG+" configured");
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessInstance.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessInstance.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteProcessInstance.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,8 @@
*/
package org.jbpm.pvm.internal.cmd;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.session.DbSession;
@@ -45,7 +46,7 @@
}
public Void execute(Environment environment) throws Exception {
- DbSession dbSession = Environment.getFromCurrent(DbSession.class);
+ DbSession dbSession = EnvironmentImpl.getFromCurrent(DbSession.class);
dbSession.deleteProcessInstance(processInstanceId, cascade);
return null;
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteTaskCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteTaskCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeleteTaskCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.cmd;
import org.jbpm.api.JbpmException;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.history.model.HistoryTaskImpl;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.task.TaskImpl;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeployCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeployCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/DeployCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,8 @@
*/
package org.jbpm.pvm.internal.cmd;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.repository.DeploymentImpl;
import org.jbpm.pvm.internal.session.RepositorySession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/EndProcessInstance.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/EndProcessInstance.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/EndProcessInstance.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,8 @@
*/
package org.jbpm.pvm.internal.cmd;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.session.DbSession;
@@ -43,7 +44,7 @@
}
public Object execute(Environment environment) throws Exception {
- DbSession dbSession = Environment.getFromCurrent(DbSession.class);
+ DbSession dbSession = environment.get(DbSession.class);
ExecutionImpl processInstance = (ExecutionImpl) dbSession.findProcessInstanceById(processInstanceId);
processInstance.end(state);
return null;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ExecuteJobCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -24,9 +24,10 @@
import java.util.Date;
import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.api.job.Job;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.JobContext;
import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.job.JobImpl;
@@ -57,7 +58,8 @@
this.jobDbid = jobDbid;
}
- public Job execute(Environment environment) throws Exception {
+ public Job execute(Environment environmentInterface) throws Exception {
+ EnvironmentImpl environment = (EnvironmentImpl) environmentInterface;
DbSession dbSession = environment.get(DbSession.class);
if (dbSession==null) {
throw new JbpmException("no db-session configured");
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindExecutionCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -23,7 +23,7 @@
import org.jbpm.api.Execution;
import org.jbpm.api.JbpmException;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionByKeyCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionByKeyCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindLatestProcessDefinitionByKeyCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.cmd;
import org.jbpm.api.ProcessDefinition;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.model.OpenProcessDefinition;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionByIdCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionByIdCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionByIdCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.cmd;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.model.OpenProcessDefinition;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionKeysCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionKeysCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionKeysCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -23,7 +23,7 @@
import java.util.List;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionsByKeyCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionsByKeyCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/FindProcessDefinitionsByKeyCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -23,8 +23,8 @@
import java.util.List;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.client.ClientProcessDefinition;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetActivityCoordinatesCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetActivityCoordinatesCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetActivityCoordinatesCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,8 +22,9 @@
package org.jbpm.pvm.internal.cmd;
import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.api.model.ActivityCoordinates;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.model.ActivityImpl;
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
import org.jbpm.pvm.internal.session.RepositorySession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetExecutionVariableNamesCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetExecutionVariableNamesCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetExecutionVariableNamesCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -24,8 +24,8 @@
import java.util.Set;
import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.client.ClientExecution;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetExecutionVariablesCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetExecutionVariablesCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetExecutionVariablesCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -26,8 +26,8 @@
import java.util.Set;
import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.client.ClientExecution;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.session.DbSession;
/**
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetOutcomes.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetOutcomes.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetOutcomes.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -26,8 +26,9 @@
import java.util.Set;
import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.api.task.Task;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.model.ActivityImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.model.Transition;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetParticipantsCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetParticipantsCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetParticipantsCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -26,8 +26,8 @@
import org.hibernate.Query;
import org.hibernate.Session;
import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.api.task.Participation;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.task.ParticipationImpl;
@@ -65,7 +65,7 @@
throw new JbpmException("no task nor swimlane specified");
}
- Session session = Environment.getFromCurrent(Session.class);
+ Session session = environment.get(Session.class);
Query query = session.createQuery(hql.toString());
List<Participation> participations = query.list();
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetResourceAsStreamCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetResourceAsStreamCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetResourceAsStreamCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.cmd;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.session.RepositorySession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetStartActivityNamesCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetStartActivityNamesCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetStartActivityNamesCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -24,7 +24,8 @@
import java.util.ArrayList;
import java.util.List;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.model.ActivityImpl;
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
import org.jbpm.pvm.internal.session.RepositorySession;
@@ -46,7 +47,7 @@
public List<String> execute(Environment environment) {
List<String> activityNames = new ArrayList<String>();
- RepositorySession repositorySession = Environment.getFromCurrent(RepositorySession.class);
+ RepositorySession repositorySession = environment.get(RepositorySession.class);
ProcessDefinitionImpl processDefinition = repositorySession.findProcessDefinitionById(processDefinitionId);
for (ActivityImpl activity: (List<ActivityImpl>) processDefinition.getActivities()) {
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetStartFormResourceNameCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetStartFormResourceNameCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetStartFormResourceNameCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -23,7 +23,8 @@
import org.jbpm.api.JbpmException;
import org.jbpm.api.activity.ActivityBehaviour;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.model.ActivityImpl;
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
import org.jbpm.pvm.internal.session.RepositorySession;
@@ -49,7 +50,7 @@
}
public String execute(Environment environment) {
- RepositorySession repositorySession = Environment.getFromCurrent(RepositorySession.class);
+ RepositorySession repositorySession = environment.get(RepositorySession.class);
ProcessDefinitionImpl processDefinition = repositorySession.findProcessDefinitionById(processDefinitionId);
ActivityImpl activity = processDefinition.getActivity(activityName);
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetSubTasksCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetSubTasksCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetSubTasksCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -25,8 +25,8 @@
import org.hibernate.Query;
import org.hibernate.Session;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.api.task.Task;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.task.TaskImpl;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,8 +22,8 @@
package org.jbpm.pvm.internal.cmd;
import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.api.task.Task;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.task.TaskImpl;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskCommentsCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskCommentsCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskCommentsCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -25,8 +25,8 @@
import java.util.Collections;
import java.util.List;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.api.history.HistoryComment;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
import org.jbpm.pvm.internal.history.model.HistoryTaskImpl;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskVariableNamesCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskVariableNamesCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskVariableNamesCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -24,8 +24,8 @@
import java.util.Set;
import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.client.ClientExecution;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.task.TaskImpl;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskVariablesCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskVariablesCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/GetTaskVariablesCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -25,7 +25,7 @@
import java.util.Map;
import java.util.Set;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.task.TaskImpl;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/NewTaskCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/NewTaskCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/NewTaskCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,8 +21,8 @@
*/
package org.jbpm.pvm.internal.cmd;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.api.task.Task;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.task.TaskImpl;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/RemoveParticipantCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/RemoveParticipantCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/RemoveParticipantCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -26,7 +26,7 @@
import org.hibernate.Session;
import org.jbpm.api.JbpmException;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.task.ParticipationImpl;
import org.jbpm.pvm.internal.task.TaskImpl;
@@ -53,7 +53,7 @@
}
public Object execute(Environment environment) throws Exception {
- Session session = Environment.getFromCurrent(Session.class);
+ Session session = environment.get(Session.class);
if (taskDbid!=null) {
TaskImpl task = (TaskImpl) session.get(TaskImpl.class, taskDbid);
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ResumeDeploymentCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ResumeDeploymentCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/ResumeDeploymentCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,8 @@
*/
package org.jbpm.pvm.internal.cmd;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.repository.DeploymentImpl;
import org.jbpm.pvm.internal.session.RepositorySession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SaveTaskCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SaveTaskCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SaveTaskCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.cmd;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.history.HistoryEvent;
import org.jbpm.pvm.internal.history.HistorySession;
import org.jbpm.pvm.internal.history.events.TaskCreated;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SendMessageCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SendMessageCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SendMessageCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,8 +21,8 @@
*/
package org.jbpm.pvm.internal.cmd;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.api.job.Message;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.session.MessageSession;
/** sends a given message to the configured message service.
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SetExecutionVariablesCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SetExecutionVariablesCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SetExecutionVariablesCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,8 +22,8 @@
package org.jbpm.pvm.internal.cmd;
import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.client.ClientExecution;
-import org.jbpm.pvm.internal.env.Environment;
/**
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SetTaskVariablesCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SetTaskVariablesCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SetTaskVariablesCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.cmd;
import org.jbpm.api.JbpmException;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.task.TaskImpl;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SignalCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SignalCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SignalCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -25,8 +25,8 @@
import org.jbpm.api.JbpmException;
import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.client.ClientExecution;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.session.DbSession;
/**
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -26,9 +26,9 @@
import org.hibernate.Session;
import org.jbpm.api.JbpmException;
import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.client.ClientProcessDefinition;
import org.jbpm.pvm.internal.client.ClientProcessInstance;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.session.RepositorySession;
/**
@@ -61,7 +61,7 @@
processInstance.start();
if (!processInstance.isEnded()) {
- Session session = Environment.getFromCurrent(Session.class);
+ Session session = environment.get(Session.class);
session.save(processInstance);
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceInLatestCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceInLatestCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/StartProcessInstanceInLatestCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -26,9 +26,10 @@
import org.hibernate.Session;
import org.jbpm.api.JbpmException;
import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.client.ClientProcessDefinition;
import org.jbpm.pvm.internal.client.ClientProcessInstance;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.session.RepositorySession;
/**
@@ -64,7 +65,7 @@
processInstance.start();
if (!processInstance.isEnded()) {
- Session session = Environment.getFromCurrent(Session.class);
+ Session session = EnvironmentImpl.getFromCurrent(Session.class);
session.save(processInstance);
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SuspendDeploymentCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SuspendDeploymentCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/SuspendDeploymentCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,10 +22,10 @@
package org.jbpm.pvm.internal.cmd;
import org.jbpm.api.JbpmException;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.repository.DeploymentImpl;
import org.jbpm.pvm.internal.repository.RepositoryCache;
-import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.session.RepositorySession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/VariablesCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/VariablesCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/cmd/VariablesCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -25,8 +25,8 @@
import java.util.Map;
import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.client.ClientExecution;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.session.DbSession;
/**
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/DefaultAddressResolver.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/DefaultAddressResolver.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/DefaultAddressResolver.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -31,7 +31,7 @@
import org.jbpm.api.identity.Group;
import org.jbpm.api.identity.User;
import org.jbpm.pvm.internal.email.spi.AddressResolver;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.identity.spi.IdentitySession;
/**
@@ -53,7 +53,7 @@
}
public Address[] resolveAddresses(Group group) {
- List<User> users = Environment.getFromCurrent(IdentitySession.class)
+ List<User> users = EnvironmentImpl.getFromCurrent(IdentitySession.class)
.findUsersByGroup(group.getId());
int userCount = users.size();
Address[] addresses = new Address[userCount];
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/MailProducerImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/MailProducerImpl.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/email/impl/MailProducerImpl.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -50,7 +50,7 @@
import org.jbpm.api.identity.User;
import org.jbpm.pvm.internal.email.spi.AddressResolver;
import org.jbpm.pvm.internal.email.spi.MailProducer;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.identity.spi.IdentitySession;
import org.jbpm.pvm.internal.script.ScriptManager;
@@ -110,7 +110,7 @@
}
}
- Environment environment = Environment.getCurrent();
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
IdentitySession identitySession = environment.get(IdentitySession.class);
AddressResolver addressResolver = environment.get(AddressResolver.class);
@@ -133,7 +133,7 @@
}
private String evaluateExpression(String expression, Execution execution) {
- ScriptManager scriptManager = Environment.getFromCurrent(ScriptManager.class);
+ ScriptManager scriptManager = EnvironmentImpl.getFromCurrent(ScriptManager.class);
Object value = scriptManager.evaluateExpression(expression, template.getLanguage());
if (!(value instanceof String)) {
throw new JbpmException("expected expression '"
@@ -201,7 +201,7 @@
}
}
- Environment environment = Environment.getCurrent();
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
IdentitySession identitySession = environment.get(IdentitySession.class);
AddressResolver addressResolver = environment.get(AddressResolver.class);
@@ -366,7 +366,7 @@
// resolve and read classpath resource
else {
String resource = evaluateExpression(attachmentTemplate.getResource(), execution);
- targetUrl = Environment.getCurrent().getClassLoader().getResource(resource);
+ targetUrl = EnvironmentImpl.getCurrent().getClassLoader().getResource(resource);
if (targetUrl == null) {
throw new JbpmException("could not read attachment content, resource not found: "
+ resource);
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/BasicEnvironment.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/BasicEnvironment.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/BasicEnvironment.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -32,7 +32,7 @@
/**
* @author Tom Baeyens
*/
-public class BasicEnvironment extends Environment {
+public class BasicEnvironment extends EnvironmentImpl {
private static final long serialVersionUID = 1L;
@@ -149,7 +149,7 @@
public void close() {
log.trace("closing "+this);
- Environment popped = Environment.popEnvironment();
+ EnvironmentImpl popped = EnvironmentImpl.popEnvironment();
if (this!=popped) {
throw new JbpmException("environment nesting problem");
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Context.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Context.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Context.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -24,7 +24,7 @@
import java.util.Set;
/**
- * a group of named objects in an {@link Environment} that have a similar lifespan.
+ * a group of named objects in an {@link EnvironmentImpl} that have a similar lifespan.
*
* @author Tom Baeyens
*/
Deleted: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Environment.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Environment.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Environment.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -1,269 +0,0 @@
-/*
- * 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.env;
-
-import java.io.Serializable;
-import java.util.Stack;
-
-import org.jbpm.api.JbpmException;
-
-
-/**
- * maintains contextual information for a thread in a set of
- * {@link Context}s.
- *
- * <h3>Introduction</h3>
- *
- * <p>Objects have different lifecycles and different context's (aka scopes). An
- * environment provides the structure to easily manage objects with different
- * contexts.
- * </p>
- *
- * <p>Examples of contexts are:
- * <ul>
- * <li><b>process-engine</b>: The process-engine context is used to store e.g. data sources,
- * session factories and other static resources needed by an application.
- * The process-engine context lives for the complete duration of the {@link EnvironmentFactory}.
- * So if the {@link EnvironmentFactory} is maintained in a static member field, the
- * process-engine context lives for the duration of the application.
- * The same process-engine context is shared for all the Environments produced by one
- * EnvironmentFactory.</li>
- * <li><b>environment</b>: The environment context is used for e.g. a transaction
- * and transactional resources, user authentication. This results in an efficient and
- * configurable use of transactional resources that need to be lazily initialized.</li>
- * <li>The environment can accomodate other contexts as well. They can be added
- * and removed dynamically. Examples of other potential contexts are web-request, web-session,
- * web-application, business processDefinition, jobImpl, ... </li>
- * </ul>
- *
- * <center><img src="environment.gif"/></center>
- *
- * <p>An environment is typically installed like this
- * </p>
- *
- * <b><pre>static EnvironmentFactory environmentFactory = new DefaultEnvironmentFactory();
- *
- * ...
- *
- * Environment environment = environmentFactory.openEnvironment();
- * try {
- *
- * ... everything available in this block ...
- *
- * } finally {
- * environment.close();
- * }
- * </pre></b>
- *
- * <h3>Purpose</h3>
- *
- * <p>The first purpose of the environment is to separate the application from the
- * environment. Standard Java and Enterprise Java are quite different and an environment
- * abstraction like this allows for the development of applications that can run in
- * both Standard and Enterprise environments. Also test environments are easier to
- * tweak this way.
- * </p>
- *
- * <p>A second purpose of the environment is to enable specific to global searching
- * of resources. E.g. you could search for an 'adminEmailAddress' in the contexts
- * 'execution', 'transaction' and 'process-engine' in the given order.
- * That way, a global adminEmailAddress can be specified in the process-engine context
- * and it can be refined in more specific contexts.
- * </p>
- *
- * <h3>Search order</h3>
- *
- * <p>To find an object in the environment, a searchOrder can be specified. A
- * search order is an sequence that specifies the order in which the contexts should
- * be searched.
- * </p>
- *
- * <p>The default search order is the inverse sequence of how the contexts are
- * added to the environment. This is because in general, we can assume that the
- * more recent a context was added, the more specific it is.
- * </p>
- *
- * <h3>Transaction, username and classloader</h3>
- *
- * <p>Three objects are used so frequently in an environment that they get
- * special treatment:
- * </p>
- *
- * <ul>
- * <li><b>Transaction</b>: an abstraction for marking a transaction with
- * setRollbackOnly.</li>
- * <li><b>Classloader</b>: the current class loader.</li>
- * <li><b>Username</b>: the name of the currently authenticated user.</li>
- * </ul>
- *
- * <p>For these special properties, setters are also available. That is to support
- * programmatic injection into the environment. Alternatively, they can be configured
- * in one of the contexts.
- * </p>
- *
- *
- * @see EnvironmentFactory
- * @author Tom Baeyens
- */
-public abstract class Environment implements Serializable {
-
- /**
- * searches a named object in all the contexts in the default search order.
- * @return the object if it exists in the environment, <code>null</code> if there is no object with the given name in the environment.
- */
- public abstract Object get(String name);
-
- /**
- * searches a named object in all the contexts in the given search order. The given
- * search order doesn't have to include all contexts. It can be a subset of the
- * contexts available.
- * @param searchOrder list of contexts names. The object will be searched in these contexts, in the given order.
- * @return the object if it exists in the environment, <code>null</code> if there is no object with the given name in the specified searchOrder contexts.
- */
- public abstract Object get(String name, String[] searchOrder);
-
- /** searches an object based on type. The search doesn take superclasses of the context elements
- * into account.
- * @return the first object of the given type or null in case no such element was found.
- */
- public abstract <T> T get(Class<T> type);
-
-
- /** searches an object based on type. The search doesn take superclasses of the context elements
- * into account.
- * @return the first object of the given type or null in case no such element was found.
- */
- public abstract <T> T get(Class<T> type, String[] searchOrder);
-
- /** get the authenticated user id */
- public abstract String getAuthenticatedUserId();
-
- /** set the authenticated user id */
- public abstract void setAuthenticatedUserId(String authenticatedUserId);
-
- /**
- * closes the Environment by removing all its contexts.
- */
- public abstract void close();
-
- public abstract Context getContext(String contextName);
- public abstract void setContext(Context context);
- public abstract Context removeContext(Context context);
- public abstract Context removeContext(String contextName);
-
- public abstract ClassLoader getClassLoader();
- public abstract void setClassLoader(ClassLoader classLoader);
-
- // current environment //////////////////////////////////////////////////////
- /** the current environment is maintained in the currentEnvironment thread local */
- static ThreadLocal<Environment> currentEnvironment = new ThreadLocal<Environment>();
-
- /** in case of nested environments, the current environment stack maintains the outer environments */
- static ThreadLocal<Stack<Environment>> currentEnvironmentStack = new ThreadLocal<Stack<Environment>>();
-
- /** gets the most inner open environment. */
- public static Environment getCurrent() {
- return currentEnvironment.get();
- }
-
- public static <T> T getFromCurrent(Class<T> type) {
- return getFromCurrent(type, true);
- }
-
- public static <T> T getFromCurrent(Class<T> type, boolean required) {
- Environment environment = getCurrent();
- if (environment==null) {
- if (required) {
- throw new JbpmException("no environment to get "+type.getName());
- }
- return null;
- }
- T object = environment.get(type);
- if (object==null) {
- if (required) {
- throw new JbpmException("no "+type.getName()+" in current environment");
- }
- return null;
- }
- return object;
- }
-
- public static Object getFromCurrent(String name) {
- return getFromCurrent(name, true);
- }
-
- public static Object getFromCurrent(String name, boolean required) {
- Environment environment = getCurrent();
- if (environment==null) {
- if (required) {
- throw new JbpmException("no environment to get '"+name+"'");
- }
- return null;
- }
- Object object = environment.get(name);
- if (object==null) {
- if (required) {
- throw new JbpmException("no '"+name+"' in current environment");
- }
- return null;
- }
- return object;
- }
-
- static Stack<Environment> getStack() {
- // lazy initialize the current environment stack
- Stack<Environment> stack = currentEnvironmentStack.get();
- if (stack==null) {
- stack = new Stack<Environment>();
- currentEnvironmentStack.set(stack);
- }
- return stack;
- }
-
-
- /** pops the closing context from the stack of current contexts. This
- * is the first thing that needs to be done when an environment is closed.
- * @see EnvironmentFactory#push(Environment) */
- public static synchronized Environment popEnvironment() {
- Environment popped = currentEnvironment.get();
- currentEnvironment.set(null);
- Stack<Environment> stack = currentEnvironmentStack.get();
- if ( (stack!=null)
- && (! stack.isEmpty())
- ) {
- currentEnvironment.set(stack.pop());
- }
- return popped;
- }
-
- /** after opening of a new environment succeeded, the environment
- * must be pushed in the stack of current environments.
- *
- * @see Environment#pop() */
- public static synchronized void pushEnvironment(Environment environment) {
- Environment current = currentEnvironment.get();
- if (current!=null) {
- getStack().push(current);
- }
- currentEnvironment.set(environment);
- }
-}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/EnvironmentDefaults.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/EnvironmentDefaults.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/EnvironmentDefaults.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -37,7 +37,7 @@
public abstract class EnvironmentDefaults {
public static ScriptManager getScriptManager() {
- ScriptManager scriptManager = Environment.getFromCurrent(ScriptManager.class, false);
+ ScriptManager scriptManager = EnvironmentImpl.getFromCurrent(ScriptManager.class, false);
if (scriptManager!=null) {
return scriptManager;
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/EnvironmentFactory.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/EnvironmentFactory.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/EnvironmentFactory.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -28,7 +28,7 @@
import org.xml.sax.InputSource;
/**
- * factory for {@link Environment}s.
+ * factory for {@link EnvironmentImpl}s.
*
* <p>Default implementation is
* {@link PvmEnvironmentFactory}. EnvironmentFactory is thread safe, you
@@ -51,10 +51,10 @@
public interface EnvironmentFactory extends Context, Serializable {
/**
- * open a new Environment. The client is responsible for
- * closing the environment with {@link Environment#close()}.
+ * open a new EnvironmentImpl. The client is responsible for
+ * closing the environment with {@link EnvironmentImpl#close()}.
*/
- Environment openEnvironment();
+ EnvironmentImpl openEnvironment();
/**
* closes this environment factory and cleans any allocated
Copied: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/EnvironmentImpl.java (from rev 5474, jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/Environment.java)
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/EnvironmentImpl.java (rev 0)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/EnvironmentImpl.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -0,0 +1,270 @@
+/*
+ * 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.env;
+
+import java.io.Serializable;
+import java.util.Stack;
+
+import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Environment;
+
+
+/**
+ * maintains contextual information for a thread in a set of
+ * {@link Context}s.
+ *
+ * <h3>Introduction</h3>
+ *
+ * <p>Objects have different lifecycles and different context's (aka scopes). An
+ * environment provides the structure to easily manage objects with different
+ * contexts.
+ * </p>
+ *
+ * <p>Examples of contexts are:
+ * <ul>
+ * <li><b>process-engine</b>: The process-engine context is used to store e.g. data sources,
+ * session factories and other static resources needed by an application.
+ * The process-engine context lives for the complete duration of the {@link EnvironmentFactory}.
+ * So if the {@link EnvironmentFactory} is maintained in a static member field, the
+ * process-engine context lives for the duration of the application.
+ * The same process-engine context is shared for all the Environments produced by one
+ * EnvironmentFactory.</li>
+ * <li><b>environment</b>: The environment context is used for e.g. a transaction
+ * and transactional resources, user authentication. This results in an efficient and
+ * configurable use of transactional resources that need to be lazily initialized.</li>
+ * <li>The environment can accomodate other contexts as well. They can be added
+ * and removed dynamically. Examples of other potential contexts are web-request, web-session,
+ * web-application, business processDefinition, jobImpl, ... </li>
+ * </ul>
+ *
+ * <center><img src="environment.gif"/></center>
+ *
+ * <p>An environment is typically installed like this
+ * </p>
+ *
+ * <b><pre>static EnvironmentFactory environmentFactory = new DefaultEnvironmentFactory();
+ *
+ * ...
+ *
+ * EnvironmentImpl environment = environmentFactory.openEnvironment();
+ * try {
+ *
+ * ... everything available in this block ...
+ *
+ * } finally {
+ * environment.close();
+ * }
+ * </pre></b>
+ *
+ * <h3>Purpose</h3>
+ *
+ * <p>The first purpose of the environment is to separate the application from the
+ * environment. Standard Java and Enterprise Java are quite different and an environment
+ * abstraction like this allows for the development of applications that can run in
+ * both Standard and Enterprise environments. Also test environments are easier to
+ * tweak this way.
+ * </p>
+ *
+ * <p>A second purpose of the environment is to enable specific to global searching
+ * of resources. E.g. you could search for an 'adminEmailAddress' in the contexts
+ * 'execution', 'transaction' and 'process-engine' in the given order.
+ * That way, a global adminEmailAddress can be specified in the process-engine context
+ * and it can be refined in more specific contexts.
+ * </p>
+ *
+ * <h3>Search order</h3>
+ *
+ * <p>To find an object in the environment, a searchOrder can be specified. A
+ * search order is an sequence that specifies the order in which the contexts should
+ * be searched.
+ * </p>
+ *
+ * <p>The default search order is the inverse sequence of how the contexts are
+ * added to the environment. This is because in general, we can assume that the
+ * more recent a context was added, the more specific it is.
+ * </p>
+ *
+ * <h3>Transaction, username and classloader</h3>
+ *
+ * <p>Three objects are used so frequently in an environment that they get
+ * special treatment:
+ * </p>
+ *
+ * <ul>
+ * <li><b>Transaction</b>: an abstraction for marking a transaction with
+ * setRollbackOnly.</li>
+ * <li><b>Classloader</b>: the current class loader.</li>
+ * <li><b>Username</b>: the name of the currently authenticated user.</li>
+ * </ul>
+ *
+ * <p>For these special properties, setters are also available. That is to support
+ * programmatic injection into the environment. Alternatively, they can be configured
+ * in one of the contexts.
+ * </p>
+ *
+ *
+ * @see EnvironmentFactory
+ * @author Tom Baeyens
+ */
+public abstract class EnvironmentImpl implements Serializable, Environment {
+
+ /**
+ * searches a named object in all the contexts in the default search order.
+ * @return the object if it exists in the environment, <code>null</code> if there is no object with the given name in the environment.
+ */
+ public abstract Object get(String name);
+
+ /**
+ * searches a named object in all the contexts in the given search order. The given
+ * search order doesn't have to include all contexts. It can be a subset of the
+ * contexts available.
+ * @param searchOrder list of contexts names. The object will be searched in these contexts, in the given order.
+ * @return the object if it exists in the environment, <code>null</code> if there is no object with the given name in the specified searchOrder contexts.
+ */
+ public abstract Object get(String name, String[] searchOrder);
+
+ /** searches an object based on type. The search doesn take superclasses of the context elements
+ * into account.
+ * @return the first object of the given type or null in case no such element was found.
+ */
+ public abstract <T> T get(Class<T> type);
+
+
+ /** searches an object based on type. The search doesn take superclasses of the context elements
+ * into account.
+ * @return the first object of the given type or null in case no such element was found.
+ */
+ public abstract <T> T get(Class<T> type, String[] searchOrder);
+
+ /** get the authenticated user id */
+ public abstract String getAuthenticatedUserId();
+
+ /** set the authenticated user id */
+ public abstract void setAuthenticatedUserId(String authenticatedUserId);
+
+ /**
+ * closes the EnvironmentImpl by removing all its contexts.
+ */
+ public abstract void close();
+
+ public abstract Context getContext(String contextName);
+ public abstract void setContext(Context context);
+ public abstract Context removeContext(Context context);
+ public abstract Context removeContext(String contextName);
+
+ public abstract ClassLoader getClassLoader();
+ public abstract void setClassLoader(ClassLoader classLoader);
+
+ // current environment //////////////////////////////////////////////////////
+ /** the current environment is maintained in the currentEnvironment thread local */
+ static ThreadLocal<EnvironmentImpl> currentEnvironment = new ThreadLocal<EnvironmentImpl>();
+
+ /** in case of nested environments, the current environment stack maintains the outer environments */
+ static ThreadLocal<Stack<EnvironmentImpl>> currentEnvironmentStack = new ThreadLocal<Stack<EnvironmentImpl>>();
+
+ /** gets the most inner open environment. */
+ public static EnvironmentImpl getCurrent() {
+ return currentEnvironment.get();
+ }
+
+ public static <T> T getFromCurrent(Class<T> type) {
+ return getFromCurrent(type, true);
+ }
+
+ public static <T> T getFromCurrent(Class<T> type, boolean required) {
+ EnvironmentImpl environment = getCurrent();
+ if (environment==null) {
+ if (required) {
+ throw new JbpmException("no environment to get "+type.getName());
+ }
+ return null;
+ }
+ T object = environment.get(type);
+ if (object==null) {
+ if (required) {
+ throw new JbpmException("no "+type.getName()+" in current environment");
+ }
+ return null;
+ }
+ return object;
+ }
+
+ public static Object getFromCurrent(String name) {
+ return getFromCurrent(name, true);
+ }
+
+ public static Object getFromCurrent(String name, boolean required) {
+ EnvironmentImpl environment = getCurrent();
+ if (environment==null) {
+ if (required) {
+ throw new JbpmException("no environment to get '"+name+"'");
+ }
+ return null;
+ }
+ Object object = environment.get(name);
+ if (object==null) {
+ if (required) {
+ throw new JbpmException("no '"+name+"' in current environment");
+ }
+ return null;
+ }
+ return object;
+ }
+
+ static Stack<EnvironmentImpl> getStack() {
+ // lazy initialize the current environment stack
+ Stack<EnvironmentImpl> stack = currentEnvironmentStack.get();
+ if (stack==null) {
+ stack = new Stack<EnvironmentImpl>();
+ currentEnvironmentStack.set(stack);
+ }
+ return stack;
+ }
+
+
+ /** pops the closing context from the stack of current contexts. This
+ * is the first thing that needs to be done when an environment is closed.
+ * @see EnvironmentFactory#push(EnvironmentImpl) */
+ public static synchronized EnvironmentImpl popEnvironment() {
+ EnvironmentImpl popped = currentEnvironment.get();
+ currentEnvironment.set(null);
+ Stack<EnvironmentImpl> stack = currentEnvironmentStack.get();
+ if ( (stack!=null)
+ && (! stack.isEmpty())
+ ) {
+ currentEnvironment.set(stack.pop());
+ }
+ return popped;
+ }
+
+ /** after opening of a new environment succeeded, the environment
+ * must be pushed in the stack of current environments.
+ *
+ * @see EnvironmentImpl#pop() */
+ public static synchronized void pushEnvironment(EnvironmentImpl environment) {
+ EnvironmentImpl current = currentEnvironment.get();
+ if (current!=null) {
+ getStack().push(current);
+ }
+ currentEnvironment.set(environment);
+ }
+}
Property changes on: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/env/EnvironmentImpl.java
___________________________________________________________________
Name: svn:keywords
+ Id Revision
Name: svn:eol-style
+ LF
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/DbSessionImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/DbSessionImpl.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/hibernate/DbSessionImpl.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -37,7 +37,7 @@
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.client.ClientExecution;
import org.jbpm.pvm.internal.client.ClientProcessDefinition;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.history.model.HistoryCommentImpl;
import org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl;
import org.jbpm.pvm.internal.job.JobImpl;
@@ -255,7 +255,7 @@
}
// delete remaining jobs for this process instance
- JobImpl currentJob = Environment.getFromCurrent(JobImpl.class, false);
+ JobImpl currentJob = EnvironmentImpl.getFromCurrent(JobImpl.class, false);
List<JobImpl> jobs = findJobs(processInstanceId);
for (JobImpl job: jobs) {
if (job!=currentJob){
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistoryEvent.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistoryEvent.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/HistoryEvent.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -23,7 +23,7 @@
import java.io.Serializable;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
/** base class for process logs. Process logs are dispatched to the
@@ -53,7 +53,7 @@
}
public static void fire(HistoryEvent historyEvent, ExecutionImpl execution) {
- Environment environment = Environment.getCurrent();
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
if (environment!=null) {
HistorySession historySession = environment.get(HistorySession.class);
if (historySession!=null) {
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ActivityEnd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ActivityEnd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ActivityEnd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.history.events;
import org.hibernate.Session;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.history.HistoryEvent;
import org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl;
import org.jbpm.pvm.internal.util.Clock;
@@ -45,7 +45,7 @@
}
public void process() {
- Session session = Environment.getFromCurrent(Session.class);
+ Session session = EnvironmentImpl.getFromCurrent(Session.class);
Long historyActivityInstanceDbId = execution.getHistoryActivityInstanceDbid();
HistoryActivityInstanceImpl historyActivityInstance = (HistoryActivityInstanceImpl)
session.load(getHistoryActivityInstanceClass(), historyActivityInstanceDbId);
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ActivityStart.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ActivityStart.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ActivityStart.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.history.events;
import org.jbpm.api.history.HistoryProcessInstance;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.history.HistoryEvent;
import org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl;
import org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl;
@@ -37,7 +37,7 @@
private static final long serialVersionUID = 1L;
public void process() {
- DbSession dbSession = Environment.getFromCurrent(DbSession.class);
+ DbSession dbSession = EnvironmentImpl.getFromCurrent(DbSession.class);
long processInstanceDbid = execution.getProcessInstance().getDbid();
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceCreate.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceCreate.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceCreate.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -25,7 +25,7 @@
import org.hibernate.Session;
import org.jbpm.api.history.HistoryProcessInstance;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.history.HistoryEvent;
import org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl;
@@ -39,7 +39,7 @@
public void process() {
HistoryProcessInstance historyProcessInstanceImpl = new HistoryProcessInstanceImpl(execution);
- Session session = Environment.getFromCurrent(Session.class);
+ Session session = EnvironmentImpl.getFromCurrent(Session.class);
session.save(historyProcessInstanceImpl);
}
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceEnd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceEnd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/ProcessInstanceEnd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.history.events;
import org.hibernate.Session;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.history.HistoryEvent;
import org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl;
import org.jbpm.pvm.internal.util.Clock;
@@ -35,7 +35,7 @@
private static final long serialVersionUID = 1L;
public void process() {
- Session session = Environment.getFromCurrent(Session.class);
+ Session session = EnvironmentImpl.getFromCurrent(Session.class);
HistoryProcessInstanceImpl historyProcessInstanceImpl = (HistoryProcessInstanceImpl)
session.load(HistoryProcessInstanceImpl.class, execution.getDbid());
historyProcessInstanceImpl.setEndTime(Clock.getCurrentTime());
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskActivityStart.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskActivityStart.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskActivityStart.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.history.events;
import org.jbpm.api.history.HistoryProcessInstance;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.history.HistoryEvent;
import org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl;
import org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl;
@@ -47,7 +47,7 @@
}
public void process() {
- DbSession dbSession = Environment.getFromCurrent(DbSession.class);
+ DbSession dbSession = EnvironmentImpl.getFromCurrent(DbSession.class);
ExecutionImpl processInstance = execution.getProcessInstance();
long processInstanceDbid = processInstance.getDbid();
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskAssign.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskAssign.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskAssign.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.history.events;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.history.HistoryEvent;
import org.jbpm.pvm.internal.history.model.HistoryTaskImpl;
import org.jbpm.pvm.internal.session.DbSession;
@@ -43,7 +43,7 @@
}
public void process() {
- DbSession dbSession = Environment.getFromCurrent(DbSession.class);
+ DbSession dbSession = EnvironmentImpl.getFromCurrent(DbSession.class);
HistoryTaskImpl historyTaskInstance = (HistoryTaskImpl)
dbSession.get(HistoryTaskImpl.class, task.getDbid());
historyTaskInstance.setAssignee(assignee);
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskComplete.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskComplete.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskComplete.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -23,7 +23,7 @@
import org.hibernate.Session;
import org.jbpm.api.history.HistoryTask;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.history.HistoryEvent;
import org.jbpm.pvm.internal.history.model.HistoryTaskImpl;
import org.jbpm.pvm.internal.history.model.HistoryTaskInstanceImpl;
@@ -45,7 +45,7 @@
}
public void process() {
- Session session = Environment.getFromCurrent(Session.class);
+ Session session = EnvironmentImpl.getFromCurrent(Session.class);
Long historyActivityInstanceDbId = execution.getHistoryActivityInstanceDbid();
HistoryTaskInstanceImpl historyTaskInstance = (HistoryTaskInstanceImpl)
session.load(HistoryTaskInstanceImpl.class, historyActivityInstanceDbId);
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskCreated.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskCreated.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskCreated.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.history.events;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.history.HistoryEvent;
import org.jbpm.pvm.internal.history.model.HistoryTaskImpl;
import org.jbpm.pvm.internal.session.DbSession;
@@ -42,7 +42,7 @@
}
public void process() {
- DbSession dbSession = Environment.getFromCurrent(DbSession.class);
+ DbSession dbSession = EnvironmentImpl.getFromCurrent(DbSession.class);
HistoryTaskImpl historyTask = new HistoryTaskImpl(task);
dbSession.save(historyTask);
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskDelete.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskDelete.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskDelete.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.history.events;
import org.jbpm.api.JbpmException;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl;
import org.jbpm.pvm.internal.history.model.HistoryTaskImpl;
import org.jbpm.pvm.internal.history.model.HistoryTaskInstanceImpl;
@@ -53,7 +53,7 @@
protected void updateHistoryActivityInstance(HistoryActivityInstanceImpl historyActivityInstance) {
super.updateHistoryActivityInstance(historyActivityInstance);
- DbSession dbSession = Environment.getFromCurrent(DbSession.class);
+ DbSession dbSession = EnvironmentImpl.getFromCurrent(DbSession.class);
HistoryTaskImpl historyTask = (HistoryTaskImpl) dbSession.get(HistoryTaskImpl.class, task.getDbid());
historyTask.setState(reason);
historyTask.setEndTime(Clock.getCurrentTime());
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskUpdated.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskUpdated.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/TaskUpdated.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.history.events;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.history.HistoryEvent;
import org.jbpm.pvm.internal.history.model.HistoryTaskImpl;
import org.jbpm.pvm.internal.session.DbSession;
@@ -42,7 +42,7 @@
}
public void process() {
- DbSession dbSession = Environment.getFromCurrent(DbSession.class);
+ DbSession dbSession = EnvironmentImpl.getFromCurrent(DbSession.class);
HistoryTaskImpl historyTask = dbSession.get(HistoryTaskImpl.class, task.getDbid());
historyTask.updated(task);
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/VariableCreate.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/VariableCreate.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/VariableCreate.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -23,7 +23,7 @@
import org.jbpm.api.history.HistoryProcessInstance;
import org.jbpm.api.history.HistoryTask;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.history.HistoryEvent;
import org.jbpm.pvm.internal.history.model.HistoryProcessInstanceImpl;
import org.jbpm.pvm.internal.history.model.HistoryTaskImpl;
@@ -48,7 +48,7 @@
}
public void process() {
- DbSession dbSession = Environment.getFromCurrent(DbSession.class);
+ DbSession dbSession = EnvironmentImpl.getFromCurrent(DbSession.class);
dbSession.save(variable);
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/VariableUpdate.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/VariableUpdate.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/events/VariableUpdate.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.history.events;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.history.HistoryEvent;
import org.jbpm.pvm.internal.history.model.HistoryVariableImpl;
import org.jbpm.pvm.internal.session.DbSession;
@@ -43,7 +43,7 @@
@Override
public void process() {
- DbSession dbSession = Environment.getFromCurrent(DbSession.class);
+ DbSession dbSession = EnvironmentImpl.getFromCurrent(DbSession.class);
HistoryVariableImpl historyVariable = dbSession.get(HistoryVariableImpl.class, variable.getDbid());
historyVariable.updated(variable);
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryDetailImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryDetailImpl.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/history/model/HistoryDetailImpl.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -24,7 +24,7 @@
import java.io.Serializable;
import java.util.Date;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.util.Clock;
import org.jbpm.pvm.internal.util.EqualsUtil;
@@ -57,7 +57,7 @@
protected HistoryDetailImpl(String dummy) {
this.time = Clock.getCurrentTime();
- Environment environment = Environment.getCurrent();
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
if (environment!=null) {
this.userId = environment.getAuthenticatedUserId();
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateGroupCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateGroupCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateGroupCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,8 +21,8 @@
*/
package org.jbpm.pvm.internal.identity.cmd;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.identity.spi.IdentitySession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateMembershipCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateMembershipCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateMembershipCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,8 +21,8 @@
*/
package org.jbpm.pvm.internal.identity.cmd;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.identity.spi.IdentitySession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateUserCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateUserCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/CreateUserCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,8 +21,8 @@
*/
package org.jbpm.pvm.internal.identity.cmd;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.identity.spi.IdentitySession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteGroupCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteGroupCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteGroupCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,8 +21,8 @@
*/
package org.jbpm.pvm.internal.identity.cmd;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.identity.spi.IdentitySession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteMembershipCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteMembershipCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteMembershipCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,8 +21,8 @@
*/
package org.jbpm.pvm.internal.identity.cmd;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.identity.spi.IdentitySession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteUserCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteUserCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/DeleteUserCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,8 +21,8 @@
*/
package org.jbpm.pvm.internal.identity.cmd;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.identity.spi.IdentitySession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroupCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroupCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroupCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,9 +21,9 @@
*/
package org.jbpm.pvm.internal.identity.cmd;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.api.identity.Group;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.identity.spi.IdentitySession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroupsCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroupsCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindGroupsCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -23,9 +23,9 @@
import java.util.List;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.api.identity.Group;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.identity.spi.IdentitySession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUserCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUserCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUserCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,9 +21,9 @@
*/
package org.jbpm.pvm.internal.identity.cmd;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.api.identity.User;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.identity.spi.IdentitySession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUsersCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUsersCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/cmd/FindUsersCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -23,9 +23,9 @@
import java.util.List;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.api.identity.User;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.identity.spi.IdentitySession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JbpmIdentityStore.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JbpmIdentityStore.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/identity/impl/JbpmIdentityStore.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -25,7 +25,7 @@
import org.jboss.identity.idm.common.exception.IdentityException;
import org.jboss.identity.idm.impl.store.hibernate.HibernateIdentityStoreImpl;
import org.jboss.identity.idm.spi.store.IdentityStoreInvocationContext;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
/**
@@ -46,7 +46,7 @@
}
protected HibernateEntityManager getEntityManagerFromEnvironment() {
- return Environment.getFromCurrent(HibernateEntityManager.class);
+ return EnvironmentImpl.getFromCurrent(HibernateEntityManager.class);
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/CommandMessage.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/CommandMessage.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/CommandMessage.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,8 +22,8 @@
package org.jbpm.pvm.internal.job;
import org.jbpm.api.JbpmException;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.wire.Descriptor;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/JobImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/JobImpl.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/JobImpl.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -8,8 +8,8 @@
import java.util.Date;
import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Command;
import org.jbpm.api.job.Job;
-import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.lob.Lob;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.wire.Descriptor;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/job/TimerImpl.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -25,11 +25,12 @@
import java.util.Date;
import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.api.job.Timer;
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.cal.BusinessCalendar;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.env.EnvironmentDefaults;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.jobexecutor.JobAddedNotification;
import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
@@ -65,7 +66,7 @@
}
public void schedule() {
- TimerSession timerSession = Environment.getFromCurrent(TimerSession.class);
+ TimerSession timerSession = EnvironmentImpl.getFromCurrent(TimerSession.class);
timerSession.schedule(this);
}
@@ -73,7 +74,7 @@
ScriptManager scriptManager = EnvironmentDefaults.getScriptManager();
dueDateDescription = (String) scriptManager.evaluateExpression(dueDateDescription, null);
Date now = Clock.getCurrentTime();
- BusinessCalendar businessCalendar = Environment.getFromCurrent(BusinessCalendar.class);
+ BusinessCalendar businessCalendar = EnvironmentImpl.getFromCurrent(BusinessCalendar.class);
duedate = businessCalendar.add(now, dueDateDescription);
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/AcquireJobsCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/AcquireJobsCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/AcquireJobsCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -28,9 +28,9 @@
import java.util.Date;
import java.util.List;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.job.JobImpl;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/DispatcherThread.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/DispatcherThread.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/DispatcherThread.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -24,8 +24,8 @@
import java.util.Collection;
import java.util.Date;
+import org.jbpm.api.cmd.Command;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.cmd.CommandService;
/** this thread is responsible for acquiring jobs in the job that need to be
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/GetNextDueDateCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/GetNextDueDateCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/GetNextDueDateCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -23,9 +23,9 @@
import java.util.Date;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.job.JobImpl;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExceptionHandler.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExceptionHandler.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExceptionHandler.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -27,10 +27,10 @@
import javax.transaction.Synchronization;
import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.cmd.CommandService;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.job.JobImpl;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutor.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutor.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutor.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -36,8 +36,8 @@
import java.util.concurrent.TimeUnit;
import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Command;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.cmd.CommandService;
/** manager for job execution threads and their configuration.
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorMessageSession.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorMessageSession.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/jobexecutor/JobExecutorMessageSession.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -23,7 +23,7 @@
import org.jbpm.api.job.Message;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.session.MessageSession;
@@ -52,7 +52,7 @@
if (!isNotificationAdded) {
isNotificationAdded = true;
- JobExecutor jobExecutor = Environment.getCurrent().get(JobExecutor.class);
+ JobExecutor jobExecutor = EnvironmentImpl.getCurrent().get(JobExecutor.class);
if (jobExecutor!=null) {
// notify the job executor after the transaction is completed
log.trace("registering job executor notifier with "+transaction);
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/lob/Lob.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/lob/Lob.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/lob/Lob.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -25,7 +25,7 @@
import java.io.Serializable;
import java.util.List;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
/**
@@ -86,7 +86,7 @@
protected ClobStrategy getClobStrategy() {
ClobStrategy clobStrategy = null;
- Environment environment = Environment.getCurrent();
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
if (environment!=null) {
clobStrategy = environment.get(ClobStrategy.class);
}
@@ -99,7 +99,7 @@
}
protected BlobStrategy getBlobStrategy() {
- BlobStrategy blobStrategy = Environment.getFromCurrent(BlobStrategy.class, false);
+ BlobStrategy blobStrategy = EnvironmentImpl.getFromCurrent(BlobStrategy.class, false);
if (blobStrategy==null) {
blobStrategy = DEFAULT_BLOB_STRATEGY;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/DefaultIdGenerator.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/DefaultIdGenerator.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/DefaultIdGenerator.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -25,7 +25,7 @@
import org.jbpm.api.Execution;
import org.jbpm.api.ProcessDefinition;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
/**
@@ -37,7 +37,7 @@
public String createId(ProcessDefinition processDefinition, Execution parent, ExecutionImpl execution) {
- Session session = Environment.getFromCurrent(Session.class);
+ Session session = EnvironmentImpl.getFromCurrent(Session.class);
session.save(execution);
// the next flush is introduced because of the following situation:
// for hsqldb: id generation is done by inserting and then reading the id value
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerImpl.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -30,7 +30,7 @@
import org.jbpm.api.listener.EventListener;
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.cmd.CommandService;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.model.op.AtomicOperation;
import org.jbpm.pvm.internal.model.op.MoveToChildActivity;
@@ -118,7 +118,7 @@
public void handle(ExecutionImpl execution, Exception exception) {
if (isTransactional) {
- Environment environment = Environment.getCurrent();
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
Transaction transaction = (environment!=null ? environment.get(Transaction.class) : null);
if (transaction!=null) {
log.trace("registering exception handler to "+transaction);
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerSynchronization.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerSynchronization.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExceptionHandlerSynchronization.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -25,10 +25,9 @@
import javax.transaction.Synchronization;
import org.jbpm.api.JbpmException;
-import org.jbpm.pvm.internal.cmd.Command;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.cmd.CommandService;
-import org.jbpm.pvm.internal.env.Environment;
-import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ExecutionImpl.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -48,7 +48,7 @@
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.EnvironmentImpl;
import org.jbpm.pvm.internal.env.ExecutionContext;
import org.jbpm.pvm.internal.history.HistoryEvent;
import org.jbpm.pvm.internal.history.events.ActivityEnd;
@@ -278,13 +278,13 @@
protected void destroyTimers(CompositeElementImpl scope) {
- TimerSession timerSession = Environment.getFromCurrent(TimerSession.class, false);
+ TimerSession timerSession = EnvironmentImpl.getFromCurrent(TimerSession.class, false);
if (timerSession!=null) {
log.debug("destroying timers of "+this);
List<Timer> timers = timerSession.findTimersByExecution(this);
for (Timer timer: timers) {
- Job job = Environment.getFromCurrent(JobImpl.class, false);
+ Job job = EnvironmentImpl.getFromCurrent(JobImpl.class, false);
if (timer!=job) {
timerSession.cancel(timer);
}
@@ -358,7 +358,7 @@
superProcessExecution.signal();
}
- DbSession dbSession = Environment.getFromCurrent(DbSession.class, false);
+ DbSession dbSession = EnvironmentImpl.getFromCurrent(DbSession.class, false);
if (dbSession!=null) {
dbSession.deleteProcessInstance(id, false);
}
@@ -599,7 +599,7 @@
}
public void sendContinuationMessage(AtomicOperation operation) {
- Environment environment = Environment.getCurrent();
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
MessageSession messageSession = environment.get(MessageSession.class);
if (messageSession==null) {
throw new JbpmException("no message-session configured to send asynchronous continuation message");
@@ -618,7 +618,7 @@
ExecutionContext originalExecutionContext = null;
ExecutionContext executionContext = null;
- Environment environment = Environment.getCurrent();
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
if (environment!=null) {
originalExecutionContext = (ExecutionContext) environment.getContext(Context.CONTEXTNAME_EXECUTION);
if ( (originalExecutionContext!=null)
@@ -746,7 +746,7 @@
}
protected String resolveAssignmentExpression(String expression, String expressionLanguage) {
- ScriptManager scriptManager = Environment.getFromCurrent(ScriptManager.class);
+ ScriptManager scriptManager = EnvironmentImpl.getFromCurrent(ScriptManager.class);
Object result = scriptManager.evaluateExpression(expression, expressionLanguage);
if ( (result ==null)
|| (result instanceof String)
@@ -811,7 +811,7 @@
childExecution.name = name;
// id generation (after initialization)
- IdGenerator keyGenerator = Environment.getFromCurrent(IdGenerator.class, false);
+ IdGenerator keyGenerator = EnvironmentImpl.getFromCurrent(IdGenerator.class, false);
if (keyGenerator!=null) {
childExecution.id = keyGenerator.createId(getProcessDefinition(), this, childExecution);
}
@@ -979,7 +979,7 @@
public void suspend() {
super.suspend();
this.propagation = Propagation.EXPLICIT;
- DbSession dbSession = Environment.getFromCurrent(DbSession.class, false);
+ DbSession dbSession = EnvironmentImpl.getFromCurrent(DbSession.class, false);
if (dbSession!=null) {
dbSession.cascadeExecutionSuspend(this);
}
@@ -988,7 +988,7 @@
/** @see Execution#resume() */
public void resume() {
super.resume();
- DbSession hibernatePvmDbSession = Environment.getFromCurrent(DbSession.class, false);
+ DbSession hibernatePvmDbSession = EnvironmentImpl.getFromCurrent(DbSession.class, false);
if (hibernatePvmDbSession!=null) {
hibernatePvmDbSession.cascadeExecutionResume(this);
}
@@ -1093,7 +1093,7 @@
if ( (processDefinition==null)
&& (processDefinitionId!=null)
) {
- RepositorySession repositorySession = Environment.getFromCurrent(RepositorySession.class);
+ RepositorySession repositorySession = EnvironmentImpl.getFromCurrent(RepositorySession.class);
processDefinition = (ProcessDefinitionImpl) repositorySession.findProcessDefinitionById(processDefinitionId);
if (processDefinition==null) {
throw new JbpmException("couldn't find process definition "+processDefinitionId+" in the repository");
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ObjectReference.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ObjectReference.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ObjectReference.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.model;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.wire.Descriptor;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.WireDefinition;
@@ -88,11 +88,11 @@
}
protected T resolveValueExpression() {
- Environment environment = Environment.getCurrent();
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
return null;
}
- protected T resolveMethodExpression(Environment environment) {
+ protected T resolveMethodExpression(EnvironmentImpl environment) {
return null;
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ProcessDefinitionImpl.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -30,7 +30,7 @@
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.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.task.TaskDefinitionImpl;
/**
@@ -130,7 +130,7 @@
* is not persistent and there is an environment present (like in the case
* of task lifecycle for jpdl processes), this method needs to be overwritten. */
public IdGenerator getIdGenerator() {
- return Environment.getFromCurrent(IdGenerator.class, false);
+ return EnvironmentImpl.getFromCurrent(IdGenerator.class, false);
}
// task definitions /////////////////////////////////////////////////////////
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeInstanceImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeInstanceImpl.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/ScopeInstanceImpl.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -32,7 +32,7 @@
import org.jbpm.api.Execution;
import org.jbpm.api.JbpmException;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.history.HistoryEvent;
import org.jbpm.pvm.internal.history.events.VariableCreate;
import org.jbpm.pvm.internal.job.TimerImpl;
@@ -97,7 +97,7 @@
Type type = null;
if (type==null) {
- TypeSet typeSet = Environment.getFromCurrent(TypeSet.class, false);
+ TypeSet typeSet = EnvironmentImpl.getFromCurrent(TypeSet.class, false);
if (typeSet!=null) {
if (typeName!=null) {
type = typeSet.findTypeByName(typeName);
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableDefinitionImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableDefinitionImpl.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableDefinitionImpl.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -23,7 +23,7 @@
import java.io.Serializable;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.script.ScriptManager;
import org.jbpm.pvm.internal.wire.Descriptor;
import org.jbpm.pvm.internal.wire.WireContext;
@@ -54,7 +54,7 @@
return WireContext.create(initDescriptor);
}
if (initExpression!=null) {
- ScriptManager scriptManager = Environment.getFromCurrent(ScriptManager.class);
+ ScriptManager scriptManager = EnvironmentImpl.getFromCurrent(ScriptManager.class);
return scriptManager.evaluateExpression(initExpression, initLanguage);
}
return null;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableOutDefinitionSet.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableOutDefinitionSet.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/VariableOutDefinitionSet.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -26,7 +26,7 @@
import java.util.Collections;
import java.util.List;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.script.ScriptManager;
/**
@@ -44,7 +44,7 @@
for (VariableOutDefinitionImpl variableOutDefinition: variableOutDefinitions) {
String variableName = variableOutDefinition.getName();
if (variableName!=null) {
- ScriptManager scriptManager = Environment.getFromCurrent(ScriptManager.class);
+ ScriptManager scriptManager = EnvironmentImpl.getFromCurrent(ScriptManager.class);
// TODO update evaluateExpression so that scopeInstance can be passed in directly
String expression = variableOutDefinition.getExpression();
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteActivityMessage.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteActivityMessage.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteActivityMessage.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.model.op;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.job.MessageImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListenerMessage.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListenerMessage.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/ExecuteEventListenerMessage.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -24,7 +24,7 @@
import java.util.HashMap;
import java.util.Map;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.job.MessageImpl;
import org.jbpm.pvm.internal.model.ActivityImpl;
import org.jbpm.pvm.internal.model.EventImpl;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/SignalMessage.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/SignalMessage.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/SignalMessage.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -24,7 +24,7 @@
import java.util.Map;
import org.jbpm.api.Execution;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.job.MessageImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionStartActivityMessage.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionStartActivityMessage.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/model/op/TransitionStartActivityMessage.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.model.op;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.job.MessageImpl;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/AbstractQuery.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/AbstractQuery.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/AbstractQuery.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -27,9 +27,10 @@
import org.hibernate.Query;
import org.hibernate.Session;
import org.jbpm.api.JbpmException;
-import org.jbpm.pvm.internal.cmd.Command;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.cmd.CommandService;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
/**
@@ -60,7 +61,7 @@
if (commandService!=null) {
return (List) commandService.execute(this);
}
- Session session = Environment.getFromCurrent(Session.class);
+ Session session = EnvironmentImpl.getFromCurrent(Session.class);
return (List) execute(session);
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/AvgDurationPerActivityQueryCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/AvgDurationPerActivityQueryCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/AvgDurationPerActivityQueryCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -27,8 +27,8 @@
import org.hibernate.Query;
import org.hibernate.Session;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl;
/**
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ChoiceDistributionQueryCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ChoiceDistributionQueryCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ChoiceDistributionQueryCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -27,8 +27,8 @@
import org.hibernate.Query;
import org.hibernate.Session;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.history.model.HistoryActivityInstanceImpl;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/ProcessDefinitionQueryImpl.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -30,7 +30,7 @@
import org.jbpm.api.Deployment;
import org.jbpm.api.ProcessDefinition;
import org.jbpm.api.ProcessDefinitionQuery;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
import org.jbpm.pvm.internal.repository.DeploymentImpl;
import org.jbpm.pvm.internal.repository.DeploymentProperty;
@@ -68,7 +68,7 @@
for (Map<String, Object> properties: propertyMaps) {
String deploymentId = properties.get("deploymentDbid").toString();
String objectName = (String)properties.get("objectName");
- RepositorySession repositorySession = Environment.getFromCurrent(RepositorySession.class);
+ RepositorySession repositorySession = EnvironmentImpl.getFromCurrent(RepositorySession.class);
ProcessDefinitionImpl processDefinition = (ProcessDefinitionImpl) repositorySession.getObject(deploymentId, objectName);
processDefinitions.add(processDefinition);
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/TaskQueryImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/TaskQueryImpl.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/query/TaskQueryImpl.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -30,7 +30,7 @@
import org.jbpm.api.identity.Group;
import org.jbpm.api.task.Task;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.identity.spi.IdentitySession;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.task.ParticipationImpl;
@@ -150,7 +150,7 @@
appendWhereClause("participant.task = task ", hql);
appendWhereClause("participant.type = 'candidate' ", hql);
- IdentitySession identitySession = Environment.getFromCurrent(IdentitySession.class);
+ IdentitySession identitySession = EnvironmentImpl.getFromCurrent(IdentitySession.class);
List<Group> groups = identitySession.findGroupsByUser(candidate);
if (groups.isEmpty()) {
groupIds = null;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeployerManager.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -26,7 +26,7 @@
import org.jbpm.api.JbpmException;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.xml.Problem;
@@ -52,7 +52,7 @@
throw jbpmException;
}
- RepositoryCache repositoryCache = Environment.getFromCurrent(RepositoryCache.class);
+ RepositoryCache repositoryCache = EnvironmentImpl.getFromCurrent(RepositoryCache.class);
repositoryCache.set(deployment.getId(), deployment.getObjects());
}
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/DeploymentImpl.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -40,7 +40,7 @@
import org.jbpm.api.JbpmException;
import org.jbpm.pvm.internal.cmd.CommandService;
import org.jbpm.pvm.internal.cmd.DeployCmd;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.lob.Lob;
import org.jbpm.pvm.internal.stream.ByteArrayStreamInput;
import org.jbpm.pvm.internal.stream.FileStreamInput;
@@ -251,10 +251,10 @@
state = Deployment.STATE_SUSPENDED;
- RepositorySessionImpl repositorySession = Environment.getFromCurrent(RepositorySessionImpl.class);
+ RepositorySessionImpl repositorySession = EnvironmentImpl.getFromCurrent(RepositorySessionImpl.class);
repositorySession.cascadeDeploymentSuspend(this);
- RepositoryCache repositoryCache = Environment.getFromCurrent(RepositoryCache.class);
+ RepositoryCache repositoryCache = EnvironmentImpl.getFromCurrent(RepositoryCache.class);
repositoryCache.remove(Long.toString(dbid));
}
@@ -265,10 +265,10 @@
state = Deployment.STATE_ACTIVE;
- RepositorySessionImpl repositorySession = Environment.getFromCurrent(RepositorySessionImpl.class);
+ RepositorySessionImpl repositorySession = EnvironmentImpl.getFromCurrent(RepositorySessionImpl.class);
repositorySession.cascadeDeploymentResume(this);
- RepositoryCache repositoryCache = Environment.getFromCurrent(RepositoryCache.class);
+ RepositoryCache repositoryCache = EnvironmentImpl.getFromCurrent(RepositoryCache.class);
repositoryCache.remove(Long.toString(dbid));
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/ProcessDeployer.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/ProcessDeployer.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/repository/ProcessDeployer.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -28,7 +28,7 @@
import org.jbpm.api.ProcessDefinition;
import org.jbpm.api.ProcessDefinitionQuery;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
import org.jbpm.pvm.internal.session.RepositorySession;
import org.jbpm.pvm.internal.xml.Parse;
@@ -112,7 +112,7 @@
processDefinition.setKey(processDefinitionKey);
}
- RepositorySession repositorySession = Environment.getFromCurrent(RepositorySession.class);
+ RepositorySession repositorySession = EnvironmentImpl.getFromCurrent(RepositorySession.class);
List<ProcessDefinition> existingProcesses = repositorySession.createProcessDefinitionQuery()
.processDefinitionName(processDefinitionName)
@@ -143,7 +143,7 @@
processDefinition.setId(id);
}
- RepositorySession repositorySession = Environment.getFromCurrent(RepositorySession.class);
+ RepositorySession repositorySession = EnvironmentImpl.getFromCurrent(RepositorySession.class);
ProcessDefinition existingProcessDefinition = repositorySession.createProcessDefinitionQuery()
.processDefinitionId(id)
.uniqueResult();
@@ -156,7 +156,7 @@
int version = processDefinition.getVersion();
String key = processDefinition.getKey();
if (version==ProcessDefinitionImpl.UNASSIGNED_VERSION) {
- RepositorySession repositorySession = Environment.getFromCurrent(RepositorySession.class);
+ RepositorySession repositorySession = EnvironmentImpl.getFromCurrent(RepositorySession.class);
ProcessDefinition latestDeployedVersion = repositorySession
.createProcessDefinitionQuery()
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/EnvironmentBindings.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/EnvironmentBindings.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/script/EnvironmentBindings.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -27,7 +27,7 @@
import javax.script.Bindings;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
/**
@@ -35,10 +35,10 @@
*/
public class EnvironmentBindings implements Bindings {
- protected Environment environment;
+ protected EnvironmentImpl environment;
public EnvironmentBindings(String[] readContextNames, String writeContextName) {
- environment = Environment.getCurrent();
+ environment = EnvironmentImpl.getCurrent();
}
public Object get(Object key) {
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/CommandTransactionCallback.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/CommandTransactionCallback.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/spring/CommandTransactionCallback.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.spring;
-import org.jbpm.pvm.internal.cmd.Command;
+import org.jbpm.api.cmd.Command;
import org.jbpm.pvm.internal.cmd.CommandService;
import org.springframework.orm.hibernate3.HibernateTransactionManager;
import org.springframework.orm.hibernate3.SessionFactoryUtils;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AsyncCommandMessage.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AsyncCommandMessage.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AsyncCommandMessage.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,9 +22,11 @@
package org.jbpm.pvm.internal.svc;
import org.jbpm.api.Execution;
-import org.jbpm.pvm.internal.cmd.Command;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
+import org.jbpm.api.job.Job;
import org.jbpm.pvm.internal.cmd.CommandService;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.job.MessageImpl;
@@ -47,7 +49,8 @@
this.userId = userId;
}
- public Object execute(Environment environment) throws Exception {
+ public Object execute(Environment environmentInterface) throws Exception {
+ EnvironmentImpl environment = (EnvironmentImpl) environmentInterface;
execution.setState(Execution.STATE_ACTIVE_ROOT);
if (userId!=null) {
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AsyncCommandService.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AsyncCommandService.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AsyncCommandService.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,9 +22,9 @@
package org.jbpm.pvm.internal.svc;
import org.jbpm.api.JbpmException;
-import org.jbpm.pvm.internal.cmd.Command;
+import org.jbpm.api.cmd.Command;
import org.jbpm.pvm.internal.cmd.CommandService;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.session.MessageSession;
@@ -36,7 +36,7 @@
boolean propagateUserId = true;
public <T> T execute(Command<T> command) {
- Environment environment = Environment.getCurrent();
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
if (environment==null) {
throw new JbpmException("no environment for verifying authorization");
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AuthorizationInterceptor.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AuthorizationInterceptor.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AuthorizationInterceptor.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,8 +22,8 @@
package org.jbpm.pvm.internal.svc;
import org.jbpm.api.JbpmException;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
/** performs an authorization check before the command is executed.
* @author Tom Baeyens
@@ -31,7 +31,7 @@
public class AuthorizationInterceptor extends Interceptor {
public <T> T execute(Command<T> command) {
- Environment environment = Environment.getCurrent();
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
if (environment==null) {
throw new JbpmException("no environment for verifying authorization");
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AuthorizationSession.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AuthorizationSession.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/AuthorizationSession.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -1,9 +1,9 @@
package org.jbpm.pvm.internal.svc;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
public interface AuthorizationSession {
- void checkPermission(Command<?> command, Environment environment);
+ void checkPermission(Command<?> command, EnvironmentImpl environment);
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/DefaultCommandService.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/DefaultCommandService.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/DefaultCommandService.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,10 +22,10 @@
package org.jbpm.pvm.internal.svc;
import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Command;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.cmd.CommandService;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
/**
@@ -36,7 +36,7 @@
private static final Log log = Log.getLog(DefaultCommandService.class.getName());
public <T> T execute(Command<T> command) {
- Environment environment = Environment.getCurrent();
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
try {
return command.execute(environment);
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/EnvironmentInterceptor.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/EnvironmentInterceptor.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/EnvironmentInterceptor.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,9 +21,9 @@
*/
package org.jbpm.pvm.internal.svc;
-import org.jbpm.pvm.internal.cmd.Command;
+import org.jbpm.api.cmd.Command;
import org.jbpm.pvm.internal.env.Context;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.descriptor.ProvidedObjectDescriptor;
@@ -38,7 +38,7 @@
protected EnvironmentFactory environmentFactory;
public <T> T execute(Command<T> command) {
- Environment environment;
+ EnvironmentImpl environment;
environment = environmentFactory.openEnvironment();
try {
@@ -50,7 +50,7 @@
}
}
- protected void injectEnvironmentObjects(Environment environment) {
+ protected void injectEnvironmentObjects(EnvironmentImpl environment) {
WireContext transactionContext = (WireContext) environment.getContext(Context.CONTEXTNAME_TRANSACTION);
transactionContext.getWireDefinition().addDescriptor(new ProvidedObjectDescriptor());
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/FindGroupIds.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/FindGroupIds.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/FindGroupIds.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -3,9 +3,9 @@
import java.util.ArrayList;
import java.util.List;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.api.identity.Group;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.identity.cmd.FindGroupsCmd;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/RetryInterceptor.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/RetryInterceptor.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/RetryInterceptor.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,8 +22,8 @@
package org.jbpm.pvm.internal.svc;
import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Command;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.cmd.Command;
import org.hibernate.StaleStateException;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/SerializeInterceptor.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/SerializeInterceptor.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/svc/SerializeInterceptor.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -27,8 +27,8 @@
import java.io.ObjectOutputStream;
import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Command;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.cmd.Command;
/**
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/task/TaskImpl.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -35,7 +35,7 @@
import org.jbpm.api.task.Swimlane;
import org.jbpm.api.task.Task;
import org.jbpm.pvm.internal.client.ClientExecution;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.history.HistoryEvent;
import org.jbpm.pvm.internal.history.events.TaskComplete;
import org.jbpm.pvm.internal.history.events.TaskDelete;
@@ -228,7 +228,7 @@
}
public TaskImpl createSubTask() {
- DbSession dbSession = Environment.getFromCurrent(DbSession.class);
+ DbSession dbSession = EnvironmentImpl.getFromCurrent(DbSession.class);
TaskImpl subTask = (TaskImpl) dbSession.createTask();
if (subTasks == null) {
subTasks = new HashSet<TaskImpl>();
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/test/JobTestHelper.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/test/JobTestHelper.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/test/JobTestHelper.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -24,11 +24,11 @@
import org.hibernate.Query;
import org.hibernate.Session;
import org.jbpm.api.Execution;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.api.job.Job;
-import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.cmd.CommandService;
import org.jbpm.pvm.internal.cmd.ExecuteJobCmd;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.job.MessageImpl;
import org.jbpm.pvm.internal.job.TimerImpl;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionInterceptor.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionInterceptor.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/SpringTransactionInterceptor.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -23,9 +23,9 @@
import org.hibernate.Session;
import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Command;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.spring.CommandTransactionCallback;
import org.jbpm.pvm.internal.svc.Interceptor;
import org.springframework.transaction.PlatformTransactionManager;
@@ -48,7 +48,7 @@
@SuppressWarnings("unchecked")
public <T> T execute(Command<T> command) {
- Environment environment = Environment.getCurrent();
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
if (environment == null) {
throw new JbpmException("no environment for managing hibernate transaction");
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/StandardTransactionInterceptor.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/StandardTransactionInterceptor.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/StandardTransactionInterceptor.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,9 +22,9 @@
package org.jbpm.pvm.internal.tx;
import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Command;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.svc.Interceptor;
@@ -38,7 +38,7 @@
private static final Log log = Log.getLog(StandardTransactionInterceptor.class.getName());
public <T> T execute(Command<T> command) {
- Environment environment = Environment.getCurrent();
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
if (environment==null) {
throw new JbpmException("no environment for managing hibernate transaction");
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaRetryInterceptor.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaRetryInterceptor.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaRetryInterceptor.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -24,9 +24,9 @@
import javax.transaction.Status;
import javax.transaction.UserTransaction;
+import org.jbpm.api.cmd.Command;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.svc.RetryInterceptor;
@@ -38,7 +38,7 @@
private static Log log = Log.getLog(JtaRetryInterceptor.class.getName());
public <T> T execute(Command<T> command) {
- JtaTransaction jtaTransaction = Environment.getFromCurrent(JtaTransaction.class);
+ JtaTransaction jtaTransaction = EnvironmentImpl.getFromCurrent(JtaTransaction.class);
UserTransaction userTransaction = jtaTransaction.lookupJeeUserTransaction();
int status = JtaTransaction.getUserTransactionStatus(userTransaction);
if (status == Status.STATUS_NO_TRANSACTION) {
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransactionInterceptor.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransactionInterceptor.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/tx/jta/JtaTransactionInterceptor.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -27,9 +27,9 @@
import javax.transaction.UserTransaction;
import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Command;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.svc.Interceptor;
@@ -41,7 +41,7 @@
private static Log log = Log.getLog(JtaTransactionInterceptor.class.getName());
public <T> T execute(Command<T> command) {
- JtaTransaction jtaTransaction = Environment.getFromCurrent(JtaTransaction.class);
+ JtaTransaction jtaTransaction = EnvironmentImpl.getFromCurrent(JtaTransaction.class);
UserTransaction userTransaction = jtaTransaction.lookupJeeUserTransaction();
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/Variable.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/Variable.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/Variable.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -24,7 +24,7 @@
import java.io.Serializable;
import org.jbpm.api.JbpmException;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.history.HistoryEvent;
import org.jbpm.pvm.internal.history.HistorySession;
import org.jbpm.pvm.internal.history.events.VariableUpdate;
@@ -89,7 +89,7 @@
}
setObject(value);
- HistorySession historySession = Environment.getFromCurrent(HistorySession.class, false);
+ HistorySession historySession = EnvironmentImpl.getFromCurrent(HistorySession.class, false);
if ( isHistoryEnabled
&& (historySession!=null)
) {
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/matcher/HibernateIdMatcher.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/matcher/HibernateIdMatcher.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/matcher/HibernateIdMatcher.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -25,7 +25,7 @@
import org.hibernate.metadata.ClassMetadata;
import org.hibernate.type.Type;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.type.Matcher;
@@ -48,7 +48,7 @@
public boolean matches(String name, Object value) {
boolean matches = false;
- Environment environment = Environment.getCurrent();
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
if (environment!=null) {
SessionFactory sessionFactory = null;
if (hibernateSessionFactoryName!=null) {
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/variable/BlobVariable.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/variable/BlobVariable.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/type/variable/BlobVariable.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.type.variable;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.lob.Lob;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.type.Variable;
@@ -44,7 +44,7 @@
public void setObject(Object value) {
if (this.lob!=null) {
- DbSession dbSession = Environment.getFromCurrent(DbSession.class, false);
+ DbSession dbSession = EnvironmentImpl.getFromCurrent(DbSession.class, false);
if (dbSession!=null) {
dbSession.delete(this.lob);
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/util/ReflectUtil.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -12,7 +12,7 @@
import org.jbpm.api.JbpmException;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.wire.descriptor.ArgDescriptor;
public abstract class ReflectUtil {
@@ -27,7 +27,7 @@
}
// 2) if the user provided a classloader through the environment, use that one
- Environment environment = Environment.getCurrent();
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
if (environment!=null) {
classLoader = environment.getClassLoader();
if (classLoader!=null) {
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -33,7 +33,7 @@
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.cfg.JbpmConfiguration;
import org.jbpm.pvm.internal.env.Context;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.model.ProcessElementImpl;
import org.jbpm.pvm.internal.util.Closable;
@@ -64,7 +64,7 @@
*
* <h3>Purpose</h3>
*
- * <p>A WireContext is used often in combination with {@link Environment} to
+ * <p>A WireContext is used often in combination with {@link EnvironmentImpl} to
* decouple the processDefinition virtual machine from its environment. In the
* {@link JbpmConfiguration}, both the process-engine context and
* the environment contexts are WireContexts. The PVM will use the persistence service,
@@ -136,7 +136,7 @@
* <li><b>{@link SubscribeOperation}</b>: subscribes to an {@link Observable observable}.</li>
* </ul>
*
- * <h3>Environment</h3>
+ * <h3>EnvironmentImpl</h3>
*
* <p>When an environment is injected into a WireContext, lookup of all
* referenced object names will be done first in this WireContext, but
@@ -228,7 +228,7 @@
this(wireDefinition, null, null, false);
}
- /** when this {@link Context} is used in an {@link Environment}, it
+ /** when this {@link Context} is used in an {@link EnvironmentImpl}, it
* needs a name. */
public WireContext(WireDefinition wireDefinition, String name) {
this.wireDefinition = wireDefinition;
@@ -246,7 +246,7 @@
* set and the scope needs to be added to the environment before the creation of this wire scope is done.
* @see JbpmConfiguration#openEnvironment()
*/
- public WireContext(WireDefinition wireDefinition, String name, Environment environment, boolean delayCreate) {
+ public WireContext(WireDefinition wireDefinition, String name, EnvironmentImpl environment, boolean delayCreate) {
this.wireDefinition = wireDefinition;
this.name = name;
this.classLoader = (wireDefinition!=null ? wireDefinition.getClassLoader() : null);
@@ -265,7 +265,7 @@
/**
* initializes the eager objects and then fires the create event. This method
* only needs to be called explicitly in case <code>delayCreate</code> is true
- * in {@link #WireContext(WireDefinition, String, Environment, boolean)}.
+ * in {@link #WireContext(WireDefinition, String, EnvironmentImpl, boolean)}.
*/
public void create() {
log.trace("creating "+name);
@@ -422,7 +422,7 @@
}
// then check if we can find it in the environment (if one is available)
- Environment environment = Environment.getCurrent();
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
if (environment!=null) {
log.trace("delivering "+objectName+" from environment");
return environment.get(objectName);
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/EnvRefBinding.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/EnvRefBinding.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/EnvRefBinding.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,13 +21,13 @@
*/
package org.jbpm.pvm.internal.wire.binding;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.wire.descriptor.EnvironmentDescriptor;
import org.jbpm.pvm.internal.xml.Parse;
import org.jbpm.pvm.internal.xml.Parser;
import org.w3c.dom.Element;
-/** parses a descriptor for obtaining a reference to the {@link Environment}.
+/** parses a descriptor for obtaining a reference to the {@link EnvironmentImpl}.
*
* See schema docs for more details.
*
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/VersionTimestampPolicy.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/VersionTimestampPolicy.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/VersionTimestampPolicy.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -24,7 +24,7 @@
import java.io.Serializable;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.repository.DeploymentImpl;
/**
@@ -138,9 +138,9 @@
return evaluation;
}
- private Environment getEnvironment()
+ private EnvironmentImpl getEnvironment()
{
- Environment environment = Environment.getCurrent();
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
if (environment==null)
throw new RuntimeException("Failed to access current environment");
return environment;
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ContextRefDescriptor.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ContextRefDescriptor.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ContextRefDescriptor.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -1,6 +1,6 @@
package org.jbpm.pvm.internal.wire.descriptor;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.wire.Descriptor;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.WireException;
@@ -15,7 +15,7 @@
if (contextName==null) {
return wireContext;
}
- Environment environment = Environment.getCurrent();
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
if (environment==null) {
throw new WireException("can't get context '"+contextName+"': no current environment");
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/EnvDescriptor.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/EnvDescriptor.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/EnvDescriptor.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.wire.descriptor;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.WireException;
@@ -47,7 +47,7 @@
}
public Object construct(WireContext wireContext) {
- Environment environment = Environment.getCurrent();
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
if (environment==null) {
throw new WireException("no environment to get object "+(objectName!=null ? objectName : typeName));
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/EnvironmentDescriptor.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/EnvironmentDescriptor.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/EnvironmentDescriptor.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -1,6 +1,6 @@
package org.jbpm.pvm.internal.wire.descriptor;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.wire.Descriptor;
import org.jbpm.pvm.internal.wire.WireContext;
@@ -18,6 +18,6 @@
private static final long serialVersionUID = 1L;
public Object construct(WireContext wireContext) {
- return Environment.getCurrent();
+ return EnvironmentImpl.getCurrent();
}
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateSessionDescriptor.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateSessionDescriptor.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateSessionDescriptor.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -27,7 +27,7 @@
import org.hibernate.SessionFactory;
import org.hibernate.impl.SessionImpl;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.tx.HibernateSessionResource;
import org.jbpm.pvm.internal.tx.StandardTransaction;
import org.jbpm.pvm.internal.wire.WireContext;
@@ -50,7 +50,7 @@
protected String connectionName;
public Object construct(WireContext wireContext) {
- Environment environment = Environment.getCurrent();
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
if (environment==null) {
throw new WireException("no environment");
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JbossIdmIdentitySessionDescriptor.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JbossIdmIdentitySessionDescriptor.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/JbossIdmIdentitySessionDescriptor.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -25,7 +25,7 @@
import org.jboss.identity.idm.api.IdentitySessionFactory;
import org.jboss.identity.idm.common.exception.IdentityException;
import org.jbpm.api.JbpmException;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.identity.impl.IdentitySessionResource;
import org.jbpm.pvm.internal.identity.impl.JBossIdmIdentitySessionImpl;
import org.jbpm.pvm.internal.tx.StandardTransaction;
@@ -45,11 +45,11 @@
public Object construct(WireContext wireContext) {
- IdentitySessionFactory identitySessionFactory = Environment.getFromCurrent(IdentitySessionFactory.class);
+ IdentitySessionFactory identitySessionFactory = EnvironmentImpl.getFromCurrent(IdentitySessionFactory.class);
try {
IdentitySession identitySession = identitySessionFactory.createIdentitySession(realmName);
- Environment environment = Environment.getCurrent();
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
StandardTransaction transaction = environment.get(StandardTransaction.class);
if (transaction != null) {
IdentitySessionResource identitySessionResource = new IdentitySessionResource(identitySession);
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -10,7 +10,7 @@
import org.jbpm.api.JbpmException;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentDefaults;
import org.jbpm.pvm.internal.script.ScriptManager;
import org.jbpm.pvm.internal.util.ReflectUtil;
@@ -280,7 +280,7 @@
Object autoWireValue = null;
if ("environment".equals(fieldName)) {
- autoWireValue = Environment.getCurrent();
+ autoWireValue = EnvironmentImpl.getCurrent();
} else if ( ("context".equals(fieldName))
|| ("wireContext".equals(fieldName))
@@ -296,7 +296,7 @@
// if auto wire value has not been found in current context,
// search in environment
if (autoWireValue == null) {
- Environment currentEnvironment = Environment.getCurrent();
+ EnvironmentImpl currentEnvironment = EnvironmentImpl.getCurrent();
if (currentEnvironment != null) {
autoWireValue = currentEnvironment.get(fieldName);
if (autoWireValue == null) {
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/TransactionRefDescriptor.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/TransactionRefDescriptor.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/descriptor/TransactionRefDescriptor.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,7 +21,7 @@
*/
package org.jbpm.pvm.internal.wire.descriptor;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.wire.WireContext;
@@ -33,7 +33,7 @@
private static final long serialVersionUID = 1L;
public Object construct(WireContext wireContext) {
- return Environment.getCurrent().get(Transaction.class);
+ return EnvironmentImpl.getCurrent().get(Transaction.class);
}
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/SubscribeOperation.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/SubscribeOperation.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/operation/SubscribeOperation.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -6,7 +6,7 @@
import org.jbpm.internal.log.Log;
import org.jbpm.pvm.internal.env.Context;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.util.FilterListener;
import org.jbpm.pvm.internal.util.Listener;
import org.jbpm.pvm.internal.util.Observable;
@@ -77,7 +77,7 @@
// identify the wireContext
WireContext wireContext = null;
if (contextName!=null) {
- Environment environment = Environment.getCurrent();
+ EnvironmentImpl environment = EnvironmentImpl.getCurrent();
if (environment!=null) {
try {
wireContext = (WireContext) environment.getContext(contextName);
Added: jbpm4/branches/tbaeyens/modules/pvm/src/main/resources/jbpm.tx.cmd.cfg.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/main/resources/jbpm.tx.cmd.cfg.xml (rev 0)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/main/resources/jbpm.tx.cmd.cfg.xml 2009-08-13 17:10:34 UTC (rev 5477)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <process-engine-context>
+ <command-service>
+ <standard-transaction-interceptor />
+ </command-service>
+ </process-engine-context>
+
+ <transaction-context>
+ <transaction />
+ <hibernate-session />
+ </transaction-context>
+
+</jbpm-configuration>
Property changes on: jbpm4/branches/tbaeyens/modules/pvm/src/main/resources/jbpm.tx.cmd.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/env/BasicEnvironmentTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/env/BasicEnvironmentTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/env/BasicEnvironmentTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -23,7 +23,7 @@
import org.jbpm.pvm.internal.cfg.JbpmConfiguration;
import org.jbpm.pvm.internal.env.Context;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.test.BaseJbpmTestCase;
@@ -48,7 +48,7 @@
Object firstA;
Object firstB;
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
firstA = environment.get("a");
assertNotNull(firstA);
@@ -85,19 +85,19 @@
);
assertNotNull(environmentFactory);
- Environment outerEnvironment = environmentFactory.openEnvironment();
+ EnvironmentImpl outerEnvironment = environmentFactory.openEnvironment();
try {
- assertSame(outerEnvironment, Environment.getCurrent());
+ assertSame(outerEnvironment, EnvironmentImpl.getCurrent());
- Environment innerEnvironment = environmentFactory.openEnvironment();
+ EnvironmentImpl innerEnvironment = environmentFactory.openEnvironment();
try {
- assertSame(innerEnvironment, Environment.getCurrent());
+ assertSame(innerEnvironment, EnvironmentImpl.getCurrent());
} finally {
innerEnvironment.close();
}
- assertSame(outerEnvironment, Environment.getCurrent());
+ assertSame(outerEnvironment, EnvironmentImpl.getCurrent());
} finally {
outerEnvironment.close();
@@ -118,7 +118,7 @@
"</jbpm-configuration>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
assertNull(environment.get("unexisting element"));
@@ -135,7 +135,7 @@
);
assertNotNull(environmentFactory);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
Context environmentFactoryCtxt = environment.getContext(Context.CONTEXTNAME_PROCESS_ENGINE);
assertNotNull(environmentFactoryCtxt);
@@ -156,7 +156,7 @@
);
assertNotNull(environmentFactory);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
assertNotNull(environment);
Context environmentFactoryCtxt = environment.getContext(Context.CONTEXTNAME_PROCESS_ENGINE);
@@ -176,7 +176,7 @@
);
assertNotNull(environmentFactory);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
assertNotNull(environment);
Context environmentFactoryCtxt = environment.getContext(Context.CONTEXTNAME_PROCESS_ENGINE);
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/env/EnvironmentSearchOrderTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/env/EnvironmentSearchOrderTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/env/EnvironmentSearchOrderTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.env;
import org.jbpm.pvm.internal.cfg.JbpmConfiguration;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.wire.WireContext;
import org.jbpm.pvm.internal.wire.WireDefinition;
@@ -47,7 +47,7 @@
"</jbpm-configuration>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
assertEquals("environment-a", environment.get("a"));
@@ -69,7 +69,7 @@
"</jbpm-configuration>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
// only search in context 'process-engine' and then in 'environment'
@@ -94,7 +94,7 @@
"</jbpm-configuration>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
// only search in context 'process-engine'
@@ -119,7 +119,7 @@
"</jbpm-configuration>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
// create a new context
@@ -153,7 +153,7 @@
"</jbpm-configuration>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
// create a new context
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/env/EnvironmentTypeLookupTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/env/EnvironmentTypeLookupTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/env/EnvironmentTypeLookupTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.env;
import org.jbpm.pvm.internal.cfg.JbpmConfiguration;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.test.BaseJbpmTestCase;
@@ -46,7 +46,7 @@
"</jbpm-configuration>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
A a = environment.get(A.class);
@@ -70,7 +70,7 @@
"</jbpm-configuration>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
A a = environment.get(A.class);
@@ -94,7 +94,7 @@
"</jbpm-configuration>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
assertNull(environment.get(Thread.class));
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/env/NestedEnvironmentTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/env/NestedEnvironmentTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/env/NestedEnvironmentTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.env;
import org.jbpm.pvm.internal.cfg.JbpmConfiguration;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.test.BaseJbpmTestCase;
@@ -43,24 +43,24 @@
"</jbpm-configuration>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
- assertSame(environment, Environment.getCurrent());
+ assertSame(environment, EnvironmentImpl.getCurrent());
Object outerB = environment.get("b");
assertNotNull(outerB);
- Environment nestedEnvironment = environmentFactory.openEnvironment();
+ EnvironmentImpl nestedEnvironment = environmentFactory.openEnvironment();
try {
- assertSame(nestedEnvironment, Environment.getCurrent());
+ assertSame(nestedEnvironment, EnvironmentImpl.getCurrent());
assertNotSame(outerB, nestedEnvironment.get("b"));
} finally {
nestedEnvironment.close();
}
- assertSame(environment, Environment.getCurrent());
+ assertSame(environment, EnvironmentImpl.getCurrent());
assertSame(outerB, environment.get("b"));
} finally {
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/GroovyExpressionTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/GroovyExpressionTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/GroovyExpressionTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -25,7 +25,7 @@
import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
import org.jbpm.pvm.internal.cfg.JbpmConfiguration;
import org.jbpm.pvm.internal.client.ClientExecution;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.script.ScriptManager;
@@ -65,7 +65,7 @@
execution.setVariable("pv", "hello");
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
assertEquals("hello", scriptManager.evaluateExpression("pv", "groovy"));
} finally {
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/JuelExpressionTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/JuelExpressionTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/expr/JuelExpressionTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -25,7 +25,7 @@
import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
import org.jbpm.pvm.internal.cfg.JbpmConfiguration;
import org.jbpm.pvm.internal.client.ClientExecution;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.env.ExecutionContext;
import org.jbpm.pvm.internal.model.ExecutionImpl;
@@ -62,7 +62,7 @@
execution.setVariable("pv", "hello");
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
environment.setContext(new ExecutionContext(execution));
try {
assertEquals("hello", scriptManager.evaluateExpression("#{pv}", null));
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/EnlistTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/EnlistTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/EnlistTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -4,7 +4,7 @@
import java.util.List;
import org.jbpm.api.Configuration;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.wire.WireContext;
@@ -26,7 +26,7 @@
super.tearDown();
}
- public static Environment openEnvironment(String xmlString) {
+ public static EnvironmentImpl openEnvironment(String xmlString) {
EnvironmentFactory environmentFactory = (EnvironmentFactory)
new Configuration().setXmlString(xmlString).buildProcessEngine();
return environmentFactory.openEnvironment();
@@ -41,7 +41,7 @@
}
public void testEnlist() {
- Environment environment = openEnvironment(
+ EnvironmentImpl environment = openEnvironment(
"<jbpm-configuration>" +
" <process-engine/>"+
" <transaction-context>" +
@@ -71,7 +71,7 @@
}
public void testEnlistRollback() {
- Environment environment = openEnvironment(
+ EnvironmentImpl environment = openEnvironment(
"<jbpm-configuration>" +
" <process-engine/>"+
" <transaction-context>" +
@@ -101,7 +101,7 @@
}
public void testEnlistInOtherContext() {
- Environment environment = openEnvironment(
+ EnvironmentImpl environment = openEnvironment(
"<jbpm-configuration>" +
" <process-engine/>"+
" <transaction-context>" +
@@ -134,7 +134,7 @@
}
public void testEnlistInOtherContextWithRollback() {
- Environment environment = openEnvironment(
+ EnvironmentImpl environment = openEnvironment(
"<jbpm-configuration>" +
" <process-engine/>"+
" <transaction-context>" +
@@ -167,7 +167,7 @@
}
public void testEnlistNotAResource() {
- Environment environment = openEnvironment(
+ EnvironmentImpl environment = openEnvironment(
"<jbpm-configuration>" +
" <process-engine/>"+
" <transaction-context>" +
@@ -191,7 +191,7 @@
}
public void testEnlistNotATransaction() {
- Environment environment = openEnvironment(
+ EnvironmentImpl environment = openEnvironment(
"<jbpm-configuration>" +
" <process-engine/>"+
" <transaction-context>" +
@@ -215,7 +215,7 @@
}
public void testMissingTransactionName() {
- Environment environment = openEnvironment(
+ EnvironmentImpl environment = openEnvironment(
"<jbpm-configuration>" +
" <process-engine/>"+
" <transaction-context>" +
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/TransactionFailingCommitTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/TransactionFailingCommitTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/TransactionFailingCommitTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.tx;
import org.jbpm.api.Configuration;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.test.BaseJbpmTestCase;
@@ -45,7 +45,7 @@
}
}
- public static Environment openEnvironment(String xmlString) {
+ public static EnvironmentImpl openEnvironment(String xmlString) {
EnvironmentFactory environmentFactory = (EnvironmentFactory)
new Configuration().setXmlString(xmlString).buildProcessEngine();
return environmentFactory.openEnvironment();
@@ -58,7 +58,7 @@
TestResource resourceThree = null;
try {
- Environment environment = openEnvironment(
+ EnvironmentImpl environment = openEnvironment(
"<jbpm-configuration>" +
" <process-engine/>"+
" <transaction-context>" +
@@ -130,7 +130,7 @@
TestResource resourceThree = null;
try {
- Environment environment = openEnvironment(
+ EnvironmentImpl environment = openEnvironment(
"<jbpm-configuration>" +
" <process-engine/>"+
" <transaction-context>" +
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/TransactionResourcesCommitTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/TransactionResourcesCommitTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/TransactionResourcesCommitTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.tx;
import org.jbpm.api.Configuration;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.tx.StandardTransaction;
import org.jbpm.test.BaseJbpmTestCase;
@@ -33,7 +33,7 @@
*/
public class TransactionResourcesCommitTest extends BaseJbpmTestCase {
- public static Environment openEnvironment(String xmlString) {
+ public static EnvironmentImpl openEnvironment(String xmlString) {
EnvironmentFactory environmentFactory = (EnvironmentFactory)
new Configuration().setXmlString(xmlString).buildProcessEngine();
return environmentFactory.openEnvironment();
@@ -44,7 +44,7 @@
TestResource resourceOne = null;
- Environment environment = openEnvironment(
+ EnvironmentImpl environment = openEnvironment(
"<jbpm-configuration>" +
" <process-engine/>"+
" <transaction-context>" +
@@ -81,7 +81,7 @@
TestResource resourceTwo = null;
TestResource resourceThree = null;
- Environment environment = openEnvironment(
+ EnvironmentImpl environment = openEnvironment(
"<jbpm-configuration>" +
" <process-engine/>"+
" <transaction-context>" +
@@ -139,7 +139,7 @@
public void testFetchOneResourceOutOfManyCommit() {
TestResource resourceTwo = null;
- Environment environment = openEnvironment(
+ EnvironmentImpl environment = openEnvironment(
"<jbpm-configuration>" +
" <process-engine/>"+
" <transaction-context>" +
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/TransactionResourcesSetRollbackOnlyTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/TransactionResourcesSetRollbackOnlyTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/tx/TransactionResourcesSetRollbackOnlyTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.tx;
import org.jbpm.api.Configuration;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.tx.StandardTransaction;
@@ -34,7 +34,7 @@
*/
public class TransactionResourcesSetRollbackOnlyTest extends BaseJbpmTestCase {
- public static Environment openEnvironment(String xmlString) {
+ public static EnvironmentImpl openEnvironment(String xmlString) {
EnvironmentFactory environmentFactory = (EnvironmentFactory)
new Configuration().setXmlString(xmlString).buildProcessEngine();
return environmentFactory.openEnvironment();
@@ -45,7 +45,7 @@
TestResource resourceOne = null;
- Environment environment = openEnvironment(
+ EnvironmentImpl environment = openEnvironment(
"<jbpm-configuration>" +
" <process-engine/>"+
" <transaction-context>" +
@@ -84,7 +84,7 @@
TestResource resourceTwo = null;
TestResource resourceThree = null;
- Environment environment = openEnvironment(
+ EnvironmentImpl environment = openEnvironment(
"<jbpm-configuration>" +
" <process-engine/>"+
" <transaction-context>" +
@@ -144,7 +144,7 @@
public void testFetchOneResourceOutOfManySetRollbackOnly() {
TestResource resourceTwo = null;
- Environment environment = openEnvironment(
+ EnvironmentImpl environment = openEnvironment(
"<jbpm-configuration>" +
" <process-engine/>"+
" <transaction-context>" +
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ClassWireTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ClassWireTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ClassWireTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -2,7 +2,7 @@
import java.util.List;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.xml.Problem;
/**
@@ -82,14 +82,14 @@
public void testExternalClass() {
WireContext wireContext = createWireContext(
"<objects>" +
- " <class name='o' class-name='"+Environment.class.getName()+"' />" +
+ " <class name='o' class-name='"+EnvironmentImpl.class.getName()+"' />" +
"</objects>"
);
Object o = wireContext.get("o");
assertNotNull(o);
- assertEquals(org.jbpm.pvm.internal.env.Environment.class, o);
+ assertEquals(org.jbpm.pvm.internal.env.EnvironmentImpl.class, o);
}
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ContextBlockSubscriptionTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ContextBlockSubscriptionTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ContextBlockSubscriptionTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -24,7 +24,7 @@
import org.jbpm.pvm.internal.cfg.JbpmConfiguration;
import org.jbpm.pvm.internal.env.Context;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.wire.Descriptor;
import org.jbpm.pvm.internal.wire.WireContext;
@@ -87,7 +87,7 @@
"</jbpm-configuration>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
WireContext contextBlockContext = (WireContext) environment.getContext(Context.CONTEXTNAME_TRANSACTION);
assertNotNull(environment.get("recorder"));
@@ -137,7 +137,7 @@
"</jbpm-configuration>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
assertEquals(events.toString(), 3, events.size());
int index=0;
@@ -172,7 +172,7 @@
"</jbpm-configuration>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
assertNotNull(environment.get("o"));
@@ -212,7 +212,7 @@
"</jbpm-configuration>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
assertEquals(events.toString(), 0, events.size());
@@ -248,7 +248,7 @@
"</jbpm-configuration>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
WireContext contextBlockContext = (WireContext) environment.getContext(Context.CONTEXTNAME_TRANSACTION);
@@ -296,7 +296,7 @@
"</jbpm-configuration>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
assertNotNull(environment.get("o"));
@@ -336,7 +336,7 @@
int index=0;
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
assertEquals(events.toString(), 0, events.size());
@@ -386,7 +386,7 @@
int index=0;
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
assertEquals(events.toString(), 0, events.size());
@@ -419,12 +419,12 @@
"</jbpm-configuration>"
);
- assertNull(Environment.getCurrent());
+ assertNull(EnvironmentImpl.getCurrent());
try {
environmentFactory.openEnvironment();
fail("expected exception");
} catch (WireException e) {
- assertNull(Environment.getCurrent());
+ assertNull(EnvironmentImpl.getCurrent());
assertTextPresent("couldn't initialize object 'recorder': couldn't subscribe because context unexistingcontext doesn't exist", e.getMessage());
}
}
@@ -452,7 +452,7 @@
"</jbpm-configuration>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
WireContext transactionContext = (WireContext) environment.getContext(Context.CONTEXTNAME_TRANSACTION);
assertNotNull(environment.get("a"));
@@ -510,7 +510,7 @@
"</jbpm-configuration>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
WireContext contextBlockContext = (WireContext) environment.getContext(Context.CONTEXTNAME_TRANSACTION);
assertNotNull(environment.get("a"));
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ContextTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ContextTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ContextTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -17,7 +17,7 @@
import java.util.Set;
import org.jbpm.pvm.internal.cfg.JbpmConfiguration;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.wire.WireContext;
@@ -153,7 +153,7 @@
"<environment-scopes/>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
Object foo = environment.get("foo");
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/EnvWireTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/EnvWireTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/EnvWireTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -1,7 +1,7 @@
package org.jbpm.pvm.internal.wire;
import org.jbpm.pvm.internal.cfg.JbpmConfiguration;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.wire.WireContext;
@@ -21,14 +21,14 @@
"</environment-scopes>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try{
Object e = environment.get("e");
assertNotNull(e);
assertEquals(environment, e);
- assertEquals(e, ((Environment) e).get("e"));
+ assertEquals(e, ((EnvironmentImpl) e).get("e"));
} finally {
environment.close();
}
@@ -45,7 +45,7 @@
"</environment-scopes>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
Object f = environment.get("f");
@@ -68,7 +68,7 @@
"</jbpm-configuration>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
Object c = environment.get("c");
@@ -92,7 +92,7 @@
"</environment-scopes>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
Object c = environment.get("c");
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/MethodSubscriptionTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/MethodSubscriptionTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/MethodSubscriptionTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -1,7 +1,7 @@
package org.jbpm.pvm.internal.wire;
import org.jbpm.pvm.internal.cfg.JbpmConfiguration;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.util.DefaultObservable;
import org.jbpm.pvm.internal.util.Observable;
@@ -55,7 +55,7 @@
" </transaction-context>" +
"</jbpm-configuration>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
Observable a = (Observable) environment.get("a");
assertNotNull(a);
@@ -97,7 +97,7 @@
" </transaction-context>" +
"</jbpm-configuration>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
Observable a = (Observable) environment.get("a");
assertNotNull(a);
@@ -138,7 +138,7 @@
" </transaction-context>" +
"</jbpm-configuration>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
Observable a = (Observable) environment.get("a");
assertNotNull(a);
@@ -196,7 +196,7 @@
" </transaction-context>" +
"</jbpm-configuration>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
Observable a = (Observable) environment.get("a");
assertNotNull(a);
@@ -251,7 +251,7 @@
" </transaction-context>" +
"</jbpm-configuration>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
Observable a = (Observable) environment.get("a");
assertNotNull(a);
@@ -303,7 +303,7 @@
" </transaction-context>" +
"</environment-scopes>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
Observable a = (Observable) environment.get("a");
assertNotNull(a);
@@ -388,7 +388,7 @@
" </transaction-context>" +
"</environment-scopes>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
OverloadingRecorder r = (OverloadingRecorder) environment.get("l");
assertNotNull(r);
@@ -443,7 +443,7 @@
" </transaction-context>" +
"</environment-scopes>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
OverloadingRecorder r = (OverloadingRecorder) environment.get("l");
assertNotNull(r);
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ObjectSubscriptionTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ObjectSubscriptionTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/ObjectSubscriptionTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.wire;
import org.jbpm.pvm.internal.cfg.JbpmConfiguration;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.util.DefaultObservable;
import org.jbpm.pvm.internal.util.Observable;
@@ -50,7 +50,7 @@
"</environment-scopes>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
Observable observable = (Observable) environment.get("o");
assertNotNull(observable);
@@ -92,7 +92,7 @@
"</environment-scopes>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
Observable observable = (Observable) environment.get("o");
assertNotNull(observable);
@@ -141,7 +141,7 @@
);
int index=0;
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
// fire 2 events on newsletter: "look at our website" and "buy our product"
Observable newsletter = (Observable) environment.get("newsletter");
@@ -228,7 +228,7 @@
"</environment-scopes>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
Observable observable = (Observable) environment.get("o");
assertNotNull(observable);
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/WireEventsSubscriptionTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/WireEventsSubscriptionTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/WireEventsSubscriptionTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,7 +22,7 @@
package org.jbpm.pvm.internal.wire;
import org.jbpm.pvm.internal.cfg.JbpmConfiguration;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.util.DefaultObservable;
import org.jbpm.pvm.internal.util.Observable;
@@ -54,7 +54,7 @@
"</environment-scopes>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
Observable observable = (Observable) environment.get("o");
assertNotNull(observable);
@@ -97,7 +97,7 @@
"</environment-scopes>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
assertEquals(events.toString(), 0, events.size());
@@ -153,7 +153,7 @@
"</environment-scopes>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
assertEquals(events.toString(), 0, events.size());
@@ -229,7 +229,7 @@
"</environment-scopes>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
assertEquals(events.toString(), 0, events.size());
@@ -270,7 +270,7 @@
"</environment-scopes>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
assertEquals(events.toString(), 0, events.size());
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/WireObservableTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/WireObservableTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/internal/wire/WireObservableTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -25,7 +25,7 @@
import org.jbpm.pvm.internal.cfg.JbpmConfiguration;
import org.jbpm.pvm.internal.env.Context;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.EnvironmentFactory;
import org.jbpm.pvm.internal.util.Listener;
import org.jbpm.pvm.internal.wire.WireContext;
@@ -57,7 +57,7 @@
"</environment-scopes>"
);
- Environment environment = environmentFactory.openEnvironment();
+ EnvironmentImpl environment = environmentFactory.openEnvironment();
try {
WireContext environmentContext = (WireContext) environment.getContext(Context.CONTEXTNAME_TRANSACTION);
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/test/EnvironmentTestCase.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/test/EnvironmentTestCase.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/test/EnvironmentTestCase.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,14 +21,14 @@
*/
package org.jbpm.pvm.test;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
/**
* @author Tom Baeyens
*/
public abstract class EnvironmentTestCase extends EnvironmentFactoryTestCase {
- protected Environment environment;
+ protected EnvironmentImpl environment;
public EnvironmentTestCase() {
}
Modified: jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/tx/BasicTransactionTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/tx/BasicTransactionTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/pvm/src/test/java/org/jbpm/pvm/tx/BasicTransactionTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -27,13 +27,13 @@
import org.hibernate.Session;
import org.jbpm.api.JbpmException;
-import org.jbpm.pvm.internal.cmd.Command;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.cmd.CommandService;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.env.Transaction;
import org.jbpm.pvm.internal.history.model.HistoryCommentImpl;
import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
-import org.jbpm.pvm.internal.type.variable.StringVariable;
import org.jbpm.test.JbpmTestCase;
/**
@@ -130,7 +130,7 @@
public static class SuccessfulSynchronization implements Synchronization {
public void beforeCompletion() {
- Session session = Environment.getFromCurrent(Session.class);
+ Session session = EnvironmentImpl.getFromCurrent(Session.class);
session.save(new HistoryCommentImpl("b) hello from before completion"));
}
@@ -168,7 +168,7 @@
public static class UnsuccessfulSynchronization implements Synchronization {
public void beforeCompletion() {
- Session session = Environment.getFromCurrent(Session.class);
+ Session session = EnvironmentImpl.getFromCurrent(Session.class);
session.save(new HistoryCommentImpl("b) hello from before completion"));
throw new MyOwnRuntimeException();
}
Copied: jbpm4/branches/tbaeyens/modules/test-base/src/main/java/org/jbpm/test/tx/TxCommand.java (from rev 5475, jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/TxCommand.java)
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-base/src/main/java/org/jbpm/test/tx/TxCommand.java (rev 0)
+++ jbpm4/branches/tbaeyens/modules/test-base/src/main/java/org/jbpm/test/tx/TxCommand.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -0,0 +1,43 @@
+/*
+ * 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.test.tx;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.hibernate.Session;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public abstract class TxCommand {
+
+ protected Map<String, Object> params = new HashMap<String, Object>();
+
+ public TxCommand setParam(String name, Object value) {
+ params.put(name, value);
+ return this;
+ }
+
+ public abstract Object execute(Session session);
+}
Property changes on: jbpm4/branches/tbaeyens/modules/test-base/src/main/java/org/jbpm/test/tx/TxCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: jbpm4/branches/tbaeyens/modules/test-base/src/main/java/org/jbpm/test/tx/TxTemplate.java (from rev 5475, jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/TxTemplate.java)
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-base/src/main/java/org/jbpm/test/tx/TxTemplate.java (rev 0)
+++ jbpm4/branches/tbaeyens/modules/test-base/src/main/java/org/jbpm/test/tx/TxTemplate.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -0,0 +1,74 @@
+/*
+ * 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.test.tx;
+
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.hibernate.classic.Session;
+import org.hibernate.context.ThreadLocalSessionContext;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class TxTemplate {
+
+ private SessionFactory sessionFactory;
+
+ public TxTemplate(SessionFactory sessionFactory) {
+ this.sessionFactory = sessionFactory;
+ }
+
+ public Object execute(TxCommand txCommand) {
+ Session session = sessionFactory.openSession();
+ Transaction transaction = session.beginTransaction();
+ ThreadLocalSessionContext.bind(session);
+ try {
+ return txCommand.execute(session);
+ } catch (Exception e) {
+ transaction.rollback();
+ } finally {
+ ThreadLocalSessionContext.unbind(sessionFactory);
+ if (!transaction.wasRolledBack()) {
+ transaction.commit();
+ }
+ session.close();
+ }
+ return null;
+ }
+
+ public void execute(VoidTxCommand voidTxCommand) {
+ execute(new VoidWrapper(voidTxCommand));
+ }
+
+ static class VoidWrapper extends TxCommand {
+ VoidTxCommand voidTxCommand;
+ public VoidWrapper(VoidTxCommand voidTxCommand) {
+ this.voidTxCommand = voidTxCommand;
+ this.params = voidTxCommand.params;
+ }
+ public Object execute(org.hibernate.Session session) {
+ voidTxCommand.execute(session);
+ return null;
+ }
+ }
+}
Property changes on: jbpm4/branches/tbaeyens/modules/test-base/src/main/java/org/jbpm/test/tx/TxTemplate.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/branches/tbaeyens/modules/test-base/src/main/java/org/jbpm/test/tx/VoidTxCommand.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-base/src/main/java/org/jbpm/test/tx/VoidTxCommand.java (rev 0)
+++ jbpm4/branches/tbaeyens/modules/test-base/src/main/java/org/jbpm/test/tx/VoidTxCommand.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -0,0 +1,46 @@
+/*
+ * 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.test.tx;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.hibernate.Session;
+
+
+/** TxCommand without return value. This can be handy if you
+ * don't want to type the 'return null;' at the end of a
+ * transactional command.
+ *
+ * @author Tom Baeyens
+ */
+public abstract class VoidTxCommand {
+
+ protected Map<String, Object> params = new HashMap<String, Object>();
+
+ public VoidTxCommand setParam(String name, Object value) {
+ params.put(name, value);
+ return this;
+ }
+
+ public abstract void execute(Session session);
+}
Property changes on: jbpm4/branches/tbaeyens/modules/test-base/src/main/java/org/jbpm/test/tx/VoidTxCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/branches/tbaeyens/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/HibernateLongIdTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/HibernateLongIdTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/HibernateLongIdTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -28,7 +28,13 @@
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.jbpm.api.ProcessInstance;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
+import org.jbpm.api.cmd.ParamCommand;
import org.jbpm.test.JbpmCustomCfgTestCase;
+import org.jbpm.test.tx.TxCommand;
+import org.jbpm.test.tx.TxTemplate;
+import org.jbpm.test.tx.VoidTxCommand;
/**
@@ -36,17 +42,10 @@
*/
public class HibernateLongIdTest extends JbpmCustomCfgTestCase {
- private TxTemplate txTemplate;
-
- protected void setUp() throws Exception {
- super.setUp();
- SessionFactory sessionFactory = processEngine.get(SessionFactory.class);
- this.txTemplate = new TxTemplate(sessionFactory);
- }
-
protected void deleteRegisteredDeployments() {
- txTemplate.execute(new TxCommand() {
- public Object execute(Session session) {
+ processEngine.execute(new Command<Void>() {
+ public Void execute(Environment environment) {
+ Session session = environment.get(Session.class);
for (String deploymentId : registeredDeployments) {
repositoryService.deleteDeploymentCascade(deploymentId);
}
@@ -55,15 +54,15 @@
for (Order order: orders) {
session.delete(order);
}
-
+
return null;
}
});
}
public void testHibernateLongId() {
- txTemplate.execute(new TxCommand() {
- public Object execute(Session session) {
+ processEngine.execute(new Command<Void>() {
+ public Void execute(Environment environment) {
deployJpdlXmlString(
"<process name='HibernateLongId'>" +
" <start>" +
@@ -76,8 +75,9 @@
}
});
- String processInstanceId = (String) txTemplate.execute(new TxCommand() {
- public Object execute(Session session) {
+ String processInstanceId = (String) processEngine.execute(new Command<String>() {
+ public String execute(Environment environment) {
+ Session session = environment.get(Session.class);
Order order = new Order();
order.setClient("Contador");
order.setProduct("Shampoo");
@@ -93,8 +93,9 @@
}
});
- txTemplate.execute(new TxCommand() {
- public Object execute(Session session) {
+ processEngine.execute(new ParamCommand<Void>() {
+ public Void execute(Environment environment) {
+ Session session = environment.get(Session.class);
String processInstanceId = (String) params.get("processInstanceId");
Order order = (Order) executionService.getVariable(processInstanceId, "order");
assertNotNull(order);
Deleted: jbpm4/branches/tbaeyens/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/TxCommand.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/TxCommand.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/TxCommand.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -1,43 +0,0 @@
-/*
- * 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.test.hibernatelongid;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.hibernate.Session;
-
-
-/**
- * @author Tom Baeyens
- */
-public abstract class TxCommand {
-
- protected Map<String, Object> params = new HashMap<String, Object>();
-
- public TxCommand setParam(String name, Object value) {
- params.put(name, value);
- return this;
- }
-
- public abstract Object execute(Session session);
-}
Deleted: jbpm4/branches/tbaeyens/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/TxTemplate.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/TxTemplate.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/TxTemplate.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -1,66 +0,0 @@
-/*
- * 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.test.hibernatelongid;
-
-import org.hibernate.SessionFactory;
-import org.hibernate.Transaction;
-import org.hibernate.classic.Session;
-import org.hibernate.context.ThreadLocalSessionContext;
-
-
-/**
- * @author Tom Baeyens
- */
-public class TxTemplate {
-
- private SessionFactory sessionFactory;
-
- public TxTemplate(SessionFactory sessionFactory) {
- this.sessionFactory = sessionFactory;
- }
-
- public Object execute(TxCommand txCommand) {
- Session session = sessionFactory.openSession();
- Transaction transaction = session.beginTransaction();
- ThreadLocalSessionContext.bind(session);
- try {
- return txCommand.execute(session);
- } catch (Exception e) {
- transaction.rollback();
- } finally {
- ThreadLocalSessionContext.unbind(sessionFactory);
- if (!transaction.wasRolledBack()) {
- transaction.commit();
- }
- session.close();
- }
- return null;
- }
-
- public SessionFactory getSessionFactory() {
- return sessionFactory;
- }
-
- public void setSessionFactory(SessionFactory sessionFactory) {
- this.sessionFactory = sessionFactory;
- }
-}
Modified: jbpm4/branches/tbaeyens/modules/test-cfg/src/test/java/org/jbpm/test/hibernatestringid/HibernateStringIdTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-cfg/src/test/java/org/jbpm/test/hibernatestringid/HibernateStringIdTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/test-cfg/src/test/java/org/jbpm/test/hibernatestringid/HibernateStringIdTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -25,12 +25,13 @@
import java.util.List;
import java.util.Map;
+import org.hibernate.Session;
import org.hibernate.SessionFactory;
-import org.hibernate.Transaction;
-import org.hibernate.classic.Session;
-import org.hibernate.context.ThreadLocalSessionContext;
import org.jbpm.api.ProcessInstance;
import org.jbpm.test.JbpmCustomCfgTestCase;
+import org.jbpm.test.tx.TxCommand;
+import org.jbpm.test.tx.TxTemplate;
+import org.jbpm.test.tx.VoidTxCommand;
/**
@@ -38,89 +39,69 @@
*/
public class HibernateStringIdTest extends JbpmCustomCfgTestCase {
- protected void deleteRegisteredDeployments() {
+ private TxTemplate txTemplate;
+
+ protected void setUp() throws Exception {
+ super.setUp();
SessionFactory sessionFactory = processEngine.get(SessionFactory.class);
-
- Session session = sessionFactory.openSession();
- Transaction transaction = session.beginTransaction();
- ThreadLocalSessionContext.bind(session);
+ this.txTemplate = new TxTemplate(sessionFactory);
+ }
- try {
- super.deleteRegisteredDeployments();
-
- List<Order> orders = session.createQuery("from "+Order.class.getName()).list();
- for (Order order: orders) {
- session.delete(order);
- }
+ protected void deleteRegisteredDeployments() {
+ txTemplate.execute(new VoidTxCommand() {
+ public void execute(Session session) {
+ for (String deploymentId : registeredDeployments) {
+ repositoryService.deleteDeploymentCascade(deploymentId);
+ }
- } finally {
- ThreadLocalSessionContext.unbind(sessionFactory);
- transaction.commit();
- session.close();
- }
+ List<Order> orders = session.createQuery("from "+Order.class.getName()).list();
+ for (Order order: orders) {
+ session.delete(order);
+ }
+ }
+ });
}
public void testHibernateStringId() {
- SessionFactory sessionFactory = processEngine.get(SessionFactory.class);
-
- Session session = sessionFactory.openSession();
- Transaction transaction = session.beginTransaction();
- ThreadLocalSessionContext.bind(session);
+ txTemplate.execute(new VoidTxCommand() {
+ public void execute(Session session) {
+ deployJpdlXmlString(
+ "<process name='HibernateStringId'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a' />" +
+ "</process>"
+ );
+ }
+ });
- try {
- deployJpdlXmlString(
- "<process name='HibernateStringId'>" +
- " <start>" +
- " <transition to='a' />" +
- " </start>" +
- " <state name='a' />" +
- "</process>"
- );
- } finally {
- ThreadLocalSessionContext.unbind(sessionFactory);
- transaction.commit();
- session.close();
- }
+ String processInstanceId = (String) txTemplate.execute(new TxCommand() {
+ public Object execute(Session session) {
+ Order order = new Order("order1");
+ order.setClient("Contador");
+ order.setProduct("Shampoo");
+
+ session.save(order);
+ session.flush();
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("order", order);
+
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("HibernateStringId", variables);
+ return processInstance.getId();
+ }
+ });
- String processInstanceId;
-
- session = sessionFactory.openSession();
- transaction = session.beginTransaction();
- ThreadLocalSessionContext.bind(session);
-
- try {
- Order order = new Order("order1");
- order.setClient("Contador");
- order.setProduct("Shampoo");
-
- session.save(order);
- session.flush();
-
- Map<String, Object> variables = new HashMap<String, Object>();
- variables.put("order", order);
-
- ProcessInstance processInstance = executionService.startProcessInstanceByKey("HibernateStringId", variables);
- processInstanceId = processInstance.getId();
-
- } finally {
- ThreadLocalSessionContext.unbind(sessionFactory);
- transaction.commit();
- session.close();
- }
-
- session = sessionFactory.openSession();
- transaction = session.beginTransaction();
- ThreadLocalSessionContext.bind(session);
-
- try {
- Order order = (Order) executionService.getVariable(processInstanceId, "order");
- assertNotNull(order);
- assertEquals("Contador", order.getClient());
- assertEquals("Shampoo", order.getProduct());
- } finally {
- ThreadLocalSessionContext.unbind(sessionFactory);
- transaction.commit();
- session.close();
- }
+ txTemplate.execute(new VoidTxCommand() {
+ public void execute(Session session) {
+ String processInstanceId = (String) params.get("processInstanceId");
+ Order order = (Order) executionService.getVariable(processInstanceId, "order");
+ assertNotNull(order);
+ assertEquals("Contador", order.getClient());
+ assertEquals("Shampoo", order.getProduct());
+ }
+ }.setParam("processInstanceId", processInstanceId)
+ );
}
}
Deleted: jbpm4/branches/tbaeyens/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.cfg.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.cfg.xml 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.cfg.xml 2009-08-13 17:10:34 UTC (rev 5477)
@@ -1,74 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jbpm-configuration>
-
- <import resource="jbpm.businesscalendar.cfg.xml" />
- <import resource="org/jbpm/test/hibernatelongid/jbpm.tx.hibernate.cfg.xml" />
- <import resource="jbpm.jpdl.cfg.xml" />
- <import resource="jbpm.identity.cfg.xml" />
-
- <process-engine-context>
-
- <repository-service />
- <repository-cache />
- <execution-service />
- <history-service />
- <management-service />
- <identity-service />
- <task-service />
-
- <hibernate-configuration>
- <cfg resource="org/jbpm/test/hibernatelongid/jbpm.hibernate.cfg.xml" />
- </hibernate-configuration>
-
- <hibernate-session-factory />
-
- <script-manager default-expression-language="juel"
- default-script-language="juel">
- <script-language name="juel" factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
- </script-manager>
-
- <id-generator />
- <types resource="jbpm.variable.types.xml" />
-
- <address-resolver />
-
- <mail-template name='task-notification'>
- <to users="${task.assignee}"/>
- <subject>${task.name}</subject>
- <text><![CDATA[Hi ${task.assignee},
-Task "${task.name}" has been assigned to you.
-${task.description}
-
-Sent by JBoss jBPM
-]]></text>
- </mail-template>
-
- <mail-template name='task-reminder'>
- <to users="${task.assignee}"/>
- <subject>${task.name}</subject>
- <text><![CDATA[Hey ${task.assignee},
-Do not forget about task "${task.name}".
-${task.description}
-
-Sent by JBoss jBPM
-]]></text>
- </mail-template>
-
- </process-engine-context>
-
- <transaction-context>
- <repository-session />
- <db-session />
-
- <message-session />
- <timer-session />
- <history-session />
- <mail-session>
- <mail-server>
- <session-properties resource="jbpm.mail.properties" />
- </mail-server>
- </mail-session>
- </transaction-context>
-
-</jbpm-configuration>
Added: jbpm4/branches/tbaeyens/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.cfg.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.cfg.xml (rev 0)
+++ jbpm4/branches/tbaeyens/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.cfg.xml 2009-08-13 17:10:34 UTC (rev 5477)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <import resource="jbpm.default.cfg.xml" />
+ <import resource="jbpm.businesscalendar.cfg.xml" />
+ <import resource="jbpm.tx.cmd.cfg.xml" />
+ <import resource="jbpm.jpdl.cfg.xml" />
+ <import resource="jbpm.identity.cfg.xml" />
+
+ <process-engine-context>
+
+ <repository-service />
+ <repository-cache />
+ <execution-service />
+ <history-service />
+ <management-service />
+ <identity-service />
+ <task-service />
+
+ <hibernate-configuration>
+ <cfg resource="org/jbpm/test/hibernatelongid/jbpm.hibernate.cfg.xml" />
+ </hibernate-configuration>
+
+ <hibernate-session-factory />
+
+ <script-manager default-expression-language="juel"
+ default-script-language="juel">
+ <script-language name="juel" factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
+ </script-manager>
+
+ <id-generator />
+ <types resource="jbpm.variable.types.xml" />
+
+ <address-resolver />
+
+ <mail-template name='task-notification'>
+ <to users="${task.assignee}"/>
+ <subject>${task.name}</subject>
+ <text><![CDATA[Hi ${task.assignee},
+Task "${task.name}" has been assigned to you.
+${task.description}
+
+Sent by JBoss jBPM
+]]></text>
+ </mail-template>
+
+ <mail-template name='task-reminder'>
+ <to users="${task.assignee}"/>
+ <subject>${task.name}</subject>
+ <text><![CDATA[Hey ${task.assignee},
+Do not forget about task "${task.name}".
+${task.description}
+
+Sent by JBoss jBPM
+]]></text>
+ </mail-template>
+
+ </process-engine-context>
+
+ <transaction-context>
+ <repository-session />
+ <db-session />
+
+ <message-session />
+ <timer-session />
+ <history-session />
+ <mail-session>
+ <mail-server>
+ <session-properties resource="jbpm.mail.properties" />
+ </mail-server>
+ </mail-session>
+ </transaction-context>
+
+</jbpm-configuration>
Modified: jbpm4/branches/tbaeyens/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.hibernate.cfg.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.hibernate.cfg.xml 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.hibernate.cfg.xml 2009-08-13 17:10:34 UTC (rev 5477)
@@ -15,9 +15,6 @@
<property name="hibernate.hbm2ddl.auto">create-drop</property>
<property name="hibernate.format_sql">true</property>
- <!-- Enable Hibernate's automatic session context management -->
- <property name="current_session_context_class">thread</property>
-
<mapping resource="jbpm.repository.hbm.xml" />
<mapping resource="jbpm.execution.hbm.xml" />
<mapping resource="jbpm.history.hbm.xml" />
Deleted: jbpm4/branches/tbaeyens/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.tx.hibernate.cfg.xml
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.tx.hibernate.cfg.xml 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.tx.hibernate.cfg.xml 2009-08-13 17:10:34 UTC (rev 5477)
@@ -1,16 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<jbpm-configuration>
-
- <process-engine-context>
- <command-service>
- <retry-interceptor />
- <environment-interceptor />
- </command-service>
- </process-engine-context>
-
- <transaction-context>
- <hibernate-session current="true" />
- </transaction-context>
-
-</jbpm-configuration>
Modified: jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/LoadTestCase.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/LoadTestCase.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/LoadTestCase.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -27,9 +27,9 @@
import org.hibernate.Query;
import org.hibernate.Session;
-import org.jbpm.pvm.internal.cmd.Command;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.cmd.CommandService;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.job.JobImpl;
import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
import org.jbpm.pvm.internal.util.ReflectUtil;
Modified: jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/ContinuationTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/ContinuationTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/ContinuationTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -25,9 +25,9 @@
import java.util.List;
import org.hibernate.Session;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.model.OpenProcessDefinition;
/**
Modified: jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveMessagesTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveMessagesTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveMessagesTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -29,10 +29,10 @@
import org.jbpm.api.Execution;
import org.jbpm.api.activity.ActivityExecution;
import org.jbpm.api.activity.ExternalActivityBehaviour;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.builder.ProcessDefinitionBuilder;
-import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.cmd.StartProcessInstanceCmd;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.job.CommandMessage;
import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
import org.jbpm.pvm.internal.model.ProcessDefinitionImpl;
Modified: jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveTestCommand.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveTestCommand.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/ExclusiveTestCommand.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -27,9 +27,9 @@
import org.hibernate.Session;
import org.jbpm.api.Execution;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.job.CommandMessage;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
Modified: jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceMessageTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceMessageTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceMessageTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -26,10 +26,10 @@
import java.util.List;
import org.hibernate.Session;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.api.history.HistoryComment;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
import org.jbpm.pvm.internal.job.CommandMessage;
import org.jbpm.pvm.internal.session.MessageSession;
Modified: jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceTestCommand.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceTestCommand.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/FailOnceTestCommand.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,10 +21,10 @@
*/
package org.jbpm.test.load.async;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.api.history.HistoryComment;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.history.model.HistoryCommentImpl;
import org.jbpm.pvm.internal.job.CommandMessage;
import org.jbpm.pvm.internal.session.DbSession;
Modified: jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingMessageTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingMessageTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingMessageTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -23,12 +23,10 @@
import java.util.List;
-import org.hibernate.Session;
import org.jbpm.api.JbpmException;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.api.job.Job;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
-import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
import org.jbpm.pvm.internal.job.CommandMessage;
import org.jbpm.pvm.internal.session.MessageSession;
Modified: jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingTestCommand.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingTestCommand.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/FailingTestCommand.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,10 +21,8 @@
*/
package org.jbpm.test.load.async;
-import org.jbpm.api.history.HistoryComment;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
-import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.job.CommandMessage;
import org.jbpm.pvm.internal.session.DbSession;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
Modified: jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/GenerateExceptionTestCommand.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/GenerateExceptionTestCommand.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/GenerateExceptionTestCommand.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -21,8 +21,8 @@
*/
package org.jbpm.test.load.async;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.job.CommandMessage;
import org.jbpm.pvm.internal.wire.descriptor.IntegerDescriptor;
import org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor;
Modified: jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/JobExecutorTestCase.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/JobExecutorTestCase.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/JobExecutorTestCase.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -27,9 +27,9 @@
import org.hibernate.Query;
import org.hibernate.Session;
-import org.jbpm.pvm.internal.cmd.Command;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.cmd.CommandService;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.job.JobImpl;
import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
import org.jbpm.test.JbpmTestCase;
Modified: jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageCommand.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageCommand.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageCommand.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -24,8 +24,8 @@
import java.util.Random;
import org.hibernate.Session;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.history.model.HistoryCommentImpl;
import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
import org.jbpm.pvm.internal.job.CommandMessage;
Modified: jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/async/NormalMessageTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -25,9 +25,9 @@
import java.util.List;
import org.hibernate.Session;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.api.history.HistoryComment;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
import org.jbpm.pvm.internal.job.CommandMessage;
import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
Modified: jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/messages/AddCommentCmd.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/messages/AddCommentCmd.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/messages/AddCommentCmd.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -22,8 +22,8 @@
package org.jbpm.test.load.messages;
import org.hibernate.Session;
-import org.jbpm.pvm.internal.cmd.Command;
-import org.jbpm.pvm.internal.env.Environment;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
/**
Modified: jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/messages/MessageProcessingTest.java
===================================================================
--- jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/messages/MessageProcessingTest.java 2009-08-13 16:52:05 UTC (rev 5476)
+++ jbpm4/branches/tbaeyens/modules/test-load/src/test/java/org/jbpm/test/load/messages/MessageProcessingTest.java 2009-08-13 17:10:34 UTC (rev 5477)
@@ -25,12 +25,12 @@
import java.util.List;
import org.hibernate.Session;
+import org.jbpm.api.cmd.Command;
+import org.jbpm.api.cmd.Environment;
import org.jbpm.api.history.HistoryComment;
import org.jbpm.internal.log.Log;
-import org.jbpm.pvm.internal.cmd.Command;
import org.jbpm.pvm.internal.cmd.CompositeCmd;
import org.jbpm.pvm.internal.cmd.SendMessageCmd;
-import org.jbpm.pvm.internal.env.Environment;
import org.jbpm.pvm.internal.history.model.HistoryDetailImpl;
import org.jbpm.pvm.internal.job.CommandMessage;
import org.jbpm.pvm.internal.jobexecutor.JobExecutor;
Added: jbpm4/branches/tbaeyens/qa/hudson-jbpm4-cfg.bat
===================================================================
--- jbpm4/branches/tbaeyens/qa/hudson-jbpm4-cfg.bat (rev 0)
+++ jbpm4/branches/tbaeyens/qa/hudson-jbpm4-cfg.bat 2009-08-13 17:10:34 UTC (rev 5477)
@@ -0,0 +1,8 @@
+@echo off
+
+mvn clean install
+cd modules\test-cfg
+mvn clean test
+cd ..\..
+
+echo
14 years, 9 months
JBoss JBPM SVN: r5476 - jbpm4/branches.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-08-13 12:52:05 -0400 (Thu, 13 Aug 2009)
New Revision: 5476
Added:
jbpm4/branches/tbaeyens/
Log:
creating personal branch
Copied: jbpm4/branches/tbaeyens (from rev 5475, jbpm4/trunk)
14 years, 9 months
JBoss JBPM SVN: r5475 - jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-08-13 06:22:26 -0400 (Thu, 13 Aug 2009)
New Revision: 5475
Added:
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/TxCommand.java
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/TxTemplate.java
Removed:
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/HibernateLongIdTest2.java
Modified:
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/HibernateLongIdTest.java
Log:
JBPM-2474 Process variables of type hibernate-long-id/hibernate-string-id don't work: introduced template
Modified: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/HibernateLongIdTest.java
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/HibernateLongIdTest.java 2009-08-13 06:26:25 UTC (rev 5474)
+++ jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/HibernateLongIdTest.java 2009-08-13 10:22:26 UTC (rev 5475)
@@ -25,10 +25,8 @@
import java.util.List;
import java.util.Map;
+import org.hibernate.Session;
import org.hibernate.SessionFactory;
-import org.hibernate.Transaction;
-import org.hibernate.classic.Session;
-import org.hibernate.context.ThreadLocalSessionContext;
import org.jbpm.api.ProcessInstance;
import org.jbpm.test.JbpmCustomCfgTestCase;
@@ -38,89 +36,73 @@
*/
public class HibernateLongIdTest extends JbpmCustomCfgTestCase {
- protected void deleteRegisteredDeployments() {
+ private TxTemplate txTemplate;
+
+ protected void setUp() throws Exception {
+ super.setUp();
SessionFactory sessionFactory = processEngine.get(SessionFactory.class);
-
- Session session = sessionFactory.openSession();
- Transaction transaction = session.beginTransaction();
- ThreadLocalSessionContext.bind(session);
+ this.txTemplate = new TxTemplate(sessionFactory);
+ }
- try {
- super.deleteRegisteredDeployments();
-
- List<Order> orders = session.createQuery("from "+Order.class.getName()).list();
- for (Order order: orders) {
- session.delete(order);
- }
+ protected void deleteRegisteredDeployments() {
+ txTemplate.execute(new TxCommand() {
+ public Object execute(Session session) {
+ for (String deploymentId : registeredDeployments) {
+ repositoryService.deleteDeploymentCascade(deploymentId);
+ }
- } finally {
- ThreadLocalSessionContext.unbind(sessionFactory);
- transaction.commit();
- session.close();
- }
+ List<Order> orders = session.createQuery("from "+Order.class.getName()).list();
+ for (Order order: orders) {
+ session.delete(order);
+ }
+
+ return null;
+ }
+ });
}
public void testHibernateLongId() {
- SessionFactory sessionFactory = processEngine.get(SessionFactory.class);
-
- Session session = sessionFactory.openSession();
- Transaction transaction = session.beginTransaction();
- ThreadLocalSessionContext.bind(session);
+ txTemplate.execute(new TxCommand() {
+ public Object execute(Session session) {
+ deployJpdlXmlString(
+ "<process name='HibernateLongId'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a' />" +
+ "</process>"
+ );
+ return null;
+ }
+ });
- try {
- deployJpdlXmlString(
- "<process name='HibernateLongId'>" +
- " <start>" +
- " <transition to='a' />" +
- " </start>" +
- " <state name='a' />" +
- "</process>"
- );
- } finally {
- ThreadLocalSessionContext.unbind(sessionFactory);
- transaction.commit();
- session.close();
- }
-
- String processInstanceId;
+ String processInstanceId = (String) txTemplate.execute(new TxCommand() {
+ public Object execute(Session session) {
+ Order order = new Order();
+ order.setClient("Contador");
+ order.setProduct("Shampoo");
- session = sessionFactory.openSession();
- transaction = session.beginTransaction();
- ThreadLocalSessionContext.bind(session);
-
- try {
- Order order = new Order();
- order.setClient("Contador");
- order.setProduct("Shampoo");
-
- session.save(order);
- session.flush();
-
- Map<String, Object> variables = new HashMap<String, Object>();
- variables.put("order", order);
-
- ProcessInstance processInstance = executionService.startProcessInstanceByKey("HibernateLongId", variables);
- processInstanceId = processInstance.getId();
-
- } finally {
- ThreadLocalSessionContext.unbind(sessionFactory);
- transaction.commit();
- session.close();
- }
-
- session = sessionFactory.openSession();
- transaction = session.beginTransaction();
- ThreadLocalSessionContext.bind(session);
+ session.save(order);
+ session.flush();
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("order", order);
- try {
- Order order = (Order) executionService.getVariable(processInstanceId, "order");
- assertNotNull(order);
- assertEquals("Contador", order.getClient());
- assertEquals("Shampoo", order.getProduct());
- } finally {
- ThreadLocalSessionContext.unbind(sessionFactory);
- transaction.commit();
- session.close();
- }
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("HibernateLongId", variables);
+ return processInstance.getId();
+ }
+ });
+
+ txTemplate.execute(new TxCommand() {
+ public Object execute(Session session) {
+ String processInstanceId = (String) params.get("processInstanceId");
+ Order order = (Order) executionService.getVariable(processInstanceId, "order");
+ assertNotNull(order);
+ assertEquals("Contador", order.getClient());
+ assertEquals("Shampoo", order.getProduct());
+ return null;
+ }
+ }.setParam("processInstanceId", processInstanceId)
+ );
}
}
Deleted: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/HibernateLongIdTest2.java
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/HibernateLongIdTest2.java 2009-08-13 06:26:25 UTC (rev 5474)
+++ jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/HibernateLongIdTest2.java 2009-08-13 10:22:26 UTC (rev 5475)
@@ -1,181 +0,0 @@
-/*
- * 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.test.hibernatelongid;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.hibernate.SessionFactory;
-import org.hibernate.Transaction;
-import org.hibernate.classic.Session;
-import org.jbpm.api.ProcessInstance;
-import org.jbpm.test.JbpmCustomCfgTestCase;
-
-
-/**
- * @author jbarrez
- */
-public class HibernateLongIdTest2 extends JbpmCustomCfgTestCase {
-
- private HibernateTemplate hibernateTemplate;
-
- @Override
- protected void setUp() throws Exception {
- super.setUp();
- SessionFactory sessionFactory = processEngine.get(SessionFactory.class);
- this.hibernateTemplate = new HibernateTemplate(sessionFactory);
- }
-
- protected void deleteRegisteredDeployments() {
-
- hibernateTemplate.execute(new VoidHibernateCallback() {
-
- public void executeNoReturn(Session session) {
-
- // cannot do super.x() in anonymous inner class method :-(
- // super.deleteRegisteredDeployments();
- // so we repeat the functionality ... for the moment
-
- for (String deploymentId : registeredDeployments) {
- repositoryService.deleteDeploymentCascade(deploymentId);
- }
-
- List<Order> orders = session.createQuery("from " + Order.class.getName()).list();
- for (Order order : orders) {
- session.delete(order);
- }
- }
-
- });
-
- }
-
- public void testHibernateLongId() {
-
- hibernateTemplate.execute(new VoidHibernateCallback() {
-
- public void executeNoReturn(Session session) {
- deployJpdlXmlString(
- "<process name='HibernateLongId'>" +
- " <start>" +
- " <transition to='a' />" +
- " </start>" +
- " <state name='a' />" +
- "</process>"
- );
- }
-
- });
-
- final String processInstanceId = (String) hibernateTemplate.execute(new HibernateCallback() {
-
- public Object execute(Session session) {
- Order order = new Order();
- order.setClient("Contador");
- order.setProduct("Shampoo");
-
- session.save(order);
- //session.flush();
-
- Map<String, Object> variables = new HashMap<String, Object>();
- variables.put("order", order);
-
- ProcessInstance processInstance = executionService.startProcessInstanceByKey("HibernateLongId", variables);
- return processInstance.getId();
- }
-
- });
-
-
- hibernateTemplate.execute(new VoidHibernateCallback() {
-
- public void executeNoReturn(Session session) {
- Order order = (Order) executionService.getVariable(processInstanceId, "order");
- assertNotNull(order);
- assertEquals("Contador", order.getClient());
- assertEquals("Shampoo", order.getProduct());
- }
-
- });
- }
-
-
- // Quick template mechanism
- // This is just a quick draft!!!
-
- // Usage: hibernateTemplate.execute(new HibernateCallback() { ... });
- // or when no return value is needed: hibernateTemplate.execute(new VoidHibernateCallback() { })
-
-
- class HibernateTemplate {
-
- private SessionFactory sessionFactory;
-
- public HibernateTemplate(SessionFactory sessionFactory) {
- this.sessionFactory = sessionFactory;
- }
-
- public Object execute(HibernateCallback callback) {
- Session session = sessionFactory.openSession();
- Transaction transaction = session.beginTransaction();
- try {
- return callback.execute(session);
- } catch (Exception e) {
- transaction.rollback();
- } finally {
- if (!transaction.wasRolledBack()) {
- transaction.commit();
- }
- session.close();
- }
- return null;
- }
-
- public SessionFactory getSessionFactory() {
- return sessionFactory;
- }
-
- public void setSessionFactory(SessionFactory sessionFactory) {
- this.sessionFactory = sessionFactory;
- }
-
- }
-
- interface HibernateCallback {
-
- public Object execute(Session session);
-
- }
-
- abstract class VoidHibernateCallback implements HibernateCallback {
-
- public abstract void executeNoReturn(Session session);
-
- public Object execute(Session session) {
- executeNoReturn(session);
- return null;
- }
-
- }
-
-}
Added: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/TxCommand.java
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/TxCommand.java (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/TxCommand.java 2009-08-13 10:22:26 UTC (rev 5475)
@@ -0,0 +1,43 @@
+/*
+ * 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.test.hibernatelongid;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.hibernate.Session;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public abstract class TxCommand {
+
+ protected Map<String, Object> params = new HashMap<String, Object>();
+
+ public TxCommand setParam(String name, Object value) {
+ params.put(name, value);
+ return this;
+ }
+
+ public abstract Object execute(Session session);
+}
Property changes on: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/TxCommand.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/TxTemplate.java
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/TxTemplate.java (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/TxTemplate.java 2009-08-13 10:22:26 UTC (rev 5475)
@@ -0,0 +1,66 @@
+/*
+ * 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.test.hibernatelongid;
+
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.hibernate.classic.Session;
+import org.hibernate.context.ThreadLocalSessionContext;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class TxTemplate {
+
+ private SessionFactory sessionFactory;
+
+ public TxTemplate(SessionFactory sessionFactory) {
+ this.sessionFactory = sessionFactory;
+ }
+
+ public Object execute(TxCommand txCommand) {
+ Session session = sessionFactory.openSession();
+ Transaction transaction = session.beginTransaction();
+ ThreadLocalSessionContext.bind(session);
+ try {
+ return txCommand.execute(session);
+ } catch (Exception e) {
+ transaction.rollback();
+ } finally {
+ ThreadLocalSessionContext.unbind(sessionFactory);
+ if (!transaction.wasRolledBack()) {
+ transaction.commit();
+ }
+ session.close();
+ }
+ return null;
+ }
+
+ public SessionFactory getSessionFactory() {
+ return sessionFactory;
+ }
+
+ public void setSessionFactory(SessionFactory sessionFactory) {
+ this.sessionFactory = sessionFactory;
+ }
+}
Property changes on: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/TxTemplate.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 9 months
JBoss JBPM SVN: r5474 - jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-08-13 02:26:25 -0400 (Thu, 13 Aug 2009)
New Revision: 5474
Modified:
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/HibernateLongIdTest2.java
Log:
added some doc
Modified: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/HibernateLongIdTest2.java
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/HibernateLongIdTest2.java 2009-08-13 06:14:47 UTC (rev 5473)
+++ jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/HibernateLongIdTest2.java 2009-08-13 06:26:25 UTC (rev 5474)
@@ -33,7 +33,7 @@
/**
- * @author Tom Baeyens
+ * @author jbarrez
*/
public class HibernateLongIdTest2 extends JbpmCustomCfgTestCase {
@@ -121,7 +121,12 @@
// Quick template mechanism
+ // This is just a quick draft!!!
+ // Usage: hibernateTemplate.execute(new HibernateCallback() { ... });
+ // or when no return value is needed: hibernateTemplate.execute(new VoidHibernateCallback() { })
+
+
class HibernateTemplate {
private SessionFactory sessionFactory;
@@ -161,7 +166,7 @@
public Object execute(Session session);
}
-
+
abstract class VoidHibernateCallback implements HibernateCallback {
public abstract void executeNoReturn(Session session);
14 years, 9 months
JBoss JBPM SVN: r5473 - jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-08-13 02:14:47 -0400 (Thu, 13 Aug 2009)
New Revision: 5473
Added:
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/HibernateLongIdTest2.java
Log:
Added second version of HibernateLongIdTest for internal discussion
Added: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/HibernateLongIdTest2.java
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/HibernateLongIdTest2.java (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/HibernateLongIdTest2.java 2009-08-13 06:14:47 UTC (rev 5473)
@@ -0,0 +1,176 @@
+/*
+ * 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.test.hibernatelongid;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.hibernate.classic.Session;
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.test.JbpmCustomCfgTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class HibernateLongIdTest2 extends JbpmCustomCfgTestCase {
+
+ private HibernateTemplate hibernateTemplate;
+
+ @Override
+ protected void setUp() throws Exception {
+ super.setUp();
+ SessionFactory sessionFactory = processEngine.get(SessionFactory.class);
+ this.hibernateTemplate = new HibernateTemplate(sessionFactory);
+ }
+
+ protected void deleteRegisteredDeployments() {
+
+ hibernateTemplate.execute(new VoidHibernateCallback() {
+
+ public void executeNoReturn(Session session) {
+
+ // cannot do super.x() in anonymous inner class method :-(
+ // super.deleteRegisteredDeployments();
+ // so we repeat the functionality ... for the moment
+
+ for (String deploymentId : registeredDeployments) {
+ repositoryService.deleteDeploymentCascade(deploymentId);
+ }
+
+ List<Order> orders = session.createQuery("from " + Order.class.getName()).list();
+ for (Order order : orders) {
+ session.delete(order);
+ }
+ }
+
+ });
+
+ }
+
+ public void testHibernateLongId() {
+
+ hibernateTemplate.execute(new VoidHibernateCallback() {
+
+ public void executeNoReturn(Session session) {
+ deployJpdlXmlString(
+ "<process name='HibernateLongId'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a' />" +
+ "</process>"
+ );
+ }
+
+ });
+
+ final String processInstanceId = (String) hibernateTemplate.execute(new HibernateCallback() {
+
+ public Object execute(Session session) {
+ Order order = new Order();
+ order.setClient("Contador");
+ order.setProduct("Shampoo");
+
+ session.save(order);
+ //session.flush();
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("order", order);
+
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("HibernateLongId", variables);
+ return processInstance.getId();
+ }
+
+ });
+
+
+ hibernateTemplate.execute(new VoidHibernateCallback() {
+
+ public void executeNoReturn(Session session) {
+ Order order = (Order) executionService.getVariable(processInstanceId, "order");
+ assertNotNull(order);
+ assertEquals("Contador", order.getClient());
+ assertEquals("Shampoo", order.getProduct());
+ }
+
+ });
+ }
+
+
+ // Quick template mechanism
+
+ class HibernateTemplate {
+
+ private SessionFactory sessionFactory;
+
+ public HibernateTemplate(SessionFactory sessionFactory) {
+ this.sessionFactory = sessionFactory;
+ }
+
+ public Object execute(HibernateCallback callback) {
+ Session session = sessionFactory.openSession();
+ Transaction transaction = session.beginTransaction();
+ try {
+ return callback.execute(session);
+ } catch (Exception e) {
+ transaction.rollback();
+ } finally {
+ if (!transaction.wasRolledBack()) {
+ transaction.commit();
+ }
+ session.close();
+ }
+ return null;
+ }
+
+ public SessionFactory getSessionFactory() {
+ return sessionFactory;
+ }
+
+ public void setSessionFactory(SessionFactory sessionFactory) {
+ this.sessionFactory = sessionFactory;
+ }
+
+ }
+
+ interface HibernateCallback {
+
+ public Object execute(Session session);
+
+ }
+
+ abstract class VoidHibernateCallback implements HibernateCallback {
+
+ public abstract void executeNoReturn(Session session);
+
+ public Object execute(Session session) {
+ executeNoReturn(session);
+ return null;
+ }
+
+ }
+
+}
14 years, 9 months
JBoss JBPM SVN: r5472 - in jbpm4/trunk/modules: test-cfg/src/test/java/org/jbpm/test and 3 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-08-12 10:09:09 -0400 (Wed, 12 Aug 2009)
New Revision: 5472
Added:
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatestringid/
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatestringid/HibernateStringIdTest.java
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatestringid/Order.java
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatestringid/
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatestringid/jbpm.cfg.xml
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatestringid/jbpm.hibernate.cfg.xml
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatestringid/jbpm.tx.hibernate.cfg.xml
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatestringid/order.hbm.xml
Modified:
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml
Log:
JBPM-2474 Process variables of type hibernate-long-id/hibernate-string-id don't work
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml 2009-08-12 13:45:20 UTC (rev 5471)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml 2009-08-12 14:09:09 UTC (rev 5472)
@@ -156,15 +156,15 @@
<subclass name="org.jbpm.pvm.internal.type.variable.HibernateLongVariable" extends="org.jbpm.pvm.internal.type.Variable" discriminator-value="hib-long">
<any name="hibernatable" id-type="long">
+ <column name="CLASSNAME_"/>
<column name="LONG_VALUE_"/>
- <column name="CLASSNAME_"/>
</any>
</subclass>
<subclass name="org.jbpm.pvm.internal.type.variable.HibernateStringVariable" extends="org.jbpm.pvm.internal.type.Variable" discriminator-value="hib-string">
<any name="hibernatable" id-type="string">
+ <column name="CLASSNAME_"/>
<column name="STRING_VALUE_"/>
- <column name="CLASSNAME_"/>
</any>
</subclass>
Added: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatestringid/HibernateStringIdTest.java
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatestringid/HibernateStringIdTest.java (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatestringid/HibernateStringIdTest.java 2009-08-12 14:09:09 UTC (rev 5472)
@@ -0,0 +1,126 @@
+/*
+ * 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.test.hibernatestringid;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.hibernate.classic.Session;
+import org.hibernate.context.ThreadLocalSessionContext;
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.test.JbpmCustomCfgTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class HibernateStringIdTest extends JbpmCustomCfgTestCase {
+
+ protected void deleteRegisteredDeployments() {
+ SessionFactory sessionFactory = processEngine.get(SessionFactory.class);
+
+ Session session = sessionFactory.openSession();
+ Transaction transaction = session.beginTransaction();
+ ThreadLocalSessionContext.bind(session);
+
+ try {
+ super.deleteRegisteredDeployments();
+
+ List<Order> orders = session.createQuery("from "+Order.class.getName()).list();
+ for (Order order: orders) {
+ session.delete(order);
+ }
+
+ } finally {
+ ThreadLocalSessionContext.unbind(sessionFactory);
+ transaction.commit();
+ session.close();
+ }
+ }
+
+ public void testHibernateStringId() {
+ SessionFactory sessionFactory = processEngine.get(SessionFactory.class);
+
+ Session session = sessionFactory.openSession();
+ Transaction transaction = session.beginTransaction();
+ ThreadLocalSessionContext.bind(session);
+
+ try {
+ deployJpdlXmlString(
+ "<process name='HibernateStringId'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a' />" +
+ "</process>"
+ );
+ } finally {
+ ThreadLocalSessionContext.unbind(sessionFactory);
+ transaction.commit();
+ session.close();
+ }
+
+ String processInstanceId;
+
+ session = sessionFactory.openSession();
+ transaction = session.beginTransaction();
+ ThreadLocalSessionContext.bind(session);
+
+ try {
+ Order order = new Order("order1");
+ order.setClient("Contador");
+ order.setProduct("Shampoo");
+
+ session.save(order);
+ session.flush();
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("order", order);
+
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("HibernateStringId", variables);
+ processInstanceId = processInstance.getId();
+
+ } finally {
+ ThreadLocalSessionContext.unbind(sessionFactory);
+ transaction.commit();
+ session.close();
+ }
+
+ session = sessionFactory.openSession();
+ transaction = session.beginTransaction();
+ ThreadLocalSessionContext.bind(session);
+
+ try {
+ Order order = (Order) executionService.getVariable(processInstanceId, "order");
+ assertNotNull(order);
+ assertEquals("Contador", order.getClient());
+ assertEquals("Shampoo", order.getProduct());
+ } finally {
+ ThreadLocalSessionContext.unbind(sessionFactory);
+ transaction.commit();
+ session.close();
+ }
+ }
+}
Property changes on: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatestringid/HibernateStringIdTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatestringid/Order.java
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatestringid/Order.java (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatestringid/Order.java 2009-08-12 14:09:09 UTC (rev 5472)
@@ -0,0 +1,57 @@
+/*
+ * 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.test.hibernatestringid;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class Order {
+
+ String id;
+
+ String client;
+ String product;
+
+ protected Order() {
+ }
+
+ public Order(String id) {
+ this.id = id;
+ }
+
+ public String getClient() {
+ return client;
+ }
+ public void setClient(String client) {
+ this.client = client;
+ }
+ public String getProduct() {
+ return product;
+ }
+ public void setProduct(String product) {
+ this.product = product;
+ }
+ public String getId() {
+ return id;
+ }
+}
Property changes on: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatestringid/Order.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatestringid/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatestringid/jbpm.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatestringid/jbpm.cfg.xml 2009-08-12 14:09:09 UTC (rev 5472)
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <import resource="jbpm.businesscalendar.cfg.xml" />
+ <import resource="org/jbpm/test/hibernatestringid/jbpm.tx.hibernate.cfg.xml" />
+ <import resource="jbpm.jpdl.cfg.xml" />
+ <import resource="jbpm.identity.cfg.xml" />
+
+ <process-engine-context>
+
+ <repository-service />
+ <repository-cache />
+ <execution-service />
+ <history-service />
+ <management-service />
+ <identity-service />
+ <task-service />
+
+ <hibernate-configuration>
+ <cfg resource="org/jbpm/test/hibernatestringid/jbpm.hibernate.cfg.xml" />
+ </hibernate-configuration>
+
+ <hibernate-session-factory />
+
+ <script-manager default-expression-language="juel"
+ default-script-language="juel">
+ <script-language name="juel" factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
+ </script-manager>
+
+ <id-generator />
+ <types resource="jbpm.variable.types.xml" />
+
+ <address-resolver />
+
+ <mail-template name='task-notification'>
+ <to users="${task.assignee}"/>
+ <subject>${task.name}</subject>
+ <text><![CDATA[Hi ${task.assignee},
+Task "${task.name}" has been assigned to you.
+${task.description}
+
+Sent by JBoss jBPM
+]]></text>
+ </mail-template>
+
+ <mail-template name='task-reminder'>
+ <to users="${task.assignee}"/>
+ <subject>${task.name}</subject>
+ <text><![CDATA[Hey ${task.assignee},
+Do not forget about task "${task.name}".
+${task.description}
+
+Sent by JBoss jBPM
+]]></text>
+ </mail-template>
+
+ </process-engine-context>
+
+ <transaction-context>
+ <repository-session />
+ <db-session />
+
+ <message-session />
+ <timer-session />
+ <history-session />
+ <mail-session>
+ <mail-server>
+ <session-properties resource="jbpm.mail.properties" />
+ </mail-server>
+ </mail-session>
+ </transaction-context>
+
+</jbpm-configuration>
Property changes on: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatestringid/jbpm.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatestringid/jbpm.hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatestringid/jbpm.hibernate.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatestringid/jbpm.hibernate.cfg.xml 2009-08-12 14:09:09 UTC (rev 5472)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+ <session-factory>
+
+ <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
+ <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
+ <property name="hibernate.connection.url">jdbc:hsqldb:mem:.</property>
+ <property name="hibernate.connection.username">sa</property>
+ <property name="hibernate.connection.password"></property>
+ <property name="hibernate.hbm2ddl.auto">create-drop</property>
+ <property name="hibernate.format_sql">true</property>
+
+ <!-- Enable Hibernate's automatic session context management -->
+ <property name="current_session_context_class">thread</property>
+
+ <mapping resource="jbpm.repository.hbm.xml" />
+ <mapping resource="jbpm.execution.hbm.xml" />
+ <mapping resource="jbpm.history.hbm.xml" />
+ <mapping resource="jbpm.task.hbm.xml" />
+ <mapping resource="jbpm.identity.hbm.xml" />
+
+ <mapping resource="org/jbpm/test/hibernatestringid/order.hbm.xml" />
+
+ </session-factory>
+</hibernate-configuration>
Property changes on: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatestringid/jbpm.hibernate.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatestringid/jbpm.tx.hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatestringid/jbpm.tx.hibernate.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatestringid/jbpm.tx.hibernate.cfg.xml 2009-08-12 14:09:09 UTC (rev 5472)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <process-engine-context>
+ <command-service>
+ <retry-interceptor />
+ <environment-interceptor />
+ </command-service>
+ </process-engine-context>
+
+ <transaction-context>
+ <hibernate-session current="true" />
+ </transaction-context>
+
+</jbpm-configuration>
Property changes on: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatestringid/jbpm.tx.hibernate.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatestringid/order.hbm.xml
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatestringid/order.hbm.xml (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatestringid/order.hbm.xml 2009-08-12 14:09:09 UTC (rev 5472)
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping default-access="field">
+
+ <!-- ### Deployment ##################################################### -->
+ <class name="org.jbpm.test.hibernatestringid.Order" table="ORDERS">
+
+ <id name="id">
+ <generator class="assigned" />
+ </id>
+
+ <property name="client" />
+ <property name="product" />
+
+ </class>
+
+</hibernate-mapping>
Property changes on: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatestringid/order.hbm.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
14 years, 9 months
JBoss JBPM SVN: r5471 - in jbpm4/trunk/modules: examples and 8 other directories.
by do-not-reply@jboss.org
Author: tom.baeyens(a)jboss.com
Date: 2009-08-12 09:45:20 -0400 (Wed, 12 Aug 2009)
New Revision: 5471
Added:
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/HibernateLongIdTest.java
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/Order.java
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.cfg.xml
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.hibernate.cfg.xml
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.tx.hibernate.cfg.xml
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/order.hbm.xml
Modified:
jbpm4/trunk/modules/distro/src/main/files/readme.html
jbpm4/trunk/modules/examples/pom.xml
jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TypesBinding.java
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml
jbpm4/trunk/modules/pvm/src/main/resources/jbpm.variable.types.xml
jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml
Log:
JBPM-2474 Process variables of type hibernate-long-id/hibernate-string-id don't work
Modified: jbpm4/trunk/modules/distro/src/main/files/readme.html
===================================================================
--- jbpm4/trunk/modules/distro/src/main/files/readme.html 2009-08-12 11:21:16 UTC (rev 5470)
+++ jbpm4/trunk/modules/distro/src/main/files/readme.html 2009-08-12 13:45:20 UTC (rev 5471)
@@ -37,6 +37,13 @@
<h1>Release Notes for jBPM 4.1</h1>
+<h2>DB Migration</h2>
+
+<p>A column CLASSNAME_ (String) was added to the JBPM4_VARIABLE table. Please follow the instructions
+in the section Migration in the userguide. Tech details of the update in the jira
+issue: <a href="https://jira.jboss.org/jira/browse/JBPM-2474">JBPM-2474</a>
+</p>
+
<h2>Changed functionality</h2>
<ul>
Modified: jbpm4/trunk/modules/examples/pom.xml
===================================================================
--- jbpm4/trunk/modules/examples/pom.xml 2009-08-12 11:21:16 UTC (rev 5470)
+++ jbpm4/trunk/modules/examples/pom.xml 2009-08-12 13:45:20 UTC (rev 5471)
@@ -94,6 +94,33 @@
</build>
<profiles>
+ <profile>
+ <id>config</id>
+ <build>
+ <plugins>
+ <plugin>
+ <artifactId>maven-antrun-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>custom-config</id>
+ <phase>test-compile</phase>
+ <goals>
+ <goal>run</goal>
+ </goals>
+ <configuration>
+ <tasks>
+ <ant antfile="../distro/src/main/files/install/build.xml" target="create.cfg">
+ <property name="database" value="oracle" />
+ </ant>
+ </tasks>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+ </profile>
+
<!-- -Ddatabase= -->
<profile>
<id>standalone.tests</id>
Modified: jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TypesBinding.java
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TypesBinding.java 2009-08-12 11:21:16 UTC (rev 5470)
+++ jbpm4/trunk/modules/pvm/src/main/java/org/jbpm/pvm/internal/wire/binding/TypesBinding.java 2009-08-12 13:45:20 UTC (rev 5471)
@@ -117,8 +117,8 @@
if ("serializable".equals(className)) {
matcher = new SerializableMatcher();
- // if type="persistable"
- } else if ("persistable".equals(className)) {
+ // if type="hibernatable"
+ } else if ("hibernatable".equals(className)) {
if (element.hasAttribute("id-type")) {
String idType = element.getAttribute("id-type");
if ("long".equalsIgnoreCase(idType)) {
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml 2009-08-12 11:21:16 UTC (rev 5470)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.execution.hbm.xml 2009-08-12 13:45:20 UTC (rev 5471)
@@ -137,6 +137,15 @@
foreign-key="none"/>
</class>
+ <subclass name="org.jbpm.pvm.internal.type.variable.BlobVariable" extends="org.jbpm.pvm.internal.type.Variable" discriminator-value="blob">
+ <many-to-one name="lob"
+ column="LOB_"
+ cascade="all"
+ class="org.jbpm.pvm.internal.lob.Lob"
+ foreign-key="FK_VAR_LOB"
+ index="IDX_VAR_LOB" />
+ </subclass>
+
<subclass name="org.jbpm.pvm.internal.type.variable.DateVariable" extends="org.jbpm.pvm.internal.type.Variable" discriminator-value="date">
<property name="date" column="DATE_VALUE_" type="timestamp"/>
</subclass>
@@ -146,15 +155,24 @@
</subclass>
<subclass name="org.jbpm.pvm.internal.type.variable.HibernateLongVariable" extends="org.jbpm.pvm.internal.type.Variable" discriminator-value="hib-long">
- <property name="hibernatable" column="LONG_VALUE_" type="long"/>
+ <any name="hibernatable" id-type="long">
+ <column name="LONG_VALUE_"/>
+ <column name="CLASSNAME_"/>
+ </any>
</subclass>
+ <subclass name="org.jbpm.pvm.internal.type.variable.HibernateStringVariable" extends="org.jbpm.pvm.internal.type.Variable" discriminator-value="hib-string">
+ <any name="hibernatable" id-type="string">
+ <column name="STRING_VALUE_"/>
+ <column name="CLASSNAME_"/>
+ </any>
+ </subclass>
+
<subclass name="org.jbpm.pvm.internal.type.variable.LongVariable" extends="org.jbpm.pvm.internal.type.Variable" discriminator-value="long">
<property name="l" column="LONG_VALUE_" type="long"/>
</subclass>
- <subclass name="org.jbpm.pvm.internal.type.variable.HibernateStringVariable" extends="org.jbpm.pvm.internal.type.Variable" discriminator-value="hib-string">
- <property name="hibernatable" column="STRING_VALUE_" type="string"/>
+ <subclass name="org.jbpm.pvm.internal.type.variable.NullVariable" extends="org.jbpm.pvm.internal.type.Variable" discriminator-value="null">
</subclass>
<subclass name="org.jbpm.pvm.internal.type.variable.StringVariable" extends="org.jbpm.pvm.internal.type.Variable" discriminator-value="string">
@@ -165,18 +183,6 @@
<property name="text" column="TEXT_VALUE_" type="text"/>
</subclass>
- <subclass name="org.jbpm.pvm.internal.type.variable.NullVariable" extends="org.jbpm.pvm.internal.type.Variable" discriminator-value="null">
- </subclass>
-
- <subclass name="org.jbpm.pvm.internal.type.variable.BlobVariable" extends="org.jbpm.pvm.internal.type.Variable" discriminator-value="blob">
- <many-to-one name="lob"
- column="LOB_"
- cascade="all"
- class="org.jbpm.pvm.internal.lob.Lob"
- foreign-key="FK_VAR_LOB"
- index="IDX_VAR_LOB" />
- </subclass>
-
<!-- ### LOB ############################################################ -->
<class name="org.jbpm.pvm.internal.lob.Lob" table="JBPM4_LOB">
<id name="dbid" column="DBID_">
Modified: jbpm4/trunk/modules/pvm/src/main/resources/jbpm.variable.types.xml
===================================================================
--- jbpm4/trunk/modules/pvm/src/main/resources/jbpm.variable.types.xml 2009-08-12 11:21:16 UTC (rev 5470)
+++ jbpm4/trunk/modules/pvm/src/main/resources/jbpm.variable.types.xml 2009-08-12 13:45:20 UTC (rev 5471)
@@ -22,8 +22,8 @@
<type name="byte[]" class="[B" variable-class="org.jbpm.pvm.internal.type.variable.BlobVariable" />
<type name="char[]" class="[C" variable-class="org.jbpm.pvm.internal.type.variable.TextVariable" />
- <type name="hibernate-long-id" class="hibernate" id-type="long" variable-class="org.jbpm.pvm.internal.type.variable.HibernateLongVariable" />
- <type name="hibernate-string-id" class="hibernate" id-type="string" variable-class="org.jbpm.pvm.internal.type.variable.HibernateStringVariable" />
+ <type name="hibernate-long-id" class="hibernatable" id-type="long" variable-class="org.jbpm.pvm.internal.type.variable.HibernateLongVariable" />
+ <type name="hibernate-string-id" class="hibernatable" id-type="string" variable-class="org.jbpm.pvm.internal.type.variable.HibernateStringVariable" />
<type name="serializable" class="serializable" converter="org.jbpm.pvm.internal.type.converter.SerializableToBytesConverter" variable-class="org.jbpm.pvm.internal.type.variable.BlobVariable" />
Modified: jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java
===================================================================
--- jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java 2009-08-12 11:21:16 UTC (rev 5470)
+++ jbpm4/trunk/modules/test-base/src/main/java/org/jbpm/test/JbpmTestCase.java 2009-08-12 13:45:20 UTC (rev 5471)
@@ -116,10 +116,21 @@
}
protected void tearDown() throws Exception {
- for (String deploymentId : registeredDeployments) {
- repositoryService.deleteDeploymentCascade(deploymentId);
+ deleteRegisteredDeployments();
+ String errorMsg = verifyDbClean();
+
+ super.tearDown();
+
+ if (errorMsg!=null) {
+ if (exception==null) {
+ throw new JbpmException(errorMsg);
+ } else {
+ throw new JbpmException(errorMsg, exception);
+ }
}
+ }
+ protected String verifyDbClean() {
String errorMsg = null;
String recordsLeftMsg = Db.verifyClean(processEngine);
if ( (recordsLeftMsg!=null)
@@ -127,15 +138,12 @@
) {
errorMsg = "database was not clean after test: "+recordsLeftMsg;
}
+ return errorMsg;
+ }
- super.tearDown();
-
- if (errorMsg!=null) {
- if (exception==null) {
- throw new JbpmException(errorMsg);
- } else {
- throw new JbpmException(errorMsg, exception);
- }
+ protected void deleteRegisteredDeployments() {
+ for (String deploymentId : registeredDeployments) {
+ repositoryService.deleteDeploymentCascade(deploymentId);
}
}
Added: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/HibernateLongIdTest.java
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/HibernateLongIdTest.java (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/HibernateLongIdTest.java 2009-08-12 13:45:20 UTC (rev 5471)
@@ -0,0 +1,126 @@
+/*
+ * 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.test.hibernatelongid;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.hibernate.SessionFactory;
+import org.hibernate.Transaction;
+import org.hibernate.classic.Session;
+import org.hibernate.context.ThreadLocalSessionContext;
+import org.jbpm.api.ProcessInstance;
+import org.jbpm.test.JbpmCustomCfgTestCase;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class HibernateLongIdTest extends JbpmCustomCfgTestCase {
+
+ protected void deleteRegisteredDeployments() {
+ SessionFactory sessionFactory = processEngine.get(SessionFactory.class);
+
+ Session session = sessionFactory.openSession();
+ Transaction transaction = session.beginTransaction();
+ ThreadLocalSessionContext.bind(session);
+
+ try {
+ super.deleteRegisteredDeployments();
+
+ List<Order> orders = session.createQuery("from "+Order.class.getName()).list();
+ for (Order order: orders) {
+ session.delete(order);
+ }
+
+ } finally {
+ ThreadLocalSessionContext.unbind(sessionFactory);
+ transaction.commit();
+ session.close();
+ }
+ }
+
+ public void testHibernateLongId() {
+ SessionFactory sessionFactory = processEngine.get(SessionFactory.class);
+
+ Session session = sessionFactory.openSession();
+ Transaction transaction = session.beginTransaction();
+ ThreadLocalSessionContext.bind(session);
+
+ try {
+ deployJpdlXmlString(
+ "<process name='HibernateLongId'>" +
+ " <start>" +
+ " <transition to='a' />" +
+ " </start>" +
+ " <state name='a' />" +
+ "</process>"
+ );
+ } finally {
+ ThreadLocalSessionContext.unbind(sessionFactory);
+ transaction.commit();
+ session.close();
+ }
+
+ String processInstanceId;
+
+ session = sessionFactory.openSession();
+ transaction = session.beginTransaction();
+ ThreadLocalSessionContext.bind(session);
+
+ try {
+ Order order = new Order();
+ order.setClient("Contador");
+ order.setProduct("Shampoo");
+
+ session.save(order);
+ session.flush();
+
+ Map<String, Object> variables = new HashMap<String, Object>();
+ variables.put("order", order);
+
+ ProcessInstance processInstance = executionService.startProcessInstanceByKey("HibernateLongId", variables);
+ processInstanceId = processInstance.getId();
+
+ } finally {
+ ThreadLocalSessionContext.unbind(sessionFactory);
+ transaction.commit();
+ session.close();
+ }
+
+ session = sessionFactory.openSession();
+ transaction = session.beginTransaction();
+ ThreadLocalSessionContext.bind(session);
+
+ try {
+ Order order = (Order) executionService.getVariable(processInstanceId, "order");
+ assertNotNull(order);
+ assertEquals("Contador", order.getClient());
+ assertEquals("Shampoo", order.getProduct());
+ } finally {
+ ThreadLocalSessionContext.unbind(sessionFactory);
+ transaction.commit();
+ session.close();
+ }
+ }
+}
Property changes on: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/HibernateLongIdTest.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/Order.java
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/Order.java (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/Order.java 2009-08-12 13:45:20 UTC (rev 5471)
@@ -0,0 +1,50 @@
+/*
+ * 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.test.hibernatelongid;
+
+
+/**
+ * @author Tom Baeyens
+ */
+public class Order {
+
+ Long id;
+
+ String client;
+ String product;
+
+ public String getClient() {
+ return client;
+ }
+ public void setClient(String client) {
+ this.client = client;
+ }
+ public String getProduct() {
+ return product;
+ }
+ public void setProduct(String product) {
+ this.product = product;
+ }
+ public Long getId() {
+ return id;
+ }
+}
Property changes on: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/hibernatelongid/Order.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.cfg.xml 2009-08-12 13:45:20 UTC (rev 5471)
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <import resource="jbpm.businesscalendar.cfg.xml" />
+ <import resource="org/jbpm/test/hibernatelongid/jbpm.tx.hibernate.cfg.xml" />
+ <import resource="jbpm.jpdl.cfg.xml" />
+ <import resource="jbpm.identity.cfg.xml" />
+
+ <process-engine-context>
+
+ <repository-service />
+ <repository-cache />
+ <execution-service />
+ <history-service />
+ <management-service />
+ <identity-service />
+ <task-service />
+
+ <hibernate-configuration>
+ <cfg resource="org/jbpm/test/hibernatelongid/jbpm.hibernate.cfg.xml" />
+ </hibernate-configuration>
+
+ <hibernate-session-factory />
+
+ <script-manager default-expression-language="juel"
+ default-script-language="juel">
+ <script-language name="juel" factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
+ </script-manager>
+
+ <id-generator />
+ <types resource="jbpm.variable.types.xml" />
+
+ <address-resolver />
+
+ <mail-template name='task-notification'>
+ <to users="${task.assignee}"/>
+ <subject>${task.name}</subject>
+ <text><![CDATA[Hi ${task.assignee},
+Task "${task.name}" has been assigned to you.
+${task.description}
+
+Sent by JBoss jBPM
+]]></text>
+ </mail-template>
+
+ <mail-template name='task-reminder'>
+ <to users="${task.assignee}"/>
+ <subject>${task.name}</subject>
+ <text><![CDATA[Hey ${task.assignee},
+Do not forget about task "${task.name}".
+${task.description}
+
+Sent by JBoss jBPM
+]]></text>
+ </mail-template>
+
+ </process-engine-context>
+
+ <transaction-context>
+ <repository-session />
+ <db-session />
+
+ <message-session />
+ <timer-session />
+ <history-session />
+ <mail-session>
+ <mail-server>
+ <session-properties resource="jbpm.mail.properties" />
+ </mail-server>
+ </mail-session>
+ </transaction-context>
+
+</jbpm-configuration>
Property changes on: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.hibernate.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.hibernate.cfg.xml 2009-08-12 13:45:20 UTC (rev 5471)
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+ <session-factory>
+
+ <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
+ <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
+ <property name="hibernate.connection.url">jdbc:hsqldb:mem:.</property>
+ <property name="hibernate.connection.username">sa</property>
+ <property name="hibernate.connection.password"></property>
+ <property name="hibernate.hbm2ddl.auto">create-drop</property>
+ <property name="hibernate.format_sql">true</property>
+
+ <!-- Enable Hibernate's automatic session context management -->
+ <property name="current_session_context_class">thread</property>
+
+ <mapping resource="jbpm.repository.hbm.xml" />
+ <mapping resource="jbpm.execution.hbm.xml" />
+ <mapping resource="jbpm.history.hbm.xml" />
+ <mapping resource="jbpm.task.hbm.xml" />
+ <mapping resource="jbpm.identity.hbm.xml" />
+
+ <mapping resource="org/jbpm/test/hibernatelongid/order.hbm.xml" />
+
+ </session-factory>
+</hibernate-configuration>
Property changes on: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.hibernate.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.tx.hibernate.cfg.xml
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.tx.hibernate.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.tx.hibernate.cfg.xml 2009-08-12 13:45:20 UTC (rev 5471)
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <process-engine-context>
+ <command-service>
+ <retry-interceptor />
+ <environment-interceptor />
+ </command-service>
+ </process-engine-context>
+
+ <transaction-context>
+ <hibernate-session current="true" />
+ </transaction-context>
+
+</jbpm-configuration>
Property changes on: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/jbpm.tx.hibernate.cfg.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/order.hbm.xml
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/order.hbm.xml (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/order.hbm.xml 2009-08-12 13:45:20 UTC (rev 5471)
@@ -0,0 +1,18 @@
+<?xml version="1.0"?>
+<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
+
+<hibernate-mapping default-access="field">
+
+ <!-- ### Deployment ##################################################### -->
+ <class name="org.jbpm.test.hibernatelongid.Order" table="ORDERS">
+
+ <id name="id">
+ <generator class="native" />
+ </id>
+
+ <property name="client" />
+ <property name="product" />
+
+ </class>
+
+</hibernate-mapping>
Property changes on: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/hibernatelongid/order.hbm.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml
===================================================================
--- jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml 2009-08-12 11:21:16 UTC (rev 5470)
+++ jbpm4/trunk/modules/userguide/src/main/docbook/en/modules/ch02-Installation.xml 2009-08-12 13:45:20 UTC (rev 5471)
@@ -182,6 +182,11 @@
</itemizedlist>
</section>
+ <section id="databasemigration">
+ <title>Database migration</title>
+ <para>TODO: document the instructions how users should apply the automatic migration</para>
+ </section>
+
<section id="graphicalprocessdesigner">
<title>Graphical Process Designer (GPD)</title>
<para>Eclipse is used as the platform to host the jPDL graphical process
14 years, 9 months
JBoss JBPM SVN: r5470 - in jbpm4/trunk/modules/test-cfg/src/test: resources/org/jbpm/test and 1 other directories.
by do-not-reply@jboss.org
Author: jbarrez
Date: 2009-08-12 07:21:16 -0400 (Wed, 12 Aug 2009)
New Revision: 5470
Added:
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/repocache/
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/repocache/jbpm.cfg.xml
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/repocache/jbpm_alternative.cfg.xml
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/repocache/jbpm_alternative.hibernate.cfg.xml
Removed:
jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/cache/
Modified:
jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/repocache/RepositoryCacheTest.java
Log:
Fix for messed up test case
Modified: jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/repocache/RepositoryCacheTest.java
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/repocache/RepositoryCacheTest.java 2009-08-12 11:05:27 UTC (rev 5469)
+++ jbpm4/trunk/modules/test-cfg/src/test/java/org/jbpm/test/repocache/RepositoryCacheTest.java 2009-08-12 11:21:16 UTC (rev 5470)
@@ -70,7 +70,6 @@
* * When signalling an execution which has a deleted deployment
*/
public void testDeleteDeploymentsUsingTwoProcessEngines() {
- /*
ProcessEngine processEngine2 = createProcessEngineFromAlternativeConfig();
ExecutionService executionService2 = processEngine2.getExecutionService();
assertFalse(processEngine.equals(processEngine2));
@@ -121,11 +120,10 @@
executionService2.signalExecutionById(executionAtWaitState2.getId());
fail();
} catch (JbpmException e) { }
- */
}
private ProcessEngine createProcessEngineFromAlternativeConfig() {
- Configuration configuration = new Configuration().setResource("org/jbpm/test/cache/jbpm_alternative.cfg.xml");
+ Configuration configuration = new Configuration().setResource("org/jbpm/test/repocache/jbpm_alternative.cfg.xml");
return configuration.buildProcessEngine();
}
Copied: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/repocache/jbpm.cfg.xml (from rev 5433, jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/cache/jbpm.cfg.xml)
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/repocache/jbpm.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/repocache/jbpm.cfg.xml 2009-08-12 11:21:16 UTC (rev 5470)
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<jbpm-configuration>
+
+ <import resource="jbpm.default.cfg.xml" />
+ <import resource="jbpm.businesscalendar.cfg.xml" />
+ <import resource="jbpm.tx.hibernate.cfg.xml" />
+ <import resource="jbpm.jpdl.cfg.xml" />
+ <import resource="jbpm.identity.cfg.xml" />
+
+</jbpm-configuration>
Copied: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/repocache/jbpm_alternative.cfg.xml (from rev 5433, jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/cache/jbpm_alternative.cfg.xml)
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/repocache/jbpm_alternative.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/repocache/jbpm_alternative.cfg.xml 2009-08-12 11:21:16 UTC (rev 5470)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+ <!--
+
+ Alternative configuration: * no create-drop for the database
+ -->
+
+<jbpm-configuration>
+
+ <process-engine-context>
+
+ <repository-service />
+ <repository-cache />
+ <execution-service />
+ <history-service />
+ <management-service />
+ <identity-service />
+ <task-service />
+
+ <hibernate-configuration>
+ <cfg resource="org/jbpm/test/repocache/jbpm_alternative.hibernate.cfg.xml" />
+ </hibernate-configuration>
+
+ <hibernate-session-factory />
+
+ <script-manager default-expression-language="juel"
+ default-script-language="juel">
+ <script-language name="juel"
+ factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
+ </script-manager>
+
+ <id-generator />
+ <types resource="jbpm.variable.types.xml" />
+
+ <address-resolver />
+
+ </process-engine-context>
+
+ <transaction-context>
+ <repository-session />
+ <db-session />
+
+ <message-session />
+ <timer-session />
+ <history-session />
+ <mail-session>
+ <mail-server>
+ <session-properties resource="jbpm.mail.properties" />
+ </mail-server>
+ </mail-session>
+ </transaction-context>
+
+ <import resource="jbpm.businesscalendar.cfg.xml" />
+ <import resource="jbpm.tx.hibernate.cfg.xml" />
+ <import resource="jbpm.jpdl.cfg.xml" />
+ <import resource="jbpm.identity.cfg.xml" />
+
+</jbpm-configuration>
Copied: jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/repocache/jbpm_alternative.hibernate.cfg.xml (from rev 5433, jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/cache/jbpm_alternative.hibernate.cfg.xml)
===================================================================
--- jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/repocache/jbpm_alternative.hibernate.cfg.xml (rev 0)
+++ jbpm4/trunk/modules/test-cfg/src/test/resources/org/jbpm/test/repocache/jbpm_alternative.hibernate.cfg.xml 2009-08-12 11:21:16 UTC (rev 5470)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<!DOCTYPE hibernate-configuration PUBLIC
+ "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
+ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+
+<hibernate-configuration>
+ <session-factory>
+
+ <!-- HSQLDB -->
+ <property name="hibernate.dialect">org.hibernate.dialect.HSQLDialect</property>
+ <property name="hibernate.connection.driver_class">org.hsqldb.jdbcDriver</property>
+ <property name="hibernate.connection.url">jdbc:hsqldb:mem:.</property>
+ <property name="hibernate.connection.username">sa</property>
+ <property name="hibernate.connection.password"></property>
+
+ <!-- Alternative config: no create-drop -->
+ <property name="hibernate.hbm2ddl.auto">update</property>
+ <property name="hibernate.format_sql">true</property>
+
+ <mapping resource="jbpm.repository.hbm.xml" />
+ <mapping resource="jbpm.execution.hbm.xml" />
+ <mapping resource="jbpm.history.hbm.xml" />
+ <mapping resource="jbpm.task.hbm.xml" />
+ <mapping resource="jbpm.identity.hbm.xml" />
+
+ </session-factory>
+</hibernate-configuration>
14 years, 9 months