JBoss JBPM SVN: r1544 - api/tags.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-08 08:08:07 -0400 (Tue, 08 Jul 2008)
New Revision: 1544
Added:
api/tags/jbpm-api-1.0.0.Alpha1/
Log:
Tag jbpm-api-1.0.0.Alpha1
Copied: api/tags/jbpm-api-1.0.0.Alpha1 (from rev 1543, api/trunk)
15 years, 10 months
JBoss JBPM SVN: r1543 - api.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-08 08:06:49 -0400 (Tue, 08 Jul 2008)
New Revision: 1543
Added:
api/branches/
Log:
Create tags/branches
15 years, 10 months
JBoss JBPM SVN: r1542 - api.
by do-not-reply@jboss.org
Author: thomas.diesler(a)jboss.com
Date: 2008-07-08 08:06:39 -0400 (Tue, 08 Jul 2008)
New Revision: 1542
Added:
api/tags/
Log:
Create tags/branches
15 years, 10 months
JBoss JBPM SVN: r1541 - pvm/trunk/modules/core/src/test/java/org/jbpm/msg.
by do-not-reply@jboss.org
Author: porcherg
Date: 2008-07-08 05:21:42 -0400 (Tue, 08 Jul 2008)
New Revision: 1541
Modified:
pvm/trunk/modules/core/src/test/java/org/jbpm/msg/MemMessageServiceTest.java
Log:
enlist message service in transaction
Modified: pvm/trunk/modules/core/src/test/java/org/jbpm/msg/MemMessageServiceTest.java
===================================================================
--- pvm/trunk/modules/core/src/test/java/org/jbpm/msg/MemMessageServiceTest.java 2008-07-08 09:20:46 UTC (rev 1540)
+++ pvm/trunk/modules/core/src/test/java/org/jbpm/msg/MemMessageServiceTest.java 2008-07-08 09:21:42 UTC (rev 1541)
@@ -22,7 +22,9 @@
" </environment-factory>" +
" <environment>" +
" <transaction name='tx' />" +
- " <object name='messageService' class='"+MemMessageService.class.getName()+"' auto-wire='enabled'/>" +
+ " <object name='messageService' class='"+MemMessageService.class.getName()+"' auto-wire='enabled'>" +
+ " <enlist transaction='tx'/>" +
+ " </object>" +
// queue gets auto-wired into the message service
" </environment>" +
"</contexts>"
15 years, 10 months
JBoss JBPM SVN: r1540 - pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor.
by do-not-reply@jboss.org
Author: porcherg
Date: 2008-07-08 05:20:46 -0400 (Tue, 08 Jul 2008)
New Revision: 1540
Modified:
pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java
Log:
autoWire search for objects in current environment
Modified: pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java
===================================================================
--- pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java 2008-07-08 08:19:11 UTC (rev 1539)
+++ pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java 2008-07-08 09:20:46 UTC (rev 1540)
@@ -284,9 +284,20 @@
autoWireValue = wireContext.get(fieldName);
} else {
- autoWireValue = wireContext.get(field.getType());
+ autoWireValue = wireContext.get(field.getType());
}
-
+ // if auto wire value has not been found in current context,
+ // search in environment
+ if (autoWireValue == null) {
+ Environment currentEnvironment = Environment.getCurrent();
+ if (currentEnvironment != null) {
+ autoWireValue = currentEnvironment.get(fieldName);
+ if (autoWireValue == null) {
+ autoWireValue = currentEnvironment.get(field.getType());
+ }
+ }
+ }
+
if (autoWireValue!=null) {
try {
log.debug("auto wiring field "+fieldName+" in "+name);
15 years, 10 months
JBoss JBPM SVN: r1539 - pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/samples/ex07.
by do-not-reply@jboss.org
Author: porcherg
Date: 2008-07-08 04:19:11 -0400 (Tue, 08 Jul 2008)
New Revision: 1539
Modified:
pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/samples/ex07/EventListenerTest.java
Log:
fix event names
Modified: pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/samples/ex07/EventListenerTest.java
===================================================================
--- pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/samples/ex07/EventListenerTest.java 2008-07-08 07:59:44 UTC (rev 1538)
+++ pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/samples/ex07/EventListenerTest.java 2008-07-08 08:19:11 UTC (rev 1539)
@@ -28,6 +28,7 @@
import org.jbpm.pvm.samples.activities.Display;
import org.jbpm.pvm.samples.activities.WaitState;
import org.jbpm.pvm.client.ClientProcessDefinition;
+import org.jbpm.pvm.model.Event;
import org.jbpm.pvm.model.ProcessDefinition;
import org.jbpm.pvm.model.ProcessFactory;
@@ -44,13 +45,13 @@
public void testEventAction() {
ClientProcessDefinition processDefinition = ProcessFactory.build()
.node("a").initial().behaviour(new AutomaticActivity())
- .event("node-leave")
+ .event(Event.NODE_END)
.listener(new Display("leaving a"))
.listener(new Display("second message while leaving a"))
.transition().to("b")
.listener(new Display("taking transition"))
.node("b").behaviour(new WaitState())
- .event("node-enter")
+ .event(Event.NODE_BEGIN)
.listener(new Display("entering b"))
.done();
15 years, 10 months
JBoss JBPM SVN: r1538 - in pvm/trunk/modules/core/src: main/java/org/jbpm/pvm/internal/env and 5 other directories.
by do-not-reply@jboss.org
Author: porcherg
Date: 2008-07-08 03:59:44 -0400 (Tue, 08 Jul 2008)
New Revision: 1538
Modified:
pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/env/Context.java
pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/env/Environment.java
pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/env/PvmEnvironmentFactory.java
pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/env/DefaultEnvironment.java
pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/env/ExecutionContext.java
pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/env/JobContext.java
pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/env/WebRequestContext.java
pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/env/WebSessionContext.java
pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/spring/SpringEnvironment.java
pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/spring/SpringEnvironmentContext.java
pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/spring/SpringEnvironmentFactory.java
pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java
pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/EnterpriseTransactionDescriptor.java
pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/EnvironmentDescriptor.java
pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/EnvironmentTypeRefDescriptor.java
pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateSessionDescriptor.java
pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java
pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/StandardTransactionDescriptor.java
pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/operation/EnlistOperation.java
pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/operation/SubscribeOperation.java
pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/spring2/PojoEnvironment.java
pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/spring2/SimpleContext.java
pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/spring2/SpringPojoEnvironmentFactory.java
pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/spring2/pvm-beans.xml
Log:
remove get/setEnvironment from Context (JBPM-1220)
Modified: pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/env/Context.java
===================================================================
--- pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/env/Context.java 2008-07-08 07:50:10 UTC (rev 1537)
+++ pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/env/Context.java 2008-07-08 07:59:44 UTC (rev 1538)
@@ -39,6 +39,4 @@
Object set(String key, Object value);
Set<String> keys();
- /** invoked by the environment when this context is added. */
- void setEnvironment(Environment environment);
}
Modified: pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/env/Environment.java
===================================================================
--- pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/env/Environment.java 2008-07-08 07:50:10 UTC (rev 1537)
+++ pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/env/Environment.java 2008-07-08 07:59:44 UTC (rev 1538)
@@ -159,9 +159,7 @@
public abstract Throwable getException();
/**
- * closes the Environment by removing all its contexts. As a result of removing the
- * contexts, the {@link Context#setEnvironment(Environment)} will be called with a
- * null value for environment.
+ * closes the Environment by removing all its contexts.
*/
public abstract void close();
Modified: pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/env/PvmEnvironmentFactory.java
===================================================================
--- pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/env/PvmEnvironmentFactory.java 2008-07-08 07:50:10 UTC (rev 1537)
+++ pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/env/PvmEnvironmentFactory.java 2008-07-08 07:59:44 UTC (rev 1538)
@@ -126,24 +126,27 @@
WireContext blockContext = new WireContext(blockWireDefinition, DefaultEnvironment.CONTEXTNAME_ENVIRONMENT, environment, true);
// add the environment block context to the environment
environment.addContext(blockContext);
- // finish the creation of the environment wire context
- blockContext.create();
- // fire an open environment event
- applicationWireContext.fire(DefaultEnvironment.EVENT_OPENENVIRONMENT, environment);
-
- // if all went well, only then push the created environment
+ // push the created environment so that Environment.getCurrent() returns it
+ // This is required to construct some objects in blockContext
Environment.pushEnvironment(environment);
+
+ try {
+ // finish the creation of the environment wire context
+ blockContext.create();
+ // fire an open environment event
+ applicationWireContext.fire(DefaultEnvironment.EVENT_OPENENVIRONMENT, environment);
+
+ } catch (RuntimeException e) {
+ // On exception, pop environment
+ Environment.popEnvironment();
+ throw e;
+ }
+ // if all went well, return the created environment
return environment;
}
- public void setEnvironment(Environment environment) {
- // this object is the environment factory and the environment-factory context, so
- // it doesn't need to do anythings when the environment-factory context is added
- // to the environment
- }
-
public void close() {
applicationWireContext.fire(WireContext.EVENT_CLOSE, null);
}
Modified: pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/env/DefaultEnvironment.java
===================================================================
--- pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/env/DefaultEnvironment.java 2008-07-08 07:50:10 UTC (rev 1537)
+++ pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/env/DefaultEnvironment.java 2008-07-08 07:59:44 UTC (rev 1538)
@@ -86,7 +86,6 @@
public void addContext(Context context) {
String key = context.getName();
contexts.put(key, context);
- context.setEnvironment(this);
defaultSearchOrderList.add(key);
defaultSearchOrder = null;
}
Modified: pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/env/ExecutionContext.java
===================================================================
--- pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/env/ExecutionContext.java 2008-07-08 07:50:10 UTC (rev 1537)
+++ pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/env/ExecutionContext.java 2008-07-08 07:59:44 UTC (rev 1538)
@@ -25,7 +25,6 @@
import org.jbpm.pvm.Execution;
import org.jbpm.pvm.env.Context;
-import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.internal.model.ExecutionImpl;
public class ExecutionContext implements Context {
@@ -60,7 +59,4 @@
public <T> T get(Class<T> type) {
return null;
}
-
- public void setEnvironment(Environment environment) {
- }
}
Modified: pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/env/JobContext.java
===================================================================
--- pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/env/JobContext.java 2008-07-08 07:50:10 UTC (rev 1537)
+++ pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/env/JobContext.java 2008-07-08 07:59:44 UTC (rev 1538)
@@ -26,7 +26,6 @@
import java.util.Set;
import org.jbpm.pvm.env.Context;
-import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.internal.job.JobImpl;
public class JobContext implements Context {
@@ -67,9 +66,6 @@
return null;
}
- public void setEnvironment(Environment environment) {
- }
-
public String getName() {
return null;
}
Modified: pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/env/WebRequestContext.java
===================================================================
--- pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/env/WebRequestContext.java 2008-07-08 07:50:10 UTC (rev 1537)
+++ pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/env/WebRequestContext.java 2008-07-08 07:59:44 UTC (rev 1538)
@@ -55,9 +55,6 @@
return null;
}
- public void setEnvironment(Environment environment) {
- }
-
public String getName() {
return null;
}
Modified: pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/env/WebSessionContext.java
===================================================================
--- pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/env/WebSessionContext.java 2008-07-08 07:50:10 UTC (rev 1537)
+++ pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/env/WebSessionContext.java 2008-07-08 07:59:44 UTC (rev 1538)
@@ -24,7 +24,6 @@
import java.util.Set;
import org.jbpm.pvm.env.Context;
-import org.jbpm.pvm.env.Environment;
public class WebSessionContext implements Context {
@@ -55,9 +54,6 @@
return null;
}
- public void setEnvironment(Environment environment) {
- }
-
public String getName() {
return null;
}
Modified: pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/spring/SpringEnvironment.java
===================================================================
--- pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/spring/SpringEnvironment.java 2008-07-08 07:50:10 UTC (rev 1537)
+++ pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/spring/SpringEnvironment.java 2008-07-08 07:59:44 UTC (rev 1538)
@@ -64,7 +64,6 @@
public void addContext(Context context) {
String key = context.getName();
contexts.put(key, context);
- context.setEnvironment(this);
defaultSearchOrderList.add(key);
defaultSearchOrder = null;
}
Modified: pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/spring/SpringEnvironmentContext.java
===================================================================
--- pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/spring/SpringEnvironmentContext.java 2008-07-08 07:50:10 UTC (rev 1537)
+++ pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/spring/SpringEnvironmentContext.java 2008-07-08 07:59:44 UTC (rev 1538)
@@ -95,7 +95,4 @@
public Object set(String key, Object value) {
return null;
}
-
- public void setEnvironment(Environment environment) {
- }
}
Modified: pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/spring/SpringEnvironmentFactory.java
===================================================================
--- pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/spring/SpringEnvironmentFactory.java 2008-07-08 07:50:10 UTC (rev 1537)
+++ pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/spring/SpringEnvironmentFactory.java 2008-07-08 07:59:44 UTC (rev 1538)
@@ -24,12 +24,10 @@
import java.util.HashSet;
import java.util.Set;
-import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.env.EnvironmentFactory;
import org.jbpm.pvm.internal.util.ReflectUtil;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
-import org.springframework.context.support.ClassPathXmlApplicationContext;
/** this environment factory will see only the singleton beans.
*
@@ -96,7 +94,4 @@
public Object set(String key, Object value) {
return null;
}
-
- public void setEnvironment(Environment environment) {
- }
}
Modified: pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java
===================================================================
--- pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java 2008-07-08 07:50:10 UTC (rev 1537)
+++ pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/WireContext.java 2008-07-08 07:59:44 UTC (rev 1538)
@@ -206,7 +206,6 @@
// member fields ////////////////////////////////////////////////////////////
protected String name = "wire-context";
- protected Environment environment;
protected EnvironmentFactory environmentFactory;
protected transient ClassLoader classLoader;
protected WireDefinition wireDefinition;
@@ -257,7 +256,6 @@
this.wireDefinition = wireDefinition;
this.name = name;
this.classLoader = (wireDefinition!=null ? wireDefinition.getClassLoader() : null);
- this.environment = environment;
if (environment!=null) {
this.environmentFactory = environment.getEnvironmentFactory();
}
@@ -302,16 +300,6 @@
}
}
- /**
- * <p>invoked (with a non-null argument) by the environment when this context is added.</p>
- * <p>When the context is removed from the environment, this method will be called again with the null value.
- * In this case, the {@link #close()} method is called to close the context.</p>
- * @see Context#setEnvironment(Environment)
- */
- public void setEnvironment(Environment environment) {
- this.environment = environment;
- }
-
public String toString() {
return (name!=null ? name : super.toString());
}
@@ -436,6 +424,7 @@
}
// then check if we can find it in the environment (if one is available)
+ Environment environment = Environment.getCurrent();
if (environment!=null) {
log.trace("delivering "+objectName+" from environment");
return environment.get(objectName);
@@ -747,9 +736,6 @@
public void setWireDefinition(WireDefinition wireDefinition) {
this.wireDefinition = wireDefinition;
}
- public Environment getEnvironment() {
- return environment;
- }
public EnvironmentFactory getEnvironmentFactory() {
return environmentFactory;
}
Modified: pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/EnterpriseTransactionDescriptor.java
===================================================================
--- pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/EnterpriseTransactionDescriptor.java 2008-07-08 07:50:10 UTC (rev 1537)
+++ pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/EnterpriseTransactionDescriptor.java 2008-07-08 07:59:44 UTC (rev 1538)
@@ -39,7 +39,7 @@
boolean manage;
public Object construct(WireContext wireContext) {
- Environment environment = wireContext.getEnvironment();
+ Environment environment = Environment.getCurrent();
if (environment==null) {
throw new WireException("enterprise transaction requires environment");
}
Modified: pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/EnvironmentDescriptor.java
===================================================================
--- pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/EnvironmentDescriptor.java 2008-07-08 07:50:10 UTC (rev 1537)
+++ pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/EnvironmentDescriptor.java 2008-07-08 07:59:44 UTC (rev 1538)
@@ -1,5 +1,6 @@
package org.jbpm.pvm.internal.wire.descriptor;
+import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.internal.wire.Descriptor;
import org.jbpm.pvm.internal.wire.WireContext;
@@ -17,6 +18,6 @@
private static final long serialVersionUID = 1L;
public Object construct(WireContext wireContext) {
- return wireContext.getEnvironment();
+ return Environment.getCurrent();
}
}
Modified: pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/EnvironmentTypeRefDescriptor.java
===================================================================
--- pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/EnvironmentTypeRefDescriptor.java 2008-07-08 07:50:10 UTC (rev 1537)
+++ pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/EnvironmentTypeRefDescriptor.java 2008-07-08 07:59:44 UTC (rev 1538)
@@ -44,7 +44,7 @@
public Object construct(WireContext wireContext) {
log.trace("looking up "+type+" by type in environment");
if (type!=null) {
- Environment environment = wireContext.getEnvironment();
+ Environment environment = Environment.getCurrent();
if (environment==null) {
throw new WireException("no environment to search an object of type "+type.getName());
}
Modified: pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateSessionDescriptor.java
===================================================================
--- pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateSessionDescriptor.java 2008-07-08 07:50:10 UTC (rev 1537)
+++ pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/HibernateSessionDescriptor.java 2008-07-08 07:59:44 UTC (rev 1538)
@@ -55,7 +55,7 @@
if (factoryName!=null) {
sessionFactory = (SessionFactory) wireContext.get(factoryName);
} else {
- Environment environment = wireContext.getEnvironment();
+ Environment environment = Environment.getCurrent();
if (environment!=null) {
sessionFactory = environment.get(SessionFactory.class);
} else {
Modified: pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java
===================================================================
--- pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java 2008-07-08 07:50:10 UTC (rev 1537)
+++ pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/ObjectDescriptor.java 2008-07-08 07:59:44 UTC (rev 1538)
@@ -8,6 +8,7 @@
import java.util.List;
import org.jbpm.pvm.PvmException;
+import org.jbpm.pvm.env.Environment;
import org.jbpm.pvm.internal.log.Log;
import org.jbpm.pvm.internal.util.ArrayUtil;
import org.jbpm.pvm.internal.util.ReflectUtil;
@@ -269,7 +270,7 @@
Object autoWireValue = null;
if ("environment".equals(fieldName)) {
- autoWireValue = wireContext.getEnvironment();
+ autoWireValue = Environment.getCurrent();
} else if ( ("context".equals(fieldName))
|| ("wireContext".equals(fieldName))
@@ -277,7 +278,7 @@
autoWireValue = wireContext;
} else if ("environmentFactory".equals(fieldName)) {
- autoWireValue = wireContext.getEnvironment().getEnvironmentFactory();
+ autoWireValue = Environment.getCurrent().getEnvironmentFactory();
} else if (wireContext.has(fieldName)) {
autoWireValue = wireContext.get(fieldName);
Modified: pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/StandardTransactionDescriptor.java
===================================================================
--- pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/StandardTransactionDescriptor.java 2008-07-08 07:50:10 UTC (rev 1537)
+++ pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/descriptor/StandardTransactionDescriptor.java 2008-07-08 07:59:44 UTC (rev 1538)
@@ -36,7 +36,7 @@
public Object construct(WireContext wireContext) {
StandardTransaction standardTransaction = new StandardTransaction();
- Environment environment = wireContext.getEnvironment();
+ Environment environment = Environment.getCurrent();
if (environment==null) {
throw new WireException("standard transaction requires environment");
}
Modified: pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/operation/EnlistOperation.java
===================================================================
--- pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/operation/EnlistOperation.java 2008-07-08 07:50:10 UTC (rev 1537)
+++ pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/operation/EnlistOperation.java 2008-07-08 07:59:44 UTC (rev 1538)
@@ -42,7 +42,7 @@
if (transactionName!=null) {
object = wireContext.get(transactionName);
} else {
- object = wireContext.getEnvironment().get(Transaction.class);
+ object = wireContext.get(Transaction.class);
}
if ( (object==null)
Modified: pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/operation/SubscribeOperation.java
===================================================================
--- pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/operation/SubscribeOperation.java 2008-07-08 07:50:10 UTC (rev 1537)
+++ pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/internal/wire/operation/SubscribeOperation.java 2008-07-08 07:59:44 UTC (rev 1538)
@@ -77,7 +77,7 @@
// identify the wireContext
WireContext wireContext = null;
if (contextName!=null) {
- Environment environment = targetWireContext.getEnvironment();
+ Environment environment = Environment.getCurrent();
if (environment!=null) {
try {
wireContext = (WireContext) environment.getContext(contextName);
Modified: pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/spring2/PojoEnvironment.java
===================================================================
--- pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/spring2/PojoEnvironment.java 2008-07-08 07:50:10 UTC (rev 1537)
+++ pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/spring2/PojoEnvironment.java 2008-07-08 07:59:44 UTC (rev 1538)
@@ -21,7 +21,6 @@
*/
package org.jbpm.pvm.spring2;
-import java.util.Arrays;
import java.util.Map;
import org.jbpm.pvm.env.Context;
Modified: pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/spring2/SimpleContext.java
===================================================================
--- pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/spring2/SimpleContext.java 2008-07-08 07:50:10 UTC (rev 1537)
+++ pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/spring2/SimpleContext.java 2008-07-08 07:59:44 UTC (rev 1538)
@@ -37,7 +37,6 @@
private Map<String, Object> internalContext;
private Map<Class, Object> internalContextByClass;
private String name;
- private Environment environment;
public Object get(String key) {
return getInternalContext().get(key);
@@ -63,10 +62,6 @@
getInternalContextByClass().put(value.getClass(), value);
return getInternalContext().put(key, value);
}
-
- public void setEnvironment(Environment environment) {
- this.environment = environment;
- }
public void setName(String name) {
this.name = name;
@@ -95,7 +90,4 @@
return internalContextByClass;
}
- public Environment getEnvironment() {
- return environment;
- }
}
Modified: pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/spring2/SpringPojoEnvironmentFactory.java
===================================================================
--- pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/spring2/SpringPojoEnvironmentFactory.java 2008-07-08 07:50:10 UTC (rev 1537)
+++ pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/spring2/SpringPojoEnvironmentFactory.java 2008-07-08 07:59:44 UTC (rev 1538)
@@ -51,9 +51,6 @@
return environment;
}
- public void setEnvironment(Environment environment) {
- }
-
public String getName() {
return null;
}
Modified: pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/spring2/pvm-beans.xml
===================================================================
--- pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/spring2/pvm-beans.xml 2008-07-08 07:50:10 UTC (rev 1537)
+++ pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/spring2/pvm-beans.xml 2008-07-08 07:59:44 UTC (rev 1538)
@@ -4,7 +4,7 @@
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">
- <bean id="environment" class="org.jbpm.pvm.internal.spring2.PojoEnvironment">
+ <bean id="environment" class="org.jbpm.pvm.spring2.PojoEnvironment">
<property name="contexts">
<map>
<entry key="environment-block" value-ref="environmentContext"/>
@@ -12,7 +12,7 @@
</property>
</bean>
- <bean id="environmentContext" class="org.jbpm.pvm.internal.spring2.PersistenceSimpleContext">
+ <bean id="environmentContext" class="org.jbpm.pvm.spring2.PersistenceSimpleContext">
<property name="sessionFactory" ref="hibernateSessionFactory"/>
</bean>
15 years, 10 months
JBoss JBPM SVN: r1537 - pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/model.
by do-not-reply@jboss.org
Author: porcherg
Date: 2008-07-08 03:50:10 -0400 (Tue, 08 Jul 2008)
New Revision: 1537
Modified:
pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/model/ProcessFactory.java
Log:
small javadoc correction (node() must be called before initial())
Modified: pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/model/ProcessFactory.java
===================================================================
--- pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/model/ProcessFactory.java 2008-07-08 07:47:21 UTC (rev 1536)
+++ pvm/trunk/modules/core/src/main/java/org/jbpm/pvm/model/ProcessFactory.java 2008-07-08 07:50:10 UTC (rev 1537)
@@ -61,7 +61,7 @@
* </p>
* <pre>
* ProcessDefinition processDefinition = ProcessFactory.build()
- * .initial().behaviour(new WaitState())
+ * .node().initial().behaviour(new WaitState())
* .transition("normal").to("a")
* .transition("shortcut").to("c")
* .node("a").behaviour(new WaitState())
15 years, 10 months
JBoss JBPM SVN: r1536 - pvm/trunk/modules/core/src/test/java/org/jbpm/svc/jobexecutor.
by do-not-reply@jboss.org
Author: porcherg
Date: 2008-07-08 03:47:21 -0400 (Tue, 08 Jul 2008)
New Revision: 1536
Modified:
pvm/trunk/modules/core/src/test/java/org/jbpm/svc/jobexecutor/ContinuationTest.hbm.xml
Log:
fix extends in mapping
Modified: pvm/trunk/modules/core/src/test/java/org/jbpm/svc/jobexecutor/ContinuationTest.hbm.xml
===================================================================
--- pvm/trunk/modules/core/src/test/java/org/jbpm/svc/jobexecutor/ContinuationTest.hbm.xml 2008-07-08 07:45:46 UTC (rev 1535)
+++ pvm/trunk/modules/core/src/test/java/org/jbpm/svc/jobexecutor/ContinuationTest.hbm.xml 2008-07-08 07:47:21 UTC (rev 1536)
@@ -15,8 +15,8 @@
<discriminator type="string" />
<version name="dbversion" column="DBVERSION_" />
- <subclass name="AutomaticActivity" extends="org.jbpm.pvm.NodeBehaviour" discriminator-value="A" />
- <subclass name="WaitState" extends="org.jbpm.pvm.NodeBehaviour" discriminator-value="W" />
+ <subclass name="AutomaticActivity" discriminator-value="A" />
+ <subclass name="WaitState" discriminator-value="W" />
</class>
15 years, 10 months
JBoss JBPM SVN: r1535 - in pvm/trunk/modules/core/src/test: resources/org/jbpm/pvm and 2 other directories.
by do-not-reply@jboss.org
Author: porcherg
Date: 2008-07-08 03:45:46 -0400 (Tue, 08 Jul 2008)
New Revision: 1535
Added:
pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/internal/
pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/internal/type/
pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/internal/type/environment.cfg.xml
Modified:
pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/type/VariableAutoTypeResolutionTest.java
Log:
fix VariableTypeResoltution test
Modified: pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/type/VariableAutoTypeResolutionTest.java
===================================================================
--- pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/type/VariableAutoTypeResolutionTest.java 2008-07-08 07:26:19 UTC (rev 1534)
+++ pvm/trunk/modules/core/src/test/java/org/jbpm/pvm/internal/type/VariableAutoTypeResolutionTest.java 2008-07-08 07:45:46 UTC (rev 1535)
@@ -29,25 +29,40 @@
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.List;
+import java.util.Map;
-import org.jbpm.pvm.test.base.EnvironmentTestCase;
+import org.jbpm.pvm.activity.ActivityExecution;
+import org.jbpm.pvm.activity.ExternalActivity;
import org.jbpm.pvm.internal.model.ExecutionImpl;
-import org.jbpm.pvm.internal.type.Variable;
import org.jbpm.pvm.internal.type.variable.BlobVariable;
import org.jbpm.pvm.internal.type.variable.ClobVariable;
import org.jbpm.pvm.internal.type.variable.DoubleVariable;
import org.jbpm.pvm.internal.type.variable.LongVariable;
import org.jbpm.pvm.internal.type.variable.StringVariable;
import org.jbpm.pvm.model.ProcessFactory;
+import org.jbpm.pvm.test.base.EnvironmentTestCase;
/**
* @author Tom Baeyens
*/
public class VariableAutoTypeResolutionTest extends EnvironmentTestCase
{
-
+ public static class WaitState implements ExternalActivity {
+ private static final long serialVersionUID = 1L;
+ public void execute(ActivityExecution execution) {
+ execution.waitForSignal();
+ }
+ public void signal(ActivityExecution execution, String signalName, Map<String, Object> parameters) {
+ execution.take(signalName);
+ }
+ }
+
+
public void testStringVariable() {
- ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build().done().beginProcessInstance();
+ ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build()
+ .node().initial().behaviour(WaitState.class)
+ .done()
+ .beginProcessInstance();
execution.setVariable("v", "hello");
Variable variable = execution.getVariableObject("v");
@@ -60,7 +75,10 @@
}
public void testLongVariable() {
- ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build().done().beginProcessInstance();
+ ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build()
+ .node().initial().behaviour(WaitState.class)
+ .done()
+ .beginProcessInstance();
execution.setVariable("v", new Long(5));
Variable variable = execution.getVariableObject("v");
@@ -72,7 +90,10 @@
}
public void testDoubleVariable() {
- ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build().done().beginProcessInstance();
+ ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build()
+ .node().initial().behaviour(WaitState.class)
+ .done()
+ .beginProcessInstance();
execution.setVariable("v", new Double(5.5));
Variable variable = execution.getVariableObject("v");
@@ -84,7 +105,10 @@
}
public void testDateVariable() {
- ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build().done().beginProcessInstance();
+ ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build()
+ .node().initial().behaviour(WaitState.class)
+ .done()
+ .beginProcessInstance();
Calendar calendar = new GregorianCalendar();
calendar.set(Calendar.YEAR, 2007);
@@ -106,7 +130,10 @@
}
public void testBooleanVariable() {
- ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build().done().beginProcessInstance();
+ ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build()
+ .node().initial().behaviour(WaitState.class)
+ .done()
+ .beginProcessInstance();
execution.setVariable("affirmative", Boolean.TRUE);
execution.setVariable("negative", Boolean.FALSE);
@@ -125,7 +152,10 @@
}
public void testCharacterVariable() {
- ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build().done().beginProcessInstance();
+ ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build()
+ .node().initial().behaviour(WaitState.class)
+ .done()
+ .beginProcessInstance();
execution.setVariable("v", new Character('c'));
@@ -138,7 +168,10 @@
}
public void testByteVariable() {
- ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build().done().beginProcessInstance();
+ ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build()
+ .node().initial().behaviour(WaitState.class)
+ .done()
+ .beginProcessInstance();
execution.setVariable("v", new Byte((byte)78));
@@ -151,7 +184,10 @@
}
public void testShortVariable() {
- ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build().done().beginProcessInstance();
+ ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build()
+ .node().initial().behaviour(WaitState.class)
+ .done()
+ .beginProcessInstance();
execution.setVariable("v", new Short((short)78));
@@ -164,7 +200,10 @@
}
public void testIntegerVariable() {
- ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build().done().beginProcessInstance();
+ ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build()
+ .node().initial().behaviour(WaitState.class)
+ .done()
+ .beginProcessInstance();
execution.setVariable("v", new Integer(78));
@@ -177,7 +216,10 @@
}
public void testFloatVariable() {
- ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build().done().beginProcessInstance();
+ ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build()
+ .node().initial().behaviour(WaitState.class)
+ .done()
+ .beginProcessInstance();
execution.setVariable("v", new Float(78.65));
@@ -190,7 +232,10 @@
}
public void testBytesVariable() {
- ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build().done().beginProcessInstance();
+ ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build()
+ .node().initial().behaviour(WaitState.class)
+ .done()
+ .beginProcessInstance();
byte[] bytes = generateBytes();
execution.setVariable("v", bytes);
@@ -213,7 +258,10 @@
}
public void testCharsVariable() {
- ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build().done().beginProcessInstance();
+ ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build()
+ .node().initial().behaviour(WaitState.class)
+ .done()
+ .beginProcessInstance();
char[] chars = generateChars();
execution.setVariable("v", chars);
@@ -245,7 +293,10 @@
}
public void testSerializableVariable() {
- ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build().done().beginProcessInstance();
+ ExecutionImpl execution = (ExecutionImpl) ProcessFactory.build()
+ .node().initial().behaviour(WaitState.class)
+ .done()
+ .beginProcessInstance();
TestSerializable testSerializable = new TestSerializable(76);
execution.setVariable("v", testSerializable);
Added: pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/internal/type/environment.cfg.xml
===================================================================
--- pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/internal/type/environment.cfg.xml (rev 0)
+++ pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/internal/type/environment.cfg.xml 2008-07-08 07:45:46 UTC (rev 1535)
@@ -0,0 +1,10 @@
+<contexts>
+
+ <environment-factory>
+ <variable-types resource="org/jbpm/pvm/pvm.types.xml" />
+ </environment-factory>
+
+ <environment>
+ </environment>
+
+</contexts>
Property changes on: pvm/trunk/modules/core/src/test/resources/org/jbpm/pvm/internal/type/environment.cfg.xml
___________________________________________________________________
Name: svn:keywords
+ Id
15 years, 10 months