[seam-commits] Seam SVN: r15212 - in branches/enterprise/WFK-2_1: bom and 29 other directories.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Mon Oct 8 08:31:59 EDT 2012
Author: manaRH
Date: 2012-10-08 08:31:58 -0400 (Mon, 08 Oct 2012)
New Revision: 15212
Removed:
branches/enterprise/WFK-2_1/jboss-seam-ui/src/main/java/org/jboss/seam/ui/component/UITaskId.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/pageflow/Page.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/pageflow/Pageflow.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/pageflow/package-info.java
Modified:
branches/enterprise/WFK-2_1/bom/pom.xml
branches/enterprise/WFK-2_1/examples/drools/drools-ear/pom.xml
branches/enterprise/WFK-2_1/examples/drools/drools-tests/pom.xml
branches/enterprise/WFK-2_1/examples/drools/drools-tests/src/test/java/org/jboss/seam/example/numberguess/test/DroolsNumberGuessTest.java
branches/enterprise/WFK-2_1/examples/pom.xml
branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/pom.xml
branches/enterprise/WFK-2_1/jboss-seam-ioc/pom.xml
branches/enterprise/WFK-2_1/jboss-seam-ui/pom.xml
branches/enterprise/WFK-2_1/jboss-seam-ui/src/main/java/org/jboss/seam/ui/component/UISeamCommandBase.java
branches/enterprise/WFK-2_1/jboss-seam/pom.xml
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/async/Asynchronous.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/Actor.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/BusinessProcess.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/BusinessProcessInterceptor.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/Jbpm.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/JbpmELResolver.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/ManagedJbpmContext.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/PageflowDeploymentHandler.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/PageflowParser.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/PooledTask.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/PooledTaskInstanceList.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/ProcessInstance.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/ProcessInstanceFinder.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/SeamExpressionEvaluator.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/SeamUserCodeInterceptor.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/TaskInstance.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/TaskInstanceList.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/TaskInstanceListForType.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/TaskInstancePriorityList.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/Transition.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/jbpm.pageflow.cfg.xml
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/cache/AbstractJBossCacheProvider.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/cache/JbossCache2Provider.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/cache/JbossCacheProvider.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/cache/JbossPojoCacheProvider.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/BusinessProcessContext.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/Contexts.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/FacesLifecycle.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/Lifecycle.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/ServletLifecycle.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/TestLifecycle.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/ConversationInterceptor.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/ConversationalInterceptor.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/EventInterceptor.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/Init.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/Manager.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/drools/DroolsActionHandler.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/drools/DroolsAssignmentHandler.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/drools/DroolsDecisionHandler.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/drools/DroolsHandler.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/faces/FacesManager.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/faces/FacesPage.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/framework/BusinessProcessController.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/init/Initialization.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/AgentID.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/DefaultExceptionHandler.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/JBossClusterMonitor.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/JMXInvocationHandler.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/MBeanProxy.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/MBeanProxyCreationException.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/Mbean.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/ProxyContext.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/ProxyExceptionHandler.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/RuntimeProxyException.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jsf/SeamNavigationHandler.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jsf/SeamPhaseListener.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/mock/AbstractSeamTest.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/ConversationControl.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/Page.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/Pages.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/ProcessControl.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/Rule.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/TaskControl.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/servlet/SeamListener.java
branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/transaction/TransactionInterceptor.java
branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/PageflowConfigurationTest.java
branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/PageflowTest.java
branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/bpm/ActorTest.java
branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/bpm/JbpmTest.java
branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/bpm/TaskListTest.java
branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/testng.xml
branches/enterprise/WFK-2_1/pom.xml
branches/enterprise/WFK-2_1/seam-integration-tests/pom.xml
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/bpm/SeamExpressionEvaluatorTest.java
branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/bpm/SeamExpressionEvaluatorTestController.java
Log:
removed jbpm integration
Modified: branches/enterprise/WFK-2_1/bom/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/bom/pom.xml 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/bom/pom.xml 2012-10-08 12:31:58 UTC (rev 15212)
@@ -35,7 +35,7 @@
<version.drools>5.3.3.Final</version.drools>
<version.resteasy>2.3.3.Final-redhat-1</version.resteasy>
<version.spring>3.1.1.RELEASE</version.spring>
- <version.jbossas7>7.1.2.Final-redhat-1</version.jbossas7>
+ <version.jbossas7>7.1.1.Final</version.jbossas7>
<version.jsf2>2.1.7-redhat-1</version.jsf2>
<version.webdriver>0.9.7376</version.webdriver>
<version.infinispan>5.1.3.FINAL</version.infinispan>
@@ -732,7 +732,7 @@
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
- <version>1.6.1-brew</version>
+ <version>1.6.1-redhat-1</version>
<exclusions>
<exclusion>
<groupId>xml-apis</groupId>
Modified: branches/enterprise/WFK-2_1/examples/drools/drools-ear/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/drools/drools-ear/pom.xml 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/examples/drools/drools-ear/pom.xml 2012-10-08 12:31:58 UTC (rev 15212)
@@ -35,28 +35,6 @@
<artifactId>jboss-seam</artifactId>
<type>ejb</type>
</dependency>
- <dependency>
- <groupId>org.jbpm.jbpm3</groupId>
- <artifactId>jbpm-jpdl</artifactId>
- <exclusions>
- <exclusion>
- <artifactId>jackrabbit-core</artifactId>
- <groupId>org.apache.jackrabbit</groupId>
- </exclusion>
- <exclusion>
- <artifactId>cglib</artifactId>
- <groupId>cglib</groupId>
- </exclusion>
- <exclusion>
- <artifactId>hibernate-ehcache</artifactId>
- <groupId>org.hibernate</groupId>
- </exclusion>
- <exclusion>
- <artifactId>dom4j</artifactId>
- <groupId>dom4j</groupId>
- </exclusion>
- </exclusions>
- </dependency>
</dependencies>
<build>
Modified: branches/enterprise/WFK-2_1/examples/drools/drools-tests/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/drools/drools-tests/pom.xml 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/examples/drools/drools-tests/pom.xml 2012-10-08 12:31:58 UTC (rev 15212)
@@ -69,10 +69,6 @@
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.jbpm.jbpm3</groupId>
- <artifactId>jbpm-jpdl</artifactId>
- </dependency>
</dependencies>
<build>
Modified: branches/enterprise/WFK-2_1/examples/drools/drools-tests/src/test/java/org/jboss/seam/example/numberguess/test/DroolsNumberGuessTest.java
===================================================================
--- branches/enterprise/WFK-2_1/examples/drools/drools-tests/src/test/java/org/jboss/seam/example/numberguess/test/DroolsNumberGuessTest.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/examples/drools/drools-tests/src/test/java/org/jboss/seam/example/numberguess/test/DroolsNumberGuessTest.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -11,7 +11,7 @@
import org.jboss.seam.example.numberguess.Guess;
import org.jboss.seam.example.numberguess.RandomNumber;
import org.jboss.seam.mock.JUnitSeamTest;
-import org.jboss.seam.pageflow.Pageflow;
+//import org.jboss.seam.pageflow.Pageflow;
import org.jboss.shrinkwrap.api.Archive;
import org.jboss.shrinkwrap.api.ShrinkWrap;
import org.jboss.shrinkwrap.api.importer.ZipImporter;
@@ -58,8 +58,8 @@
assert guess.getValue()==null;
assert game.getGuessCount()==0;
assert Manager.instance().isLongRunningConversation();
- assert Pageflow.instance().getProcessInstance().getRootToken()
- .getNode().getName().equals("displayGuess");
+ //assert Pageflow.instance().getProcessInstance().getRootToken()
+// .getNode().getName().equals("displayGuess");
}
}.run();
@@ -102,8 +102,8 @@
assert guess.getValue().equals(guessedValue);
assert game.getGuessCount()==1;
assert Manager.instance().isLongRunningConversation();
- assert Pageflow.instance().getProcessInstance().getRootToken()
- .getNode().getName().equals("displayGuess");
+// assert Pageflow.instance().getProcessInstance().getRootToken()
+// .getNode().getName().equals("displayGuess");
}
}.run();
@@ -123,9 +123,9 @@
Guess guess = (Guess) getInstance(Guess.class);
setOutcome("guess");
assert guess.getValue().equals(getRandomNumber());
- assert Pageflow.instance().getProcessInstance().getRootToken()
- .getNode().getName().equals("displayGuess");
- //ng.guess();
+// assert Pageflow.instance().getProcessInstance().getRootToken()
+// .getNode().getName().equals("displayGuess");
+// //ng.guess();
}
@Override
@@ -148,8 +148,8 @@
assert guess.getValue().equals(getRandomNumber());
assert game.getGuessCount()==2;
assert !Manager.instance().isLongRunningConversation();
- assert Pageflow.instance().getProcessInstance().getRootToken()
- .getNode().getName().equals("win");
+// assert Pageflow.instance().getProcessInstance().getRootToken()
+// .getNode().getName().equals("win");
}
}.run();
@@ -219,8 +219,8 @@
assert guess.getValue().equals(guessedValue);
assert game.getGuessCount()==count;
assert Manager.instance().isLongRunningConversation();
- assert Pageflow.instance().getProcessInstance().getRootToken()
- .getNode().getName().equals("displayGuess");
+ //assert Pageflow.instance().getProcessInstance().getRootToken()
+ // .getNode().getName().equals("displayGuess");
}
}.run();
@@ -241,8 +241,8 @@
protected void invokeApplication() throws Exception {
setOutcome("guess");
//ng.guess();
- assert Pageflow.instance().getProcessInstance().getRootToken()
- .getNode().getName().equals("displayGuess");
+// assert Pageflow.instance().getProcessInstance().getRootToken()
+// .getNode().getName().equals("displayGuess");
}
@Override
@@ -266,8 +266,8 @@
assert guess.getValue().equals(guessedValue);
assert game.getGuessCount()==10;
assert !Manager.instance().isLongRunningConversation();
- assert Pageflow.instance().getProcessInstance().getRootToken()
- .getNode().getName().equals("lose");
+// assert Pageflow.instance().getProcessInstance().getRootToken()
+// .getNode().getName().equals("lose");
}
}.run();
Modified: branches/enterprise/WFK-2_1/examples/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/pom.xml 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/examples/pom.xml 2012-10-08 12:31:58 UTC (rev 15212)
@@ -49,7 +49,7 @@
the test phase) -->
<tests.excludedGroups>slow</tests.excludedGroups>
<guava.version>12.0</guava.version>
- <richfaces.version>4.2.2.Final</richfaces.version>
+ <richfaces.version>4.2.3.Final-redhat-1</richfaces.version>
<slf4j.version>1.6.1</slf4j.version>
<version.jbossas7>7.1.1.Final</version.jbossas7>
@@ -188,7 +188,7 @@
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
- <version>7.1.1.Final</version>
+ <version>${version.jbossas7}</version>
<executions>
<execution>
<phase></phase>
@@ -277,26 +277,7 @@
<version>${slf4j.version}</version>
</dependency>
-
- <!-- <dependency>
- <groupId>org.metawidget</groupId>
- <artifactId>metawidget-backend</artifactId>
- <version>0.95</version>
- </dependency>
-
<dependency>
- <groupId>org.metawidget</groupId>
- <artifactId>metawidget-frontend</artifactId>
- <version>0.95</version>
- </dependency>
-
- <dependency>
- <groupId>org.metawidget</groupId>
- <artifactId>metawidget</artifactId>
- <version>0.95</version>
- </dependency>-->
-
- <dependency>
<groupId>org.apache.myfaces.trinidad</groupId>
<artifactId>trinidad-api</artifactId>
<version>2.0.1</version>
Modified: branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/pom.xml 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/examples/seambay/seambay-ejb/pom.xml 2012-10-08 12:31:58 UTC (rev 15212)
@@ -50,36 +50,6 @@
<scope>provided</scope>
</dependency>
<dependency>
- <groupId>org.jbpm.jbpm3</groupId>
- <artifactId>jbpm-jpdl</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.apache.jackrabbit</groupId>
- <artifactId>jackrabbit-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>dom4j</groupId>
- <artifactId>dom4j</artifactId>
- </exclusion>
- <exclusion>
- <groupId>cglib</groupId>
- <artifactId>cglib</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-api</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.slf4j</groupId>
- <artifactId>slf4j-log4j12</artifactId>
- </exclusion>
- <exclusion>
- <artifactId>hibernate-ehcache</artifactId>
- <groupId>org.hibernate</groupId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
<groupId>org.jboss.seam</groupId>
<artifactId>jboss-seam-remoting</artifactId>
</dependency>
Modified: branches/enterprise/WFK-2_1/jboss-seam/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/pom.xml 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/pom.xml 2012-10-08 12:31:58 UTC (rev 15212)
@@ -252,8 +252,6 @@
<optional>true</optional>
</dependency>
-
-
<dependency>
<groupId>antlr</groupId>
<artifactId>antlr</artifactId>
@@ -320,12 +318,6 @@
</dependency>
<dependency>
- <groupId>org.jbpm.jbpm3</groupId>
- <artifactId>jbpm-jpdl</artifactId>
- <optional>true</optional>
- </dependency>
-
- <dependency>
<groupId>org.beanshell</groupId>
<artifactId>bsh</artifactId>
<optional>true</optional>
@@ -356,18 +348,11 @@
</dependency>
<dependency>
- <groupId>oswego-concurrent</groupId>
- <artifactId>concurrent</artifactId>
- <optional>true</optional>
- </dependency>
-
- <dependency>
<groupId>org.openid4java</groupId>
<artifactId>openid4java-consumer</artifactId>
<type>pom</type>
<optional>true</optional>
</dependency>
-
<dependency>
<groupId>org.jboss.spec.javax.faces</groupId>
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/async/Asynchronous.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/async/Asynchronous.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/async/Asynchronous.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -2,7 +2,7 @@
import java.io.Serializable;
-import org.jboss.seam.bpm.BusinessProcess;
+//import org.jboss.seam.bpm.BusinessProcess;
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.contexts.Lifecycle;
import org.jboss.seam.core.Init;
@@ -31,9 +31,9 @@
{
if ( Init.instance().isJbpmInstalled() )
{
- BusinessProcess businessProcess = BusinessProcess.instance();
- processId = businessProcess.getProcessId();
- taskId = BusinessProcess.instance().getTaskId();
+// BusinessProcess businessProcess = BusinessProcess.instance();
+// processId = businessProcess.getProcessId();
+// taskId = BusinessProcess.instance().getTaskId();
}
}
@@ -55,11 +55,11 @@
Contexts.getEventContext().set(AbstractDispatcher.EXECUTING_ASYNCHRONOUS_CALL, true);
if (taskId!=null)
{
- BusinessProcess.instance().resumeTask(taskId);
+ //BusinessProcess.instance().resumeTask(taskId);
}
else if (processId!=null)
{
- BusinessProcess.instance().resumeProcess(processId);
+ //BusinessProcess.instance().resumeProcess(processId);
}
if (timer!=null)
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/Actor.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/Actor.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/Actor.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,115 +0,0 @@
-package org.jboss.seam.bpm;
-
-import static org.jboss.seam.annotations.Install.BUILT_IN;
-
-import java.io.Serializable;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.jboss.seam.Component;
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.contexts.Contexts;
-import org.jboss.seam.core.AbstractMutable;
-
-/**
- * Allows the application to specify the jBPM actorId
- * during the login cycle.
- *
- * @author Gavin King
- */
- at Name("org.jboss.seam.bpm.actor")
- at Scope(ScopeType.SESSION)
- at BypassInterceptors
- at Install(dependencies="org.jboss.seam.bpm.jbpm", precedence=BUILT_IN)
-public class Actor extends AbstractMutable implements Serializable
-{
- private static final long serialVersionUID = -6515302276074415520L;
- private String id;
- private Set<String> groupActorIds = new HashSet<String>()
- {
- @Override
- public boolean add(String o)
- {
- boolean dirty = super.add(o);
- if (dirty) setDirty();
- return dirty;
- }
-
- @Override
- public void clear()
- {
- if (size() > 0) setDirty();
- super.clear();
- }
-
- @Override
- public boolean remove(Object o)
- {
- boolean dirty = super.remove(o);
- if (dirty) setDirty();
- return dirty;
- }
-
- @Override
- public Iterator<String> iterator()
- {
- final Iterator<String> it = super.iterator();
- return new Iterator<String>()
- {
-
- public boolean hasNext()
- {
- return it.hasNext();
- }
-
- public String next()
- {
- return it.next();
- }
-
- public void remove()
- {
- setDirty();
- it.remove();
- }
-
- };
- }
- };
-
- public String getId()
- {
- return id;
- }
- public void setId(String id)
- {
- setDirty(this.id, id);
- this.id = id;
- }
-
- public Set<String> getGroupActorIds()
- {
- return groupActorIds;
- }
- public static Actor instance()
- {
- if ( !Contexts.isSessionContextActive() )
- {
- throw new IllegalStateException("No active session context");
- }
- return (Actor) Component.getInstance(Actor.class);
- }
-
- @Override
- public String toString()
- {
- return "Actor(" + id + ")";
- }
-}
-
-
\ No newline at end of file
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/BusinessProcess.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/BusinessProcess.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/BusinessProcess.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,431 +0,0 @@
-package org.jboss.seam.bpm;
-
-import static org.jboss.seam.annotations.Install.BUILT_IN;
-
-import java.io.Serializable;
-
-import org.jboss.seam.Component;
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.contexts.Contexts;
-import org.jboss.seam.core.AbstractMutable;
-import org.jboss.seam.core.Events;
-import org.jboss.seam.international.StatusMessage;
-import org.jboss.seam.international.StatusMessages;
-import org.jbpm.graph.def.ProcessDefinition;
-import org.jbpm.graph.exe.ProcessInstance;
-import org.jbpm.taskmgmt.exe.TaskInstance;
-
-/**
- * Holds the task and process ids for the current conversation,
- * and provides programmatic control over the business process.
- *
- * @author Gavin King
- *
- */
- at Scope(ScopeType.CONVERSATION)
- at Name("org.jboss.seam.bpm.businessProcess")
- at BypassInterceptors
- at Install(dependencies="org.jboss.seam.bpm.jbpm", precedence=BUILT_IN)
-public class BusinessProcess extends AbstractMutable implements Serializable
-{
-
- private static final long serialVersionUID = 4722350870845851070L;
- private Long processId;
- private Long taskId;
-
- public static BusinessProcess instance()
- {
- if ( !Contexts.isConversationContextActive() )
- {
- throw new IllegalStateException("No active conversation context");
- }
- return (BusinessProcess) Component.getInstance(BusinessProcess.class, ScopeType.CONVERSATION);
- }
-
- /**
- * Is there a process instance associated with
- * the current conversation?
- */
- public boolean hasCurrentProcess()
- {
- return processId!=null;
- }
-
- /**
- * Is there a process instance that has not ended
- * associated with the current conversation?
- */
- public boolean hasActiveProcess()
- {
- return hasCurrentProcess() &&
- !org.jboss.seam.bpm.ProcessInstance.instance().hasEnded();
- }
-
- /**
- * Is there a task instance associated with
- * the current conversation?
- */
- public boolean hasCurrentTask()
- {
- return taskId!=null;
- }
-
- /**
- * The jBPM process instance id associated with
- * the current conversation.
- */
- public Long getProcessId()
- {
- return processId;
- }
-
- /**
- * Set the process instance id, without validating
- * that the process instance actually exists.
- */
- public void setProcessId(Long processId)
- {
- setDirty(this.processId, processId);
- this.processId = processId;
- }
-
- /**
- * The jBPM task instance id associated with
- * the current conversation.
- */
- public Long getTaskId()
- {
- return taskId;
- }
-
- /**
- * Set the task instance id, without validating
- * that the task instance actually exists.
- */
- public void setTaskId(Long taskId)
- {
- setDirty(this.taskId, taskId);
- this.taskId = taskId;
- }
-
- /**
- * Create a process instance and associate it with the
- * current conversation.
- *
- * @param processDefinitionName the jBPM process definition name
- */
- public void createProcess(String processDefinitionName)
- {
- createProcess(processDefinitionName, true);
- }
-
- /**
- * Create a process instance and associate it with the
- * current conversation.
- *
- * @param processDefinitionName the jBPM process definition name
- */
- public void createProcess(String processDefinitionName, boolean shouldSignalProcess)
- {
- ProcessInstance process = ManagedJbpmContext.instance().newProcessInstanceForUpdate(processDefinitionName);
- afterCreateProcess(processDefinitionName, process, shouldSignalProcess);
- }
-
- /**
- * Create a process instance and associate it with the
- * current conversation.
- *
- * @param processDefinitionName the jBPM process definition name
- * @param businessKey the business key of the new process definition
- */
- public void createProcess(String processDefinitionName, String businessKey)
- {
- /*ProcessInstance process = ManagedJbpmContext.instance().getGraphSession()
- .findLatestProcessDefinition(processDefinitionName)
- .createProcessInstance(Collections.EMPTY_MAP, businessKey);*/
- ProcessInstance process = ManagedJbpmContext.instance().newProcessInstanceForUpdate(processDefinitionName);
- process.setKey(businessKey);
- afterCreateProcess(processDefinitionName, process, true);
- }
-
- private void afterCreateProcess(String processDefinitionName, ProcessInstance process, boolean shouldSignalProcess)
- {
- setProcessId( process.getId() );
- // need to set process variables before the signal
- Contexts.getBusinessProcessContext().flush();
- if (shouldSignalProcess) {
- process.signal();
- }
-
- Events.instance().raiseEvent("org.jboss.seam.createProcess." + processDefinitionName);
- }
-
- /**
- * Start the current task, using the current actor id
- *
- * @see Actor
- */
- public void startTask()
- {
- String actorId = Actor.instance().getId();
- TaskInstance task = org.jboss.seam.bpm.TaskInstance.instance();
- if ( actorId != null )
- {
- task.start(actorId);
- }
- else
- {
- task.start();
- }
-
- Events.instance().raiseEvent("org.jboss.seam.startTask." + task.getTask().getName());
- }
-
- /**
- * End the current task, via the given transition. If no transition name
- * is given, check the Transition component for a transition, or use the
- * default transition.
- *
- * @param transitionName the jBPM transition name, or null
- */
- public void endTask(String transitionName)
- {
- TaskInstance task = org.jboss.seam.bpm.TaskInstance.instance();
- if (task==null)
- {
- throw new IllegalStateException( "no task instance associated with context" );
- }
-
- if ( transitionName==null || "".equals(transitionName) )
- {
- transitionName = Transition.instance().getName();
- }
-
- if (transitionName==null)
- {
- task.end();
- }
- else
- {
- task.end(transitionName);
- }
-
- setTaskId(null); //TODO: do I really need this???!
-
- Events.instance().raiseEvent("org.jboss.seam.endTask." + task.getTask().getName());
- ProcessInstance process = org.jboss.seam.bpm.ProcessInstance.instance();
- if ( process.hasEnded() )
- {
- Events.instance().raiseEvent("org.jboss.seam.endProcess." + process.getProcessDefinition().getName());
- }
- }
-
- /**
- * Signal the given transition for the current process instance.
- *
- * @param transitionName the jBPM transition name
- */
- public void transition(String transitionName)
- {
- ProcessInstance process = org.jboss.seam.bpm.ProcessInstance.instance();
- process.signal(transitionName);
- if ( process.hasEnded() )
- {
- Events.instance().raiseEvent("org.jboss.seam.endProcess." + process.getProcessDefinition().getName());
- }
- }
-
- /**
- * Associate the task instance with the given id with the current
- * conversation.
- *
- * @param taskId the jBPM task instance id
- * @return true if the task was found and was not ended
- */
- public boolean resumeTask(Long taskId)
- {
- setTaskId(taskId);
- TaskInstance task = org.jboss.seam.bpm.TaskInstance.instance();
- if (task==null)
- {
- taskNotFound(taskId);
- return false;
- }
- else if ( task.hasEnded() )
- {
- taskEnded(taskId);
- return false;
- }
- else
- {
- setProcessId( task.getTaskMgmtInstance().getProcessInstance().getId() );
- Events.instance().raiseEvent("org.jboss.seam.initTask." + task.getTask().getName());
- return true;
- }
- }
-
- /**
- * Associate the process instance with the given id with the
- * current conversation.
- *
- * @param processId the jBPM process instance id
- * @return true if the process was found and was not ended
- */
- public boolean resumeProcess(Long processId)
- {
- setProcessId(processId);
- ProcessInstance process = org.jboss.seam.bpm.ProcessInstance.instance();
- return afterResumeProcess(processId, process);
- }
-
- /**
- * Associate the process instance with the given business key
- * with the current conversation.
- *
- * @param processDefinition the jBPM process definition name
- * @param key the jBPM process instance key
- * @return true if the process was found and was not ended
- */
- public boolean resumeProcess(String processDefinition, String key)
- {
- ProcessDefinition definition = ManagedJbpmContext.instance().getGraphSession().findLatestProcessDefinition(processDefinition);
- ProcessInstance process = definition==null ?
- null : ManagedJbpmContext.instance().getProcessInstanceForUpdate(definition, key);
- if (process!=null) setProcessId( process.getId() );
- return afterResumeProcess(key, process);
- }
-
- private boolean afterResumeProcess(long processId, ProcessInstance process)
- {
- if ( process==null )
- {
- processNotFound(processId);
- return false;
- }
- else if ( process.hasEnded() )
- {
- processEnded(processId);
- return false;
- }
- else
- {
- Events.instance().raiseEvent("org.jboss.seam.initProcess." + process.getProcessDefinition().getName());
- return true;
- }
- }
-
- private boolean afterResumeProcess(String processKey, ProcessInstance process)
- {
- if ( process==null )
- {
- processNotFound(processKey);
- return false;
- }
- else if ( process.hasEnded() )
- {
- processEnded(processKey);
- return false;
- }
- else
- {
- Events.instance().raiseEvent("org.jboss.seam.initProcess." + process.getProcessDefinition().getName());
- return true;
- }
- }
-
- /**
- * Check that the task currently associated with the conversation
- * exists and has not ended.
- *
- * @return true if the task exists and was not ended
- */
- public boolean validateTask()
- {
- if ( !hasCurrentTask() )
- {
- taskNotFound(taskId);
- return false;
- }
- else if ( org.jboss.seam.bpm.TaskInstance.instance().hasEnded() )
- {
- taskEnded(taskId);
- return false;
- }
- else
- {
- return true;
- }
- }
-
- protected void taskNotFound(Long taskId)
- {
- StatusMessages.instance().addFromResourceBundleOrDefault(
- StatusMessage.Severity.WARN,
- "org.jboss.seam.TaskNotFound",
- "Task #0 not found",
- taskId
- );
- }
-
- protected void taskEnded(Long taskId)
- {
- StatusMessages.instance().addFromResourceBundleOrDefault(
- StatusMessage.Severity.WARN,
- "org.jboss.seam.TaskEnded",
- "Task #0 already ended",
- taskId
- );
- }
-
- protected void processEnded(Long processId)
- {
- StatusMessages.instance().addFromResourceBundleOrDefault(
- StatusMessage.Severity.WARN,
- "org.jboss.seam.ProcessEnded",
- "Process #0 already ended",
- processId
- );
- }
-
- protected void processNotFound(Long processId)
- {
- StatusMessages.instance().addFromResourceBundleOrDefault(
- StatusMessage.Severity.WARN,
- "org.jboss.seam.ProcessNotFound",
- "Process #0 not found",
- processId
- );
- }
-
- protected void processEnded(String key)
- {
- StatusMessages.instance().addFromResourceBundleOrDefault(
- StatusMessage.Severity.WARN,
- "org.jboss.seam.ProcessEnded",
- "Process #0 already ended",
- key
- );
- }
-
- protected void processNotFound(String key)
- {
- StatusMessages.instance().addFromResourceBundleOrDefault(
- StatusMessage.Severity.WARN,
- "org.jboss.seam.ProcessNotFound",
- "Process #0 not found",
- key
- );
- }
-
-
- @Override
- public String toString()
- {
- return "BusinessProcess(processId=" + processId + ",taskId=" + taskId + ")";
- }
-
-}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/BusinessProcessInterceptor.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/BusinessProcessInterceptor.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/BusinessProcessInterceptor.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,182 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.seam.bpm;
-
-import java.lang.reflect.Method;
-
-import org.jboss.seam.annotations.bpm.BeginTask;
-import org.jboss.seam.annotations.bpm.CreateProcess;
-import org.jboss.seam.annotations.bpm.EndTask;
-import org.jboss.seam.annotations.bpm.ResumeProcess;
-import org.jboss.seam.annotations.bpm.StartTask;
-import org.jboss.seam.annotations.intercept.AroundInvoke;
-import org.jboss.seam.annotations.intercept.Interceptor;
-import org.jboss.seam.contexts.Contexts;
-import org.jboss.seam.core.BijectionInterceptor;
-import org.jboss.seam.core.Expressions;
-import org.jboss.seam.core.Init;
-import org.jboss.seam.intercept.AbstractInterceptor;
-import org.jboss.seam.intercept.InvocationContext;
-import org.jboss.seam.log.LogProvider;
-import org.jboss.seam.log.Logging;
-import org.jboss.seam.util.Strings;
-import org.jboss.seam.web.Parameters;
-
-/**
- * Implements annotation-based business-process demarcation.
- *
- * @author <a href="mailto:steve at hibernate.org">Steve Ebersole</a>
- * @author Gavin King
- */
- at Interceptor(stateless=true, around=BijectionInterceptor.class)
-public class BusinessProcessInterceptor extends AbstractInterceptor
-{
- private static final long serialVersionUID = 758197867958840918L;
-
- private static final LogProvider log = Logging.getLogProvider( BusinessProcessInterceptor.class );
-
- @AroundInvoke
- public Object aroundInvoke(InvocationContext invocation) throws Exception
- {
- if ( !beforeInvocation(invocation) )
- {
- return null;
- }
- else
- {
- return afterInvocation( invocation, invocation.proceed() );
- }
- }
-
- private boolean beforeInvocation(InvocationContext invocationContext)
- {
- Method method = invocationContext.getMethod();
- if ( method.isAnnotationPresent(StartTask.class) )
- {
- log.trace( "encountered @StartTask" );
- StartTask tag = method.getAnnotation(StartTask.class);
- Long taskId = getProcessOrTaskId( tag.taskIdParameter(), tag.taskId() );
- return BusinessProcess.instance().resumeTask(taskId);
- }
- else if ( method.isAnnotationPresent(BeginTask.class) )
- {
- log.trace( "encountered @BeginTask" );
- BeginTask tag = method.getAnnotation(BeginTask.class);
- Long taskId = getProcessOrTaskId( tag.taskIdParameter(), tag.taskId() );
- return BusinessProcess.instance().resumeTask(taskId);
- }
- else if ( method.isAnnotationPresent(ResumeProcess.class) )
- {
- log.trace( "encountered @ResumeProcess" );
- ResumeProcess tag = method.getAnnotation(ResumeProcess.class);
- if ( tag.processKey().equals("") )
- {
- Long processId = getProcessOrTaskId( tag.processIdParameter(), tag.processId() );
- return BusinessProcess.instance().resumeProcess(processId);
- }
- else
- {
- return BusinessProcess.instance().resumeProcess( tag.definition(), getProcessKey( tag.processKey() ) );
- }
- }
- if ( method.isAnnotationPresent(EndTask.class) )
- {
- log.trace( "encountered @EndTask" );
- return BusinessProcess.instance().validateTask();
- }
- else
- {
- return true;
- }
- }
-
- private Object afterInvocation(InvocationContext invocation, Object result)
- {
- Method method = invocation.getMethod();
- if ( result!=null || method.getReturnType().equals(void.class) ) //interpreted as "redisplay"
- {
- if ( method.isAnnotationPresent(CreateProcess.class) )
- {
- log.trace( "encountered @CreateProcess" );
- CreateProcess tag = method.getAnnotation(CreateProcess.class);
- if ( tag.processKey().equals("") )
- {
- BusinessProcess.instance().createProcess( tag.definition() );
- }
- else
- {
- BusinessProcess.instance().createProcess( tag.definition(), getProcessKey( tag.processKey() ) );
- }
- }
- if ( method.isAnnotationPresent(StartTask.class) )
- {
- log.trace( "encountered @StartTask" );
- BusinessProcess.instance().startTask();
- }
- if ( method.isAnnotationPresent(EndTask.class) )
- {
- log.trace( "encountered @EndTask" );
- BusinessProcess.instance().endTask( method.getAnnotation(EndTask.class).transition() );
- }
- if ( method.isAnnotationPresent(org.jboss.seam.annotations.bpm.Transition.class) )
- {
- log.trace( "encountered @Transition" );
- String transitionName = method.getAnnotation(org.jboss.seam.annotations.bpm.Transition.class).value();
- if ( "".equals(transitionName) ) transitionName = method.getName();
- BusinessProcess.instance().transition(transitionName);
- }
- }
- return result;
- }
-
- private String getProcessKey(String el)
- {
- Object key = Expressions.instance().createValueExpression(el).getValue();
- if (key==null)
- {
- throw new IllegalStateException("process business key may not be null");
- }
- return key.toString();
- }
-
- private Long getProcessOrTaskId(String paramName, String el)
- {
- Object id;
- if ( Strings.isEmpty(paramName) )
- {
- id = Expressions.instance().createValueExpression(el).getValue();
- }
- else
- {
- String[] values = Parameters.instance().getRequestParameters().get(paramName);
- id = values!=null && values.length==1 ? values[0] : null;
- }
-
- if (id==null)
- {
- throw new IllegalStateException("task/process id may not be null");
- }
- else if (id instanceof Long)
- {
- return (Long) id;
- }
- else if (id instanceof String)
- {
- return new Long( (String) id );
- }
- else
- {
- throw new IllegalArgumentException("task/process id must be a string or long");
- }
- }
-
- public boolean isInterceptorEnabled()
- {
- return Contexts.isApplicationContextActive() && Init.instance().isJbpmInstalled();
- }
-
-}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/Jbpm.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/Jbpm.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/Jbpm.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,394 +0,0 @@
-package org.jboss.seam.bpm;
-
-import static org.jboss.seam.annotations.Install.BUILT_IN;
-
-import java.io.InputStream;
-import java.io.Reader;
-import java.io.StringReader;
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.LinkedHashSet;
-import java.util.Map;
-import java.util.Properties;
-import java.util.Set;
-
-import javax.naming.NamingException;
-
-import org.dom4j.Element;
-import org.hibernate.HibernateException;
-import org.hibernate.cfg.Environment;
-import org.jboss.seam.Component;
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Create;
-import org.jboss.seam.annotations.Destroy;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.Startup;
-import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.contexts.Contexts;
-import org.jboss.seam.core.Init;
-import org.jboss.seam.core.ResourceLoader;
-import org.jboss.seam.deployment.DeploymentStrategy;
-import org.jboss.seam.deployment.FileDescriptor;
-import org.jboss.seam.deployment.StandardDeploymentStrategy;
-import org.jboss.seam.log.LogProvider;
-import org.jboss.seam.log.Logging;
-import org.jboss.seam.util.Naming;
-import org.jboss.seam.util.Resources;
-import org.jbpm.JbpmConfiguration;
-import org.jbpm.JbpmContext;
-import org.jbpm.graph.def.ProcessDefinition;
-import org.jbpm.graph.node.DbSubProcessResolver;
-import org.jbpm.graph.node.ProcessState;
-import org.jbpm.graph.node.SubProcessResolver;
-import org.jbpm.instantiation.UserCodeInterceptorConfig;
-import org.jbpm.jpdl.JpdlException;
-import org.jbpm.jpdl.el.impl.JbpmExpressionEvaluator;
-import org.jbpm.persistence.db.DbPersistenceServiceFactory;
-import org.xml.sax.InputSource;
-
-/**
- * A seam component that boostraps a JBPM SessionFactory
- *
- * @author Gavin King
- * @author <a href="mailto:steve at hibernate.org">Steve Ebersole</a>
- * @author Norman Richards
- * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
- */
- at Scope(ScopeType.APPLICATION)
- at BypassInterceptors
- at Startup
- at Name("org.jboss.seam.bpm.jbpm")
- at Install(value=false, precedence=BUILT_IN)
-public class Jbpm
-{
- private static final LogProvider log = Logging.getLogProvider(Jbpm.class);
-
- private JbpmConfiguration jbpmConfiguration;
- private String jbpmConfigurationJndiName;
- private String[] processDefinitions;
- private String[] pageflowDefinitions;
- private Map<String, ProcessDefinition> pageflowProcessDefinitions = new HashMap<String, ProcessDefinition>();
-
- @Create
- public void startup() throws Exception
- {
- log.debug( "Starting jBPM" );
- ProcessState.setDefaultSubProcessResolver( new SeamSubProcessResolver() );
- installProcessDefinitions();
- installPageflowDefinitions();
- //JbpmExpressionEvaluator.setVariableResolver( new SeamVariableResolver() );
- //JbpmExpressionEvaluator.setFunctionMapper( new SeamFunctionMapper() );
- JbpmExpressionEvaluator.setExpressionEvaluator( new SeamExpressionEvaluator() );
- UserCodeInterceptorConfig.setUserCodeInterceptor( new SeamUserCodeInterceptor() );
- }
-
- @Destroy
- public void shutdown()
- {
- if (jbpmConfiguration!=null)
- {
- jbpmConfiguration.close();
- }
- }
-
- public JbpmConfiguration getJbpmConfiguration()
- {
- if (jbpmConfiguration==null)
- {
- initJbpmConfiguration();
- }
- return jbpmConfiguration;
- }
-
- private void initJbpmConfiguration()
- {
- if (jbpmConfigurationJndiName==null)
- {
- jbpmConfiguration = JbpmConfiguration.getInstance();
- }
- else
- {
- try
- {
- jbpmConfiguration = (JbpmConfiguration) Naming.getInitialContext().lookup(jbpmConfigurationJndiName);
- }
- catch (NamingException ne)
- {
- throw new IllegalArgumentException("JbpmConfiguration not found in JNDI", ne);
- }
- }
-
- DbPersistenceServiceFactory dbpsf = (DbPersistenceServiceFactory) jbpmConfiguration.getServiceFactory("persistence");
- if (Naming.getInitialContextProperties()!=null)
- {
- // Prefix regular JNDI properties for Hibernate
- Hashtable<String, String> hash = Naming.getInitialContextProperties();
- Properties prefixed = new Properties();
- for (Map.Entry<String, String> entry: hash.entrySet() )
- {
- prefixed.setProperty( Environment.JNDI_PREFIX + "." + entry.getKey(), entry.getValue() );
- }
-
- try
- {
- dbpsf.getConfiguration().getProperties().putAll(prefixed);
- }
- catch (HibernateException he)
- {
- log.warn("could not set JNDI properties for jBPM persistence: " + he.getMessage());
- }
- }
- }
-
- public ProcessDefinition getPageflowProcessDefinition(String pageflowName)
- {
- return pageflowProcessDefinitions.get(pageflowName);
- }
-
- public boolean isPageflowProcessDefinition(String pageflowName)
- {
- return pageflowProcessDefinitions.containsKey(pageflowName);
- }
-
- public static ProcessDefinition getPageflowDefinitionFromResource(String resourceName)
- {
- InputStream resource = ResourceLoader.instance().getResourceAsStream(resourceName);
- if (resource==null)
- {
- throw new IllegalArgumentException("pageflow resource not found: " + resourceName);
- }
- try
- {
- return Jbpm.parseInputSource( new InputSource(resource) );
- }
- catch (JpdlException e)
- {
- throw new JpdlException("Unable to parse process definition " + resourceName, e);
- } finally {
- Resources.closeStream(resource);
- }
- }
-
- public ProcessDefinition getProcessDefinitionFromResource(String resourceName)
- {
- InputStream resource = ResourceLoader.instance().getResourceAsStream(resourceName);
- if (resource==null)
- {
- throw new IllegalArgumentException("process definition resource not found: " + resourceName);
- }
-
- try {
- return ProcessDefinition.parseXmlInputStream(resource);
- } finally {
- Resources.closeStream(resource);
- }
- }
-
- public String[] getPageflowDefinitions()
- {
- return pageflowDefinitions;
- }
-
- public void setPageflowDefinitions(String[] pageflowDefinitions)
- {
- this.pageflowDefinitions = pageflowDefinitions;
- }
-
- public String[] getProcessDefinitions()
- {
- return processDefinitions;
- }
-
- public void setProcessDefinitions(String[] processDefinitions)
- {
- this.processDefinitions = processDefinitions;
- }
-
- /**
- * Dynamically deploy a page flow definition, if a pageflow with an
- * identical name already exists, the pageflow is updated.
- *
- * @return true if the pageflow definition has been updated
- */
- public boolean deployPageflowDefinition(ProcessDefinition pageflowDefinition)
- {
- return pageflowProcessDefinitions.put( pageflowDefinition.getName(), pageflowDefinition )!=null;
- }
-
- /**
- * Read a pageflow definition
- *
- * @param pageflowDefinition the pageflow as an XML string
- */
- public ProcessDefinition getPageflowDefinitionFromXml(String pageflowDefinition)
- {
- Reader reader = null;
- try {
- reader = new StringReader(pageflowDefinition);
- //stream = new ReaderInputStream(new StringReader(pageflowDefinition));
- return Jbpm.parseReaderSource(reader);
- } finally {
- Resources.closeReader(reader);
- }
- }
-
- /**
- * Read a process definition
- *
- * @param processDefinition the process as an XML string
- */
- public ProcessDefinition getProcessDefinitionFromXml(String processDefinition)
- {
- //InputStream stream = null;
- Reader reader = null;
- try {
- //stream = new ReaderInputStream(new StringReader(processDefinition));
- reader = new StringReader(processDefinition);
- return ProcessDefinition.parseXmlReader(reader);
- } finally {
- Resources.closeReader(reader);
- }
- }
-
- /**
- * Remove a pageflow definition
- *
- * @param pageflowName Name of the pageflow to remove
- * @return true if the pageflow definition has been removed
- */
- public boolean undeployPageflowDefinition(String pageflowName)
- {
- return pageflowProcessDefinitions.remove(pageflowName)!=null;
- }
-
- private void installPageflowDefinitions() {
- Set<String> mergedPageflowDefinitions = new LinkedHashSet<String>();
- if ( pageflowDefinitions!=null )
- {
- mergedPageflowDefinitions.addAll(Arrays.asList(pageflowDefinitions));
- }
-
- for (FileDescriptor fileDescriptor : ((PageflowDeploymentHandler) ((DeploymentStrategy) Contexts.getEventContext().get(StandardDeploymentStrategy.NAME)).getDeploymentHandlers().get(PageflowDeploymentHandler.NAME)).getResources())
- {
- mergedPageflowDefinitions.add(fileDescriptor.getName());
- }
-
- for (String pageflow: mergedPageflowDefinitions)
- {
- ProcessDefinition pd = getPageflowDefinitionFromResource(pageflow);
- pageflowProcessDefinitions.put( pd.getName(), pd );
- }
- }
-
- private void installProcessDefinitions()
- {
- if ( isProcessDeploymentEnabled() )
- {
- JbpmContext jbpmContext = getJbpmConfiguration().createJbpmContext();
- try
- {
- if (processDefinitions!=null)
- {
- for ( String definitionResource : processDefinitions )
- {
- deployProcess(jbpmContext, definitionResource);
- }
- }
- }
- catch (RuntimeException e)
- {
- throw new RuntimeException("could not deploy a process definition", e);
- }
- finally
- {
- jbpmContext.close();
- }
- }
- }
-
- private void deployProcess(JbpmContext jbpmContext, String definitionResource)
- {
- ProcessDefinition processDefinition = ProcessDefinition.parseXmlResource(definitionResource);
- if (log.isDebugEnabled())
- {
- log.debug( "deploying process definition : " + processDefinition.getName() );
- }
- jbpmContext.deployProcessDefinition(processDefinition);
- }
-
- protected boolean isProcessDeploymentEnabled()
- {
- return processDefinitions!=null && processDefinitions.length>0;
- }
-
- public static Jbpm instance()
- {
- if ( !Contexts.isApplicationContextActive() )
- {
- throw new IllegalStateException("No application context active");
- }
- if ( !Init.instance().isJbpmInstalled() )
- {
- throw new IllegalStateException("jBPM support is not installed (use components.xml to install it)");
- }
- return (Jbpm) Component.getInstance(Jbpm.class, ScopeType.APPLICATION);
- }
-
- protected String getJbpmConfigurationJndiName()
- {
- return jbpmConfigurationJndiName;
- }
-
- protected void setJbpmConfigurationJndiName(String jbpmConfigurationJndiName)
- {
- this.jbpmConfigurationJndiName = jbpmConfigurationJndiName;
- }
-
- public static JbpmConfiguration pageflowConfiguration = JbpmConfiguration.parseResource("org/jboss/seam/bpm/jbpm.pageflow.cfg.xml");
-
- public static JbpmContext createPageflowContext()
- {
- return pageflowConfiguration.createJbpmContext();
- }
-
- public static ProcessDefinition parseInputSource(InputSource inputSource)
- {
- JbpmContext jbpmContext = createPageflowContext();
- try
- {
- return new PageflowParser(inputSource).readProcessDefinition();
- }
- finally
- {
- jbpmContext.close();
- }
- }
-
- public static ProcessDefinition parseReaderSource(Reader reader)
- {
- JbpmContext jbpmContext = createPageflowContext();
- try
- {
- return new PageflowParser(reader).readProcessDefinition();
- }
- finally
- {
- jbpmContext.close();
- }
- }
-
- private static final DbSubProcessResolver DB_SUB_PROCESS_RESOLVER = new DbSubProcessResolver();
- class SeamSubProcessResolver implements SubProcessResolver
- {
- public ProcessDefinition findSubProcess(Element element)
- {
- String subProcessName = element.attributeValue("name");
- ProcessDefinition pageflow = pageflowProcessDefinitions.get(subProcessName);
- return pageflow==null ? DB_SUB_PROCESS_RESOLVER.findSubProcess(element) : pageflow;
- }
- }
-
-}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/JbpmELResolver.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/JbpmELResolver.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/JbpmELResolver.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,70 +0,0 @@
-package org.jboss.seam.bpm;
-
-import java.beans.FeatureDescriptor;
-import java.util.Iterator;
-
-import javax.el.ELContext;
-import javax.el.ELResolver;
-
-import org.jbpm.jpdl.el.VariableResolver;
-
-/**
- * Resolves jBPM variables for Unified EL
- *
- * @author Gavin King
- *
- */
-final class JbpmELResolver extends ELResolver
-{
- private final VariableResolver resolver;
-
- JbpmELResolver(VariableResolver resolver)
- {
- this.resolver = resolver;
- }
-
- @Override
- public Object getValue(ELContext context, Object base, Object property)
- {
- if ( base==null && property!=null )
- {
- context.setPropertyResolved(true);
- return resolver.resolveVariable( (String) property );
- }
- else
- {
- return null;
- }
- }
-
- @Override
- public boolean isReadOnly(ELContext context, Object base, Object property)
- {
- return true;
- }
-
- @Override
- public Class<?> getCommonPropertyType(ELContext context, Object base)
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context, Object base)
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public Class<?> getType(ELContext context, Object base, Object property)
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public void setValue(ELContext context, Object base, Object property, Object value)
- {
- throw new UnsupportedOperationException();
- }
-
-}
\ No newline at end of file
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/ManagedJbpmContext.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/ManagedJbpmContext.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/ManagedJbpmContext.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,168 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.seam.bpm;
-
-import static org.jboss.seam.annotations.Install.BUILT_IN;
-
-import javax.naming.NamingException;
-import javax.transaction.RollbackException;
-import javax.transaction.Synchronization;
-import javax.transaction.SystemException;
-
-import org.jboss.seam.Component;
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Create;
-import org.jboss.seam.annotations.Destroy;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.Unwrap;
-import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.contexts.Contexts;
-import org.jboss.seam.contexts.Lifecycle;
-import org.jboss.seam.log.LogProvider;
-import org.jboss.seam.log.Logging;
-import org.jboss.seam.transaction.Transaction;
-import org.jboss.seam.transaction.UserTransaction;
-import org.jbpm.JbpmContext;
-import org.jbpm.persistence.db.DbPersistenceServiceFactory;
-import org.jbpm.svc.Services;
-
-/**
- * Manages a reference to a JbpmContext.
- *
- * @author <a href="mailto:steve at hibernate.org">Steve Ebersole</a>
- * @author Gavin King
- */
- at Scope(ScopeType.EVENT)
- at Name("org.jboss.seam.bpm.jbpmContext")
- at BypassInterceptors
- at Install(precedence=BUILT_IN, dependencies="org.jboss.seam.bpm.jbpm")
-public class ManagedJbpmContext implements Synchronization
-{
- private static final LogProvider log = Logging.getLogProvider(ManagedJbpmContext.class);
-
- private JbpmContext jbpmContext;
- private boolean synchronizationRegistered;
-
- @Create
- public void create() throws NamingException, RollbackException, SystemException
- {
- jbpmContext = Jbpm.instance().getJbpmConfiguration().createJbpmContext();
- assertNoTransactionManagement();
- log.debug( "created seam managed jBPM context");
- }
-
- private void assertNoTransactionManagement()
- {
- DbPersistenceServiceFactory dpsf = (DbPersistenceServiceFactory) jbpmContext.getJbpmConfiguration()
- .getServiceFactory(Services.SERVICENAME_PERSISTENCE);
- if ( dpsf.isTransactionEnabled() )
- {
- throw new IllegalStateException("jBPM transaction management is enabled, disable in jbpm.cfg.xml");
- }
- }
-
- @Unwrap
- public JbpmContext getJbpmContext() throws NamingException, RollbackException, SystemException
- {
- joinTransaction();
- return jbpmContext;
- }
-
- private void joinTransaction() throws SystemException
- {
- UserTransaction transaction = Transaction.instance();
-
- if ( !transaction.isActiveOrMarkedRollback() )
- {
- throw new IllegalStateException("JbpmContext may only be used inside a transaction");
- }
-
- if ( !synchronizationRegistered && !Lifecycle.isDestroying() && transaction.isActive() )
- {
- jbpmContext.getSession().isOpen();
- try //TODO: what we really want here is if (!cmt)
- {
- transaction.registerSynchronization(this);
- }
- catch (UnsupportedOperationException uoe)
- {
- jbpmContext.getSession().getTransaction().registerSynchronization(this);
- }
- synchronizationRegistered = true;
- }
- }
-
- public void beforeCompletion()
- {
- log.debug( "flushing seam managed jBPM context" );
- /*org.jbpm.graph.exe.ProcessInstance processInstance = ProcessInstance.instance();
- if (processInstance!=null)
- {
- jbpmContext.save(processInstance);
- }*/
- if ( Contexts.isBusinessProcessContextActive() )
- {
- //in requests that come through SeamPhaseListener,
- //transactions are committed before the contexts are
- //destroyed, flush here:
- Contexts.getBusinessProcessContext().flush();
- }
- jbpmContext.getSession().flush();
- log.debug( "done flushing seam managed jBPM context" );
- }
-
- public void afterCompletion(int status)
- {
- synchronizationRegistered = false;
- if ( !Contexts.isEventContextActive() )
- {
- //in calls to MDBs and remote calls to SBs, the
- //transaction doesn't commit until after contexts
- //are destroyed, so wait until the transaction
- //completes before closing the session
- //on the other hand, if we still have an active
- //event context, leave it open
- closeContext();
- }
- }
-
- @Destroy
- public void destroy()
- {
- if ( !synchronizationRegistered )
- {
- //in requests that come through SeamPhaseListener,
- //there can be multiple transactions per request,
- //but they are all completed by the time contexts
- //are dstroyed
- //so wait until the end of the request to close
- //the session
- //on the other hand, if we are still waiting for
- //the transaction to commit, leave it open
- closeContext();
- }
- }
-
- private void closeContext()
- {
- log.debug( "destroying seam managed jBPM context" );
- jbpmContext.close();
- log.debug( "done destroying seam managed jBPM context" );
- }
-
- public static JbpmContext instance()
- {
- if ( !Contexts.isEventContextActive() )
- {
- throw new IllegalStateException("no active event context");
- }
- return (JbpmContext) Component.getInstance(ManagedJbpmContext.class, ScopeType.EVENT);
- }
-
-}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/PageflowDeploymentHandler.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/PageflowDeploymentHandler.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/PageflowDeploymentHandler.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,81 +0,0 @@
-package org.jboss.seam.bpm;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.dom4j.DocumentException;
-import org.dom4j.Element;
-import org.jboss.seam.deployment.AbstractDeploymentHandler;
-import org.jboss.seam.deployment.DeploymentMetadata;
-import org.jboss.seam.deployment.FileDescriptor;
-import org.jboss.seam.log.LogProvider;
-import org.jboss.seam.log.Logging;
-import org.jboss.seam.util.Resources;
-import org.jboss.seam.util.XML;
-
-
-public class PageflowDeploymentHandler extends AbstractDeploymentHandler
-{
-
- private static DeploymentMetadata NAMESPACE_METADATA = new DeploymentMetadata()
- {
-
- public String getFileNameSuffix()
- {
- return ".jpdl.xml";
- }
-
- };
-
- private static LogProvider log = Logging.getLogProvider(PageflowDeploymentHandler.class);
-
- public static final String NAME = "org.jboss.seam.bpm.PageflowDeploymentHandler";
-
- public String getName()
- {
- return NAME;
- }
-
- @Override
- public void postProcess(ClassLoader classLoader)
- {
- Set<FileDescriptor> files = new HashSet<FileDescriptor>();
- for (FileDescriptor fileDescriptor : getResources())
- {
- try
- {
- InputStream inputStream = fileDescriptor.getUrl().openStream();
- try
- {
-
- Element root = XML.getRootElementSafely(inputStream);
- if ("pageflow-definition".equals(root.getName()))
- {
- files.add(fileDescriptor);
- }
- }
- catch (DocumentException e)
- {
- log.debug("Unable to parse " + fileDescriptor.getName(), e);
- }
- finally
- {
- Resources.closeStream(inputStream);
- }
- } catch (IOException e)
- {
- log.trace("Error loading " + fileDescriptor.getName());
- }
-
- }
- setResources(files);
- }
-
- public DeploymentMetadata getMetadata()
- {
- return NAMESPACE_METADATA;
- }
-
-}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/PageflowParser.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/PageflowParser.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/PageflowParser.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,65 +0,0 @@
-package org.jboss.seam.bpm;
-
-import java.io.Reader;
-
-import org.dom4j.Element;
-import org.jbpm.graph.def.Node;
-import org.jbpm.graph.def.NodeCollection;
-import org.jbpm.jpdl.xml.JpdlXmlReader;
-import org.jbpm.jpdl.xml.ProblemListener;
-import org.xml.sax.InputSource;
-
-/**
- * A jPDL parser for Seam pageflow definitions
- *
- * @author Tom Baeyens
- *
- */
-public class PageflowParser extends JpdlXmlReader
-{
-
- private static final long serialVersionUID = 1L;
-
- public PageflowParser(InputSource inputSource, ProblemListener problemListener)
- {
- super(inputSource, problemListener);
- }
-
- public PageflowParser(InputSource inputSource)
- {
- super(inputSource);
- }
-
- public PageflowParser(Reader reader)
- {
- super(reader);
- }
-
- @Override
- public void readNodes(Element nodeCollectionElement, NodeCollection nodeCollection)
- {
- super.readNodes(nodeCollectionElement, nodeCollection);
-
- if ( "pageflow-definition".equals( nodeCollectionElement.getName() ) )
- {
- String startPageName = nodeCollectionElement.attributeValue("start-page");
- if (startPageName==null)
- {
- Element startPageElement = nodeCollectionElement.element("start-page");
- if (startPageElement!=null)
- {
- startPageName = startPageElement.attributeValue("name");
- }
- }
- if (startPageName!=null)
- {
- Node startPage = getProcessDefinition().getNode(startPageName);
- if (startPage!=null)
- {
- getProcessDefinition().setStartState(startPage);
- }
- }
- }
- }
-
-}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/PooledTask.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/PooledTask.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/PooledTask.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,120 +0,0 @@
-package org.jboss.seam.bpm;
-
-import static org.jboss.seam.annotations.Install.BUILT_IN;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.Transactional;
-import org.jboss.seam.web.Parameters;
-import org.jbpm.taskmgmt.exe.TaskInstance;
-
-/**
- * Support for assigning tasks in the pooled task list.
- *
- * @see TaskInstanceList
- * @author Gavin King
- */
- at Name("org.jboss.seam.bpm.pooledTask")
- at Scope(ScopeType.APPLICATION)
- at Install(precedence=BUILT_IN, dependencies="org.jboss.seam.bpm.jbpm")
-public class PooledTask
-{
-
- /**
- * Assign the TaskInstance with the id passed
- * in the request parameter named "taskId" to
- * the current actor.
- *
- * @see Actor
- * @return a null outcome only if the task was not found
- */
- @Transactional
- public String assignToCurrentActor()
- {
- Actor actor = Actor.instance();
- if ( actor.getId()==null )
- {
- throw new IllegalStateException("no current actor id defined");
- }
- TaskInstance taskInstance = getTaskInstance();
- if (taskInstance!=null)
- {
- taskInstance.setActorId( actor.getId() );
- return "taskAssignedToActor";
- }
- else
- {
- return null;
- }
- }
-
- /**
- * Assign the TaskInstance with the id passed
- * in the request parameter named "taskId" to
- * the given actor id.
- *
- * @param actorId the jBPM actor id
- * @return a null outcome only if the task was not found
- */
- @Transactional
- public String assign(String actorId)
- {
- TaskInstance taskInstance = getTaskInstance();
- if (taskInstance!=null)
- {
- taskInstance.setActorId(actorId);
- return "taskAssigned";
- }
- else
- {
- return null;
- }
- }
-
- /**
- * Unassign the TaskInstance with the id passed
- * in the request parameter named "taskId" from
- * the actor to which it is assigned, and return
- * it to the pool it came from.
- *
- * @return a null outcome only if the task was not found
- */
- @Transactional
- public String unassign()
- {
- TaskInstance taskInstance = getTaskInstance();
- if (taskInstance!=null)
- {
- taskInstance.setActorId(null);
- return "taskUnassigned";
- }
- else
- {
- return null;
- }
- }
-
- /**
- * @return the TaskInstance with the id passed
- * in the request parameter named "taskId".
- */
- @Transactional
- public TaskInstance getTaskInstance()
- {
- String[] values = Parameters.instance().getRequestParameters().get("taskId");
- if ( values==null || values.length!=1 )
- {
- return null;
- }
- else
- {
- String taskId = values[0];
- return taskId==null ?
- null :
- ManagedJbpmContext.instance().getTaskInstanceForUpdate( Long.parseLong(taskId) );
- }
- }
-
-}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/PooledTaskInstanceList.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/PooledTaskInstanceList.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/PooledTaskInstanceList.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,40 +0,0 @@
-package org.jboss.seam.bpm;
-
-import static org.jboss.seam.annotations.Install.BUILT_IN;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.Transactional;
-import org.jboss.seam.annotations.Unwrap;
-import org.jbpm.taskmgmt.exe.TaskInstance;
-
-/**
- * Support for the pooled task list.
- *
- * @see TaskInstanceList
- * @author Gavin King
- */
- at Name("org.jboss.seam.bpm.pooledTaskInstanceList")
- at Scope(ScopeType.APPLICATION)
- at Install(precedence=BUILT_IN, dependencies="org.jboss.seam.bpm.jbpm")
-public class PooledTaskInstanceList
-{
-
- @Unwrap
- @Transactional
- public List<TaskInstance> getPooledTaskInstanceList()
- {
- Actor actor = Actor.instance();
- String actorId = actor.getId();
- if ( actorId == null ) return null;
- ArrayList groupIds = new ArrayList( actor.getGroupActorIds() );
- groupIds.add(actorId);
- return ManagedJbpmContext.instance().getGroupTaskList(groupIds);
- }
-
-}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/ProcessInstance.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/ProcessInstance.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/ProcessInstance.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,69 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.seam.bpm;
-
-import static org.jboss.seam.annotations.Install.BUILT_IN;
-
-import org.jboss.seam.Component;
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.Unwrap;
-import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.contexts.Contexts;
-import org.jboss.seam.util.Work;
-
-/**
- * A Seam component that allows injection of the current
- * jBPM ProcessInstance.
- *
- * @author Gavin King
- */
- at Scope(ScopeType.STATELESS)
- at Name("org.jboss.seam.bpm.processInstance")
- at BypassInterceptors
- at Install(precedence=BUILT_IN, dependencies="org.jboss.seam.bpm.jbpm")
-public class ProcessInstance
-{
-
- @Unwrap
- public org.jbpm.graph.exe.ProcessInstance getProcessInstance() throws Exception
- {
- if ( !Contexts.isConversationContextActive() ) return null;
-
- return new Work<org.jbpm.graph.exe.ProcessInstance>()
- {
-
- @Override
- protected org.jbpm.graph.exe.ProcessInstance work() throws Exception
- {
- Long processId = BusinessProcess.instance().getProcessId();
- if (processId!=null)
- {
- //TODO: do we need to cache this??
- //return ManagedJbpmContext.instance().getProcessInstanceForUpdate(processId);
- //JBSEAM-4629:
- return ManagedJbpmContext.instance().getProcessInstance(processId);
- }
- else
- {
- return null;
- }
- }
-
- }.workInTransaction();
-
- }
-
- public static org.jbpm.graph.exe.ProcessInstance instance()
- {
- if ( !Contexts.isConversationContextActive() || !BusinessProcess.instance().hasCurrentProcess() ) return null; //so we don't start a txn
-
- return (org.jbpm.graph.exe.ProcessInstance) Component.getInstance(ProcessInstance.class, ScopeType.STATELESS);
- }
-}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/ProcessInstanceFinder.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/ProcessInstanceFinder.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/ProcessInstanceFinder.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,105 +0,0 @@
-package org.jboss.seam.bpm;
-
-import static org.hibernate.criterion.Order.asc;
-import static org.hibernate.criterion.Order.desc;
-import static org.hibernate.criterion.Restrictions.isNotNull;
-import static org.hibernate.criterion.Restrictions.isNull;
-import static org.jboss.seam.annotations.Install.BUILT_IN;
-
-import java.util.List;
-
-import org.hibernate.Criteria;
-import org.hibernate.criterion.Restrictions;
-import org.jboss.seam.annotations.Factory;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Transactional;
-import org.jbpm.graph.exe.ProcessInstance;
-
-/**
- * Support for the process list.
- *
- * @author Gavin King
- */
- at Name("org.jboss.seam.bpm.processInstanceFinder")
- at Install(precedence=BUILT_IN, dependencies="org.jboss.seam.bpm.jbpm")
-public class ProcessInstanceFinder
-{
-
- private String processDefinitionName;
- private String nodeName;
- private Boolean processInstanceEnded = false;
- private Boolean sortDescending = false;
-
- @Factory(value="org.jboss.seam.bpm.processInstanceList", autoCreate=true)
- @Transactional
- public List<ProcessInstance> getProcessInstanceList()
- {
- Criteria query = ManagedJbpmContext.instance().getSession()
- .createCriteria(ProcessInstance.class);
- if ( processInstanceEnded!=null )
- {
- query.add( processInstanceEnded ? isNotNull("end") : isNull("end") );
- }
-
- if (processDefinitionName!=null)
- {
- query.createCriteria("processDefinition")
- .add( Restrictions.eq("name", processDefinitionName) );
- }
-
- query = query.createCriteria("rootToken");
- if (sortDescending!=null)
- {
- query.addOrder( sortDescending ? desc("nodeEnter") : asc("nodeEnter") );
- }
- if (nodeName!=null)
- {
- query.createCriteria("node")
- .add( Restrictions.eq("name", nodeName) );
- }
-
- return query.list();
- }
-
- protected String getNodeName()
- {
- return nodeName;
- }
-
- protected void setNodeName(String nodeName)
- {
- this.nodeName = nodeName;
- }
-
- protected String getProcessDefinitionName()
- {
- return processDefinitionName;
- }
-
- protected void setProcessDefinitionName(String processDefinitionName)
- {
- this.processDefinitionName = processDefinitionName;
- }
-
- protected Boolean isSortDescending()
- {
- return sortDescending;
- }
-
- protected void setSortDescending(Boolean sortDescending)
- {
- this.sortDescending = sortDescending;
- }
-
- protected Boolean getProcessInstanceEnded()
- {
- return processInstanceEnded;
- }
-
- protected void setProcessInstanceEnded(Boolean ended)
- {
- this.processInstanceEnded = ended;
- }
-
-}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/SeamExpressionEvaluator.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/SeamExpressionEvaluator.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/SeamExpressionEvaluator.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,167 +0,0 @@
-package org.jboss.seam.bpm;
-
-
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.el.CompositeELResolver;
-import javax.el.ELContext;
-import javax.el.MethodExpression;
-import javax.el.MethodNotFoundException;
-import javax.el.PropertyNotFoundException;
-import javax.el.ValueExpression;
-
-import org.jboss.seam.el.EL;
-import org.jboss.seam.el.SeamFunctionMapper;
-import org.jboss.seam.log.LogProvider;
-import org.jboss.seam.log.Logging;
-import org.jbpm.jpdl.el.ELException;
-import org.jbpm.jpdl.el.Expression;
-import org.jbpm.jpdl.el.ExpressionEvaluator;
-import org.jbpm.jpdl.el.FunctionMapper;
-import org.jbpm.jpdl.el.VariableResolver;
-
-/**
- * Plugs the JBoss EL expression language and Seam
- * EL resolvers into jBPM. Note that this current
- * implementation does not allow jBPM to see stuff
- * defined only by the JSF ELResolvers.
- *
- * @author Gavin King
- * @author Pete Muir
- *
- */
-public class SeamExpressionEvaluator
- extends ExpressionEvaluator
-{
-
- private static LogProvider log = Logging.getLogProvider(SeamExpressionEvaluator.class);
-
- @Override
- public Object evaluate(String expression, Class returnType, final VariableResolver resolver, FunctionMapper mapper)
- throws ELException
- {
- return createExpression(expression, returnType, mapper).evaluate(resolver);
- }
-
- @Override
- public Expression parseExpression(final String expression, final Class returnType, FunctionMapper mapper)
- throws ELException
- {
- return createExpression(expression, returnType, mapper);
- }
-
- private static Expression createExpression(final String expression, final Class returnType, final FunctionMapper mapper)
- {
-
- return new Expression()
- {
- private ELContext elContext = EL.createELContext();
-
- private MethodExpression me;
- private ValueExpression ve;
-
- private void initMethodExpression()
- {
- if (me == null || ve == null)
- {
- me = EL.EXPRESSION_FACTORY.createMethodExpression(elContext, expression, returnType, new Class[0]);
- }
- }
-
- private void initValueExpression()
- {
- if (me == null || ve == null)
- {
- ve = EL.EXPRESSION_FACTORY.createValueExpression(elContext, expression, returnType);
- }
- }
-
- @Override
- public Object evaluate(VariableResolver resolver) throws ELException
- {
- List<javax.el.ELException> exceptions = new ArrayList<javax.el.ELException>();
- try
- {
- initMethodExpression();
- if (me != null)
- {
- try
- {
- return me.invoke(createELContext(resolver, mapper), new Object[0]);
- }
- catch (MethodNotFoundException e)
- {
- exceptions.add(e);
- }
- }
- }
- catch (javax.el.ELException e)
- {
- exceptions.add(e);
- }
-
- try
- {
- initValueExpression();
- if (ve != null)
- {
- try
- {
- return ve.getValue(createELContext(resolver, mapper));
- }
- catch (PropertyNotFoundException e)
- {
- exceptions.add(e);
- }
- }
- }
- catch (javax.el.ELException e)
- {
- exceptions.add(e);
- }
-
- if (exceptions.size() == 1)
- {
- throw new ELException("Error evaluating " + expression, exceptions.get(0));
- }
- else if (exceptions.size() > 1)
- {
- log.debug("Exceptions occurred when parsing " + expression);
- for (javax.el.ELException e : exceptions)
- {
- log.debug("Possible cause", e);
- }
- }
- if (me == null && ve == null)
- {
- log.debug("Error parsing " + expression);
- throw new ELException("Error parsing " + expression + "; not a valid EL expression");
- }
- throw new ELException("Error evaluating " + expression + "; possible causes are logged at debug level");
- }
- };
- }
-
- private static javax.el.FunctionMapper decorateFunctionMapper(final FunctionMapper functionMapper)
- {
- return new SeamFunctionMapper( new javax.el.FunctionMapper()
- {
- @Override
- public Method resolveFunction(String prefix, String localName)
- {
- return functionMapper.resolveFunction(prefix, localName);
- }
- });
- }
-
- private static ELContext createELContext(VariableResolver resolver, FunctionMapper functionMapper)
- {
- CompositeELResolver composite = new CompositeELResolver();
- composite.add(EL.EL_RESOLVER);
- composite.add( new JbpmELResolver(resolver) );
- return EL.createELContext(composite, decorateFunctionMapper(functionMapper));
- }
-
-}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/SeamUserCodeInterceptor.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/SeamUserCodeInterceptor.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/SeamUserCodeInterceptor.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,153 +0,0 @@
-package org.jboss.seam.bpm;
-
-import org.jboss.seam.contexts.Contexts;
-import org.jboss.seam.contexts.Lifecycle;
-import org.jbpm.context.exe.ContextInstance;
-import org.jbpm.graph.def.Action;
-import org.jbpm.graph.exe.ExecutionContext;
-import org.jbpm.graph.exe.Token;
-import org.jbpm.instantiation.UserCodeInterceptor;
-import org.jbpm.taskmgmt.def.AssignmentHandler;
-import org.jbpm.taskmgmt.def.TaskControllerHandler;
-import org.jbpm.taskmgmt.exe.Assignable;
-import org.jbpm.taskmgmt.exe.TaskInstance;
-
-/**
- * Intercepts calls to user code coming from jBPM, sets up
- * Seam contexts and associates the process and task instances
- * with the contexts.
- *
- * @author Gavin King
- *
- */
-class SeamUserCodeInterceptor implements UserCodeInterceptor
-{
- abstract static class ContextualCall
- {
- abstract void process() throws Exception;
-
- void run() throws Exception
- {
- if ( Contexts.isEventContextActive() || Contexts.isApplicationContextActive() ) //not sure about the second bit (only needed at init time!)
- {
- process();
- }
- else
- {
- Lifecycle.beginCall();
- try
- {
- process();
- }
- finally
- {
- Lifecycle.endCall();
- }
- }
- }
-
- void runAndWrap()
- {
- try
- {
- run();
- }
- catch (RuntimeException re)
- {
- throw re;
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
- }
-
- public void executeAction(final Action action, final ExecutionContext context) throws Exception
- {
- if ( isPageflow(context) )
- {
- action.execute(context);
- }
- else
- {
- new ContextualCall()
- {
- @Override
- void process() throws Exception
- {
- initProcessAndTask(context);
- action.execute(context);
- }
- }.run();
- }
- }
-
- private boolean isPageflow(final ExecutionContext context)
- {
- return Contexts.isConversationContextActive() &&
- Jbpm.instance().isPageflowProcessDefinition( context.getProcessDefinition().getName() );
- }
-
- public void executeAssignment(final AssignmentHandler handler, final Assignable assignable,
- final ExecutionContext context)
- throws Exception
- {
- new ContextualCall()
- {
- @Override
- void process() throws Exception
- {
- initProcessAndTask(context);
- handler.assign(assignable, context);
- }
- }.run();
- }
-
- public void executeTaskControllerInitialization(final TaskControllerHandler handler, final TaskInstance task,
- final ContextInstance context, final Token token)
- {
- new ContextualCall()
- {
- @Override
- void process() throws Exception
- {
- initProcessAndTask(task);
- handler.initializeTaskVariables(task, context, token);
- }
- }.runAndWrap();
- }
-
- public void executeTaskControllerSubmission(final TaskControllerHandler handler, final TaskInstance task,
- final ContextInstance context, final Token token)
- {
- new ContextualCall()
- {
- @Override
- void process() throws Exception
- {
- initProcessAndTask(task);
- handler.submitTaskVariables(task, context, token);
- }
- }.runAndWrap();
- }
-
- private static void initProcessAndTask(ExecutionContext context)
- {
- BusinessProcess businessProcess = BusinessProcess.instance();
- businessProcess.setProcessId( context.getProcessInstance().getId() );
- TaskInstance taskInstance = context.getTaskInstance();
- if (taskInstance!=null)
- {
- businessProcess.setTaskId( taskInstance.getId() );
- }
- }
-
- private static void initProcessAndTask(TaskInstance task)
- {
- BusinessProcess businessProcess = BusinessProcess.instance();
- businessProcess.setProcessId( task.getProcessInstance().getId() );
- businessProcess.setTaskId( task.getId() );
- }
-
-}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/TaskInstance.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/TaskInstance.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/TaskInstance.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.seam.bpm;
-
-import static org.jboss.seam.annotations.Install.BUILT_IN;
-
-import org.jboss.seam.Component;
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.Unwrap;
-import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.contexts.Contexts;
-import org.jboss.seam.util.Work;
-
-/**
- * A Seam component that allows injection of the current
- * jBPM TaskInstance.
- *
- * @author Gavin King
- */
- at Scope(ScopeType.STATELESS)
- at Name("org.jboss.seam.bpm.taskInstance")
- at BypassInterceptors
- at Install(precedence=BUILT_IN, dependencies="org.jboss.seam.bpm.jbpm")
-public class TaskInstance
-{
-
- @Unwrap
- public org.jbpm.taskmgmt.exe.TaskInstance getTaskInstance() throws Exception
- {
- if ( !Contexts.isConversationContextActive() ) return null;
-
- return new Work<org.jbpm.taskmgmt.exe.TaskInstance>()
- {
-
- @Override
- protected org.jbpm.taskmgmt.exe.TaskInstance work() throws Exception
- {
- Long taskId = BusinessProcess.instance().getTaskId();
- if (taskId!=null)
- {
- //TODO: do we need to cache this??
- return ManagedJbpmContext.instance().getTaskInstanceForUpdate(taskId);
- }
- else
- {
- return null;
- }
- }
-
- }.workInTransaction();
- }
-
- public static org.jbpm.taskmgmt.exe.TaskInstance instance()
- {
- if ( !Contexts.isConversationContextActive() || !BusinessProcess.instance().hasCurrentTask() ) return null; //so we don't start a txn
-
- return (org.jbpm.taskmgmt.exe.TaskInstance) Component.getInstance(TaskInstance.class, ScopeType.STATELESS);
- }
-
-}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/TaskInstanceList.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/TaskInstanceList.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/TaskInstanceList.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,43 +0,0 @@
-package org.jboss.seam.bpm;
-
-import static org.jboss.seam.ScopeType.APPLICATION;
-import static org.jboss.seam.annotations.Install.BUILT_IN;
-
-import java.util.List;
-
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.Transactional;
-import org.jboss.seam.annotations.Unwrap;
-import org.jbpm.taskmgmt.exe.TaskInstance;
-
-/**
- * Support for the task list.
- *
- * @see TaskInstanceListForType
- * @see PooledTask
- * @author <a href="mailto:steve at hibernate.org">Steve Ebersole</a>
- * @author Gavin King
- */
- at Name("org.jboss.seam.bpm.taskInstanceList")
- at Scope(APPLICATION)
- at Install(precedence=BUILT_IN, dependencies="org.jboss.seam.bpm.jbpm")
-public class TaskInstanceList
-{
-
- @Unwrap
- @Transactional
- public List<TaskInstance> getTaskInstanceList()
- {
- return getTaskInstanceList( Actor.instance().getId() );
- }
-
- private List<TaskInstance> getTaskInstanceList(String actorId)
- {
- if ( actorId == null ) return null;
-
- return ManagedJbpmContext.instance().getTaskList(actorId);
- }
-
-}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/TaskInstanceListForType.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/TaskInstanceListForType.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/TaskInstanceListForType.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,58 +0,0 @@
-package org.jboss.seam.bpm;
-
-import static org.jboss.seam.ScopeType.APPLICATION;
-import static org.jboss.seam.annotations.Install.BUILT_IN;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.Transactional;
-import org.jboss.seam.annotations.Unwrap;
-import org.jbpm.taskmgmt.exe.TaskInstance;
-
-/**
- * Support for a list of tasks of a particular type.
- *
- * @see TaskInstanceList
- * @author Gavin King
- * @author <a href="mailto:steve at hibernate.org">Steve Ebersole </a>
- */
- at Name("org.jboss.seam.bpm.taskInstanceListForType")
- at Scope(APPLICATION)
- at Install(precedence=BUILT_IN, dependencies="org.jboss.seam.bpm.jbpm")
-public class TaskInstanceListForType
-{
-
- @Unwrap
- @Transactional
- public Map<String,List<TaskInstance>> getTaskInstanceList()
- {
- return getTaskInstanceList( Actor.instance().getId() );
- }
-
- private Map<String,List<TaskInstance>> getTaskInstanceList(String actorId)
- {
- if ( actorId == null ) return null;
-
- Map<String, List<TaskInstance>> map = new HashMap<String, List<TaskInstance>>();
- List<TaskInstance> taskInstances = ManagedJbpmContext.instance().getTaskList(actorId);
- for ( TaskInstance task: taskInstances )
- {
- String name = task.getName();
- List<TaskInstance> list = map.get(name);
- if (list==null)
- {
- list = new ArrayList<TaskInstance>();
- map.put(name, list);
- }
- list.add(task);
- }
- return map;
- }
-
-}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/TaskInstancePriorityList.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/TaskInstancePriorityList.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/TaskInstancePriorityList.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,55 +0,0 @@
-package org.jboss.seam.bpm;
-
-import static org.jboss.seam.ScopeType.APPLICATION;
-import static org.jboss.seam.annotations.Install.BUILT_IN;
-
-import java.util.List;
-
-import org.hibernate.criterion.Order;
-import org.hibernate.criterion.Restrictions;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.Transactional;
-import org.jboss.seam.annotations.Unwrap;
-import org.jbpm.taskmgmt.exe.TaskInstance;
-
-/**
- * Support for a task list ordered by priority.
- *
- * @see TaskInstanceList
- * @see PooledTask
- * @author Gavin King
- */
- at Name("org.jboss.seam.bpm.taskInstancePriorityList")
- at Scope(APPLICATION)
- at Install(precedence=BUILT_IN, dependencies="org.jboss.seam.bpm.jbpm")
-public class TaskInstancePriorityList
-{
-
- //TODO: we really need to cache the list in the event context,
- // but then we would need some events to refresh it
- // when tasks end, which is non-trivial to do....
-
- @Unwrap
- @Transactional
- public List<TaskInstance> getTaskInstanceList()
- {
- return getTaskInstanceList( Actor.instance().getId() );
- }
-
- private List<TaskInstance> getTaskInstanceList(String actorId)
- {
- if ( actorId == null ) return null;
-
- return ManagedJbpmContext.instance().getSession()
- .createCriteria(TaskInstance.class)
- .add( Restrictions.eq("actorId", actorId) )
- .add( Restrictions.eq("isOpen", true) )
- .add( Restrictions.ne("isSuspended", true) )
- .addOrder( Order.asc("priority") )
- .setCacheable(true)
- .list();
- }
-
-}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/Transition.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/Transition.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/Transition.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,63 +0,0 @@
-package org.jboss.seam.bpm;
-
-import static org.jboss.seam.annotations.Install.BUILT_IN;
-
-import java.io.Serializable;
-
-import org.jboss.seam.Component;
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.contexts.Contexts;
-import org.jboss.seam.core.AbstractMutable;
-
-/**
- * Allows the application to set the jBPM transition to be used when
- * an <tt>@EndTask</tt> method is encountered.
- *
- * @see org.jboss.seam.annotations.bpm.EndTask
- *
- * @author Gavin King
- */
- at Name("org.jboss.seam.bpm.transition")
- at Scope(ScopeType.CONVERSATION)
- at BypassInterceptors
- at Install(precedence=BUILT_IN, dependencies="org.jboss.seam.bpm.jbpm")
-public class Transition extends AbstractMutable implements Serializable
-{
- private static final long serialVersionUID = -3054558654376670239L;
-
- private String name;
-
- public String getName()
- {
- return name;
- }
-
- /**
- * Set the jBPM transition name
- */
- public void setName(String name)
- {
- setDirty(this.name, name);
- this.name = name;
- }
-
- public static Transition instance()
- {
- if ( !Contexts.isApplicationContextActive() )
- {
- throw new IllegalStateException("No active application context");
- }
- return (Transition) Component.getInstance(Transition.class, ScopeType.CONVERSATION);
- }
-
- @Override
- public String toString()
- {
- return "Transition(" + name + ")";
- }
-
-}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/jbpm.pageflow.cfg.xml
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/jbpm.pageflow.cfg.xml 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/bpm/jbpm.pageflow.cfg.xml 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,3 +0,0 @@
-<pageflow-configuration>
- <jbpm-context />
-</pageflow-configuration>
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/cache/AbstractJBossCacheProvider.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/cache/AbstractJBossCacheProvider.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/cache/AbstractJBossCacheProvider.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,38 +0,0 @@
-package org.jboss.seam.cache;
-
-import org.jboss.cache.Fqn;
-
-public abstract class AbstractJBossCacheProvider<T> extends CacheProvider<T>
-{
-
- public AbstractJBossCacheProvider()
- {
- super.setConfiguration("treecache.xml");
- }
-
- private Fqn defaultFqn;
-
- protected Fqn getFqn(String region)
- {
- if (region != null)
- {
- return Fqn.fromString(region);
- }
- else
- {
- if (defaultFqn == null)
- {
- defaultFqn = Fqn.fromString(getDefaultRegion());
- }
- return defaultFqn;
- }
- }
-
- @Override
- public void setDefaultRegion(String defaultRegion)
- {
- super.setDefaultRegion(defaultRegion);
- this.defaultFqn = Fqn.fromString(defaultRegion);
- }
-
-}
\ No newline at end of file
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/cache/JbossCache2Provider.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/cache/JbossCache2Provider.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/cache/JbossCache2Provider.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,113 +0,0 @@
-package org.jboss.seam.cache;
-
-import static org.jboss.seam.ScopeType.APPLICATION;
-import static org.jboss.seam.annotations.Install.BUILT_IN;
-
-import java.lang.reflect.Method;
-
-import org.jboss.cache.Cache;
-import org.jboss.cache.CacheFactory;
-import org.jboss.cache.DefaultCacheFactory;
-import org.jboss.cache.Fqn;
-import org.jboss.seam.annotations.AutoCreate;
-import org.jboss.seam.annotations.Create;
-import org.jboss.seam.annotations.Destroy;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.log.LogProvider;
-import org.jboss.seam.log.Logging;
-import org.jboss.seam.util.Reflections;
-
-/**
- * Implementation of CacheProvider backed by JBoss Cache 2.x. for simple
- * objects.
- *
- * @author Sebastian Hennebrueder
- * @author Pete Muir
- */
-
- at Name("org.jboss.seam.cache.cacheProvider")
- at Scope(APPLICATION)
- at BypassInterceptors
- at Install(value = false, precedence = BUILT_IN, classDependencies = {"org.jboss.cache.Cache", "org.jgroups.MembershipListener"})
- at AutoCreate
-public class JbossCache2Provider
- extends AbstractJBossCacheProvider<Cache>
-{
-
- private org.jboss.cache.Cache cache;
-
- private static final LogProvider log = Logging.getLogProvider(JbossCache2Provider.class);
-
- private static Method GET;
- private static Method PUT;
- private static Method REMOVE;
- private static Method REMOVE_NODE;
-
- static {
- try {
- GET = Cache.class.getDeclaredMethod("get", Fqn.class, Object.class);
- PUT = Cache.class.getDeclaredMethod("put", Fqn.class, Object.class, Object.class);
- REMOVE = Cache.class.getDeclaredMethod("remove", Fqn.class, Object.class);
- REMOVE_NODE = Cache.class.getDeclaredMethod("removeNode", Fqn.class);
- } catch (Exception e) {
- throw new IllegalStateException("Unable to use JBoss Cache 2", e);
- }
- }
-
- @Create
- public void create() {
- log.debug("Starting JBoss Cache");
-
- try {
- CacheFactory factory = new DefaultCacheFactory();
- cache = factory.createCache(getConfigurationAsStream());
-
- cache.create();
- cache.start();
- } catch (Exception e) {
- //log.error(e, e);
- throw new IllegalStateException("Error starting JBoss Cache", e);
- }
- }
-
- @Destroy
- public void destroy() {
- log.debug("Stopping JBoss Cache");
- try {
- cache.stop();
- cache.destroy();
- cache = null;
- } catch (Exception e) {
- throw new IllegalStateException("Error stopping JBoss Cache", e);
- }
- }
-
- @Override
- public Object get(String region, String key) {
- return Reflections.invokeAndWrap(GET, cache, getFqn(region), key);
- }
-
- @Override
- public void put(String region, String key, Object object) {
- Reflections.invokeAndWrap(PUT, cache, getFqn(region), key, object);
- }
-
- @Override
- public void remove(String region, String key) {
- Reflections.invokeAndWrap(REMOVE, cache, getFqn(region), key);
- }
-
- @Override
- public void clear() {
- Reflections.invokeAndWrap(REMOVE_NODE, cache, getFqn(null));
- }
-
- @Override
- public Cache getDelegate() {
- return cache;
- }
-
-}
\ No newline at end of file
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/cache/JbossCacheProvider.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/cache/JbossCacheProvider.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/cache/JbossCacheProvider.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,142 +0,0 @@
-package org.jboss.seam.cache;
-
-import static org.jboss.seam.ScopeType.APPLICATION;
-import static org.jboss.seam.annotations.Install.BUILT_IN;
-
-import org.jboss.cache.CacheException;
-import org.jboss.cache.Node;
-import org.jboss.cache.PropertyConfigurator;
-import org.jboss.cache.TreeCache;
-import org.jboss.seam.annotations.AutoCreate;
-import org.jboss.seam.annotations.Create;
-import org.jboss.seam.annotations.Destroy;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.log.LogProvider;
-import org.jboss.seam.log.Logging;
-
-/**
- * Implementation of CacheProvider backed by JBoss Cache 1.x
- *
- * @author Sebastian Hennebrueder
- * @author Pete Muir
- */
-
- at Name("org.jboss.seam.cache.cacheProvider")
- at Scope(APPLICATION)
- at BypassInterceptors
- at Install(precedence = BUILT_IN, classDependencies={"org.jboss.cache.TreeCache", "org.jgroups.MembershipListener"})
- at AutoCreate
-public class JbossCacheProvider extends AbstractJBossCacheProvider<TreeCache>
-{
-
- private TreeCache cache;
-
- private static final LogProvider log = Logging.getLogProvider(JbossCacheProvider.class);
-
- @Create
- public void create()
- {
- log.debug("Starting JBoss Treecache 1.x");
-
- try
- {
- cache = new TreeCache();
- new PropertyConfigurator().configure(cache, getConfigurationAsStream());
- cache.createService();
- cache.startService();
-
- }
- catch (Exception e)
- {
- throw new IllegalStateException("Error starting JBoss Treecache 1.x", e);
- }
- }
-
- @Destroy
- public void destroy()
- {
- log.debug("Stopping JBoss Treecache 1.x");
-
- try
- {
- cache.stopService();
- cache.destroyService();
- }
- catch (RuntimeException e)
- {
- throw new IllegalStateException("Error stopping JBoss Treecache 1.x", e);
- }
- cache = null;
- }
-
- @Override
- public Object get(String region, String key)
- {
- try
- {
- Node node = cache.get(getFqn(region));
- if (node != null)
- {
- return node.get(key);
- }
- else
- {
- return null;
- }
- }
- catch (CacheException e)
- {
- throw new IllegalStateException(String.format("Cache throw exception when trying to get %s from region %s.", key, region), e);
- }
- }
-
- @Override
- public void put(String region, String key, Object object)
- {
- try
- {
- cache.put(getFqn(region), key, object);
- }
- catch (CacheException e)
- {
- throw new IllegalStateException(String.format("JBoss Cache throw exception when adding object for key %s to region %s", key, region), e);
- }
- }
-
- @Override
- public void remove(String region, String key)
- {
- try
- {
- cache.remove(getFqn(region), key);
- }
- catch (CacheException e)
- {
- throw new IllegalStateException(String.format("JBoss Cache throw exception when removing object for key %s in region %s", key, region), e);
- }
-
- }
-
- @Override
- public TreeCache getDelegate()
- {
- return cache;
- }
-
- @Override
- public void clear()
- {
- try
- {
- cache.remove(getFqn(null));
- }
- catch (CacheException e)
- {
- throw new IllegalStateException(String.format("JBoss Cache throw exception when clearing default cache."), e);
- }
- }
-
-}
\ No newline at end of file
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/cache/JbossPojoCacheProvider.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/cache/JbossPojoCacheProvider.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/cache/JbossPojoCacheProvider.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,135 +0,0 @@
-package org.jboss.seam.cache;
-
-import static org.jboss.seam.ScopeType.APPLICATION;
-import static org.jboss.seam.annotations.Install.BUILT_IN;
-
-import org.jboss.cache.CacheException;
-import org.jboss.cache.Node;
-import org.jboss.cache.aop.PojoCache;
-import org.jboss.seam.annotations.AutoCreate;
-import org.jboss.seam.annotations.Create;
-import org.jboss.seam.annotations.Destroy;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.log.LogProvider;
-import org.jboss.seam.log.Logging;
-
-/**
- * Implementation of CacheProvider backed by JBoss POJO Cache 1.x
- *
- * @author Sebastian Hennebrueder
- * @author Pete Muir
- */
-
- at Name("org.jboss.seam.cache.cacheProvider")
- at Scope(APPLICATION)
- at BypassInterceptors
- at Install(value = false, precedence = BUILT_IN, classDependencies={"org.jboss.cache.aop.PojoCache", "org.jgroups.MembershipListener", "org.jboss.aop.Dispatcher"})
- at AutoCreate
-public class JbossPojoCacheProvider extends AbstractJBossCacheProvider<PojoCache>
-{
-
- private PojoCache cache;
-
- private static final LogProvider log = Logging.getLogProvider(JbossPojoCacheProvider.class);
-
- @Create
- public void create()
- {
- log.debug("Starting JBoss POJO Cache 1.x");
-
- try
- {
- cache = new PojoCache();
- new org.jboss.cache.PropertyConfigurator().configure(cache, getConfigurationAsStream());
- cache.createService();
- cache.startService();
-
- }
- catch (Exception e)
- {
- throw new IllegalStateException("Error starting JBoss POJO Cache 1.x", e);
- }
- }
-
- @Destroy
- public void destroy()
- {
- log.debug("Stopping JBoss Treecache 1.x");
-
- try
- {
- cache.stopService();
- cache.destroyService();
- }
- catch (RuntimeException e)
- {
- throw new IllegalStateException("Error stopping JBoss Treecache 1.x", e);
- }
- cache = null;
- }
-
- @Override
- public Object get(String region, String key) {
- try {
- Node node = cache.get(getFqn(region));
- if (node != null) {
- return node.get(key);
- } else {
- return null;
- }
- } catch (CacheException e) {
- throw new IllegalStateException(String.format("Cache throw exception when trying to get %s from region %s.", key, region), e);
- }
- }
-
-
- @Override
- public void put(String region, String key, Object object)
- {
- try
- {
- cache.put(getFqn(region), key, object);
- }
- catch (CacheException e)
- {
- throw new IllegalStateException(String.format("JBoss Cache throw exception when adding object for key %s to region %s", key, region), e);
- }
- }
-
- @Override
- public void remove(String region, String key)
- {
- try
- {
- cache.remove(getFqn(region), key);
- }
- catch (CacheException e)
- {
- throw new IllegalStateException(String.format("JBoss Cache throw exception when removing object for key %s in region %s", key, region), e);
- }
-
- }
-
- @Override
- public PojoCache getDelegate()
- {
- return cache;
- }
-
- @Override
- public void clear()
- {
- try
- {
- cache.remove(getFqn(null));
- }
- catch (CacheException e)
- {
- throw new IllegalStateException(String.format("JBoss Cache throw exception when clearing default cache."), e);
- }
- }
-
-}
\ No newline at end of file
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/BusinessProcessContext.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/BusinessProcessContext.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/BusinessProcessContext.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,245 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
-package org.jboss.seam.contexts;
-
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-import org.jboss.seam.Component;
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.bpm.ProcessInstance;
-import org.jboss.seam.bpm.TaskInstance;
-import org.jboss.seam.core.Events;
-import org.jboss.seam.core.Init;
-import org.jboss.seam.log.LogProvider;
-import org.jboss.seam.log.Logging;
-import org.jbpm.context.exe.ContextInstance;
-
-/**
- * Exposes a jbpm variable context instance for reading/writing.
- *
- * @author <a href="mailto:theute at jboss.org">Thomas Heute</a>
- * @author <a href="mailto:steve at hibernate.org">Steve Ebersole</a>
- * @author Gavin King
- */
-public class BusinessProcessContext implements Context
-{
-
- private static final LogProvider log = Logging.getLogProvider(BusinessProcessContext.class);
-
- private final Map<String, Object> additions = new HashMap<String, Object>();
- private final Set<String> removals = new HashSet<String>();
- private final boolean enabled;
-
- public ScopeType getType()
- {
- return ScopeType.BUSINESS_PROCESS;
- }
-
- public BusinessProcessContext()
- {
- Init init = Init.instance();
- if (init == null)
- {
- enabled = false;
- }
- else
- {
- enabled = init.isJbpmInstalled();
- }
- }
-
- public Object get(String name)
- {
-
- Object result = additions.get(name);
- if (result!=null) return result;
- if ( removals.contains(name) ) return null;
-
- org.jbpm.taskmgmt.exe.TaskInstance taskInstance = getTaskInstance();
- if (taskInstance==null)
- {
- ContextInstance context = getContextInstance();
- return context==null ? null : context.getVariable(name);
- }
- else
- {
- return taskInstance.getVariable(name);
- }
-
- }
-
- public void set(String name, Object value)
- {
- if ( Events.exists() ) Events.instance().raiseEvent("org.jboss.seam.preSetVariable." + name);
- if (value==null)
- {
- //yes, we need this
- remove(name);
- }
- else
- {
- removals.remove(name);
- additions.put(name, value);
- }
- if ( Events.exists() ) Events.instance().raiseEvent("org.jboss.seam.postSetVariable." + name);
- }
-
- public boolean isSet(String name)
- {
- return get(name)!=null;
- }
-
- public void remove(String name)
- {
- if ( Events.exists() ) Events.instance().raiseEvent("org.jboss.seam.preRemoveVariable." + name);
- additions.remove(name);
- removals.add(name);
- if ( Events.exists() ) Events.instance().raiseEvent("org.jboss.seam.postRemoveVariable." + name);
- }
-
- public String[] getNames()
- {
- Set<String> results = getNamesFromContext();
- results.removeAll(removals);
- results.addAll( additions.keySet() ); //after, to override
- return results.toArray(new String[]{});
- }
-
- private Set<String> getNamesFromContext()
- {
- //TODO: note that this is called from Contexts.destroy(),
- // after the Seam-managed txn was committed, but
- // this implementation requires a hit to the database!
- HashSet<String> results = new HashSet<String>();
- org.jbpm.taskmgmt.exe.TaskInstance taskInstance = getTaskInstance();
- if (taskInstance==null) {
- ContextInstance context = getContextInstance();
- if (context!=null) {
- Map variables = context.getVariables();
- if (variables != null) {
- results.addAll(variables.keySet());
- }
- }
- } else {
- results.addAll( taskInstance.getVariables().keySet() );
- }
- return results;
- }
-
- public Object get(Class clazz)
- {
- return get( Component.getComponentName(clazz) );
- }
-
- public void clear()
- {
- additions.clear();
- removals.addAll( getNamesFromContext() );
- }
-
- /**
- * Propagate all additions and removals to the jBPM database if
- * there is a current process instance, or do nothing if there
- * is no current process instance.
- */
- public void flush()
- {
- if ( !additions.isEmpty() || !removals.isEmpty() )
- {
-
- org.jbpm.taskmgmt.exe.TaskInstance taskInstance = getTaskInstance();
- if (taskInstance==null)
- {
- org.jbpm.graph.exe.ProcessInstance processInstance = getProcessInstance();
- if ( processInstance==null )
- {
- log.debug( "no process instance to persist business process state" );
- return; //don't clear the additions and removals
- }
- else
- {
- flushToProcessInstance(processInstance);
- }
- }
- else
- {
- flushToTaskInstance(taskInstance);
- }
-
- additions.clear();
- removals.clear();
-
- }
-
- }
-
- private void flushToTaskInstance(org.jbpm.taskmgmt.exe.TaskInstance taskInstance)
- {
- log.debug( "flushing to task instance: " + taskInstance.getId() );
-
- for ( Map.Entry<String, Object> entry: additions.entrySet() )
- {
- taskInstance.setVariableLocally( entry.getKey(), entry.getValue() );
- }
-
- for ( String name: removals )
- {
- taskInstance.deleteVariableLocally(name);
- }
- }
-
- private void flushToProcessInstance(org.jbpm.graph.exe.ProcessInstance processInstance)
- {
- log.debug( "flushing to process instance: " + processInstance.getId() );
-
- ContextInstance contextInstance = processInstance.getContextInstance();
-
- for ( Map.Entry<String, Object> entry: additions.entrySet() )
- {
- contextInstance.setVariable( entry.getKey(), entry.getValue() );
- }
-
- for ( String name: removals )
- {
- contextInstance.deleteVariable(name);
- }
- }
-
- private ContextInstance getContextInstance()
- {
- org.jbpm.graph.exe.ProcessInstance processInstance = getProcessInstance();
- return processInstance==null ? null : processInstance.getContextInstance();
- }
-
- private org.jbpm.graph.exe.ProcessInstance getProcessInstance()
- {
- if (!enabled)
- {
- return null;
- }
- else
- {
- return ProcessInstance.instance();
- }
- }
-
- private org.jbpm.taskmgmt.exe.TaskInstance getTaskInstance()
- {
- if (!enabled)
- {
- return null;
- }
- else
- {
- return TaskInstance.instance();
- }
- }
-
-}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/Contexts.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/Contexts.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/Contexts.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -12,7 +12,7 @@
import org.jboss.seam.Component;
import org.jboss.seam.ScopeType;
-import org.jboss.seam.bpm.BusinessProcess;
+//import org.jboss.seam.bpm.BusinessProcess;
import org.jboss.seam.core.ConversationPropagation;
import org.jboss.seam.core.Events;
import org.jboss.seam.core.Init;
@@ -383,8 +383,8 @@
//TODO: it would be nice if BP context spanned redirects along with the conversation
// this would also require changes to BusinessProcessContext
- boolean destroyBusinessProcessContext = !Init.instance().isJbpmInstalled() ||
- !BusinessProcess.instance().hasActiveProcess();
+ boolean destroyBusinessProcessContext = false;//!Init.instance().isJbpmInstalled() ||
+ //!BusinessProcess.instance().hasActiveProcess();
if (destroyBusinessProcessContext)
{
//TODO: note that this occurs from Lifecycle.endRequest(), after
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/FacesLifecycle.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/FacesLifecycle.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/FacesLifecycle.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -171,7 +171,7 @@
(Context) new ClientConversationContext() :
(Context) new ServerConversationContext( externalContext.getSessionMap() );*/
Contexts.conversationContext.set(conversationContext);
- Contexts.businessProcessContext.set( new BusinessProcessContext() );
+ //Contexts.businessProcessContext.set( new BusinessProcessContext() );
conversationContext.unflush();
}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/Lifecycle.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/Lifecycle.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/Lifecycle.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -90,7 +90,7 @@
Contexts.eventContext.set( new BasicContext(ScopeType.EVENT) );
Contexts.sessionContext.set( new BasicContext(ScopeType.SESSION) );
Contexts.conversationContext.set( new BasicContext(ScopeType.CONVERSATION) );
- Contexts.businessProcessContext.set( new BusinessProcessContext() );
+ //Contexts.businessProcessContext.set( new BusinessProcessContext() );
}
public static void endCall()
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/ServletLifecycle.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/ServletLifecycle.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/ServletLifecycle.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -191,7 +191,7 @@
{
ServerConversationContext conversationContext = new ServerConversationContext( new ServletRequestSessionMap(request) );
Contexts.conversationContext.set(conversationContext);
- Contexts.businessProcessContext.set( new BusinessProcessContext() );
+ //Contexts.businessProcessContext.set( new BusinessProcessContext() );
conversationContext.unflush();
}
/**
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/TestLifecycle.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/TestLifecycle.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/contexts/TestLifecycle.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -32,7 +32,7 @@
Contexts.applicationContext.set( new ApplicationContext( new ServletApplicationMap(context) ) );
Contexts.eventContext.set( new BasicContext(ScopeType.EVENT) );
Contexts.conversationContext.set( new BasicContext(ScopeType.CONVERSATION) );
- Contexts.businessProcessContext.set( new BusinessProcessContext() );
+ //Contexts.businessProcessContext.set( new BusinessProcessContext() );
Contexts.sessionContext.set( new SessionContext(session) );
}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/ConversationInterceptor.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/ConversationInterceptor.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/ConversationInterceptor.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -13,12 +13,12 @@
import org.jboss.seam.annotations.bpm.StartTask;
import org.jboss.seam.annotations.intercept.AroundInvoke;
import org.jboss.seam.annotations.intercept.Interceptor;
-import org.jboss.seam.bpm.BusinessProcessInterceptor;
+//import org.jboss.seam.bpm.BusinessProcessInterceptor;
import org.jboss.seam.intercept.AbstractInterceptor;
import org.jboss.seam.intercept.InvocationContext;
import org.jboss.seam.navigation.ConversationIdParameter;
import org.jboss.seam.navigation.Pages;
-import org.jboss.seam.pageflow.Pageflow;
+//import org.jboss.seam.pageflow.Pageflow;
import org.jboss.seam.persistence.PersistenceContexts;
/**
@@ -27,8 +27,8 @@
* @author Gavin King
*/
@Interceptor(stateless=true,
- around=BijectionInterceptor.class,
- within=BusinessProcessInterceptor.class)
+ around=BijectionInterceptor.class)//,
+ //within=BusinessProcessInterceptor.class)
public class ConversationInterceptor extends AbstractInterceptor
{
private static final long serialVersionUID = -5405533438107796414L;
@@ -240,10 +240,10 @@
{
if ( !pageflowName.equals("") )
{
- if ( !Init.instance().isJbpmInstalled() ) {
- throw new IllegalArgumentException("attempting to begin pageflow but required org.jboss.seam.bpm.jbpm component is not installed");
- }
- Pageflow.instance().begin(pageflowName);
+// if ( !Init.instance().isJbpmInstalled() ) {
+// throw new IllegalArgumentException("attempting to begin pageflow but required org.jboss.seam.bpm.jbpm component is not installed");
+// }
+// Pageflow.instance().begin(pageflowName);
}
}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/ConversationalInterceptor.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/ConversationalInterceptor.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/ConversationalInterceptor.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -12,7 +12,7 @@
import org.jboss.seam.annotations.bpm.StartTask;
import org.jboss.seam.annotations.intercept.AroundInvoke;
import org.jboss.seam.annotations.intercept.Interceptor;
-import org.jboss.seam.bpm.BusinessProcessInterceptor;
+//import org.jboss.seam.bpm.BusinessProcessInterceptor;
import org.jboss.seam.intercept.AbstractInterceptor;
import org.jboss.seam.intercept.InvocationContext;
@@ -24,7 +24,7 @@
* @author Gavin King
*/
@Interceptor(stateless=true,
- around={BijectionInterceptor.class, BusinessProcessInterceptor.class})
+ around={BijectionInterceptor.class})//, BusinessProcessInterceptor.class})
public class ConversationalInterceptor extends AbstractInterceptor
{
private static final long serialVersionUID = 1127583515811479385L;
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/EventInterceptor.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/EventInterceptor.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/EventInterceptor.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -5,7 +5,7 @@
import org.jboss.seam.annotations.RaiseEvent;
import org.jboss.seam.annotations.intercept.AroundInvoke;
import org.jboss.seam.annotations.intercept.Interceptor;
-import org.jboss.seam.bpm.BusinessProcessInterceptor;
+//import org.jboss.seam.bpm.BusinessProcessInterceptor;
import org.jboss.seam.intercept.AbstractInterceptor;
import org.jboss.seam.intercept.InvocationContext;
import org.jboss.seam.transaction.RollbackInterceptor;
@@ -19,7 +19,7 @@
*/
@Interceptor(stateless=true,
around={BijectionInterceptor.class, ConversationInterceptor.class,
- TransactionInterceptor.class, BusinessProcessInterceptor.class,
+ TransactionInterceptor.class,// BusinessProcessInterceptor.class,
RollbackInterceptor.class})
public class EventInterceptor extends AbstractInterceptor
{
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/Init.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/Init.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/Init.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -24,7 +24,7 @@
import org.jboss.seam.annotations.Scope;
import org.jboss.seam.annotations.intercept.BypassInterceptors;
import org.jboss.seam.async.AsynchronousInterceptor;
-import org.jboss.seam.bpm.BusinessProcessInterceptor;
+//import org.jboss.seam.bpm.BusinessProcessInterceptor;
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.core.Expressions.MethodExpression;
import org.jboss.seam.core.Expressions.ValueExpression;
@@ -62,7 +62,7 @@
MethodContextInterceptor.class.getName(),
EventInterceptor.class.getName(),
ConversationalInterceptor.class.getName(),
- BusinessProcessInterceptor.class.getName(),
+ //BusinessProcessInterceptor.class.getName(),
ConversationInterceptor.class.getName(),
BijectionInterceptor.class.getName(),
RollbackInterceptor.class.getName(),
@@ -414,7 +414,7 @@
public boolean isJbpmInstalled()
{
- return jbpmInstalled;
+ return false;//jbpmInstalled;
}
public String getJndiPattern()
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/Manager.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/Manager.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/core/Manager.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -30,7 +30,7 @@
import org.jboss.seam.log.Logging;
import org.jboss.seam.navigation.ConversationIdParameter;
import org.jboss.seam.navigation.Pages;
-import org.jboss.seam.pageflow.Pageflow;
+//import org.jboss.seam.pageflow.Pageflow;
import org.jboss.seam.util.Id;
import org.jboss.seam.web.Session;
@@ -537,20 +537,20 @@
}
beginConversation();
- if (propagation.getPageflow() != null)
- {
- Pageflow.instance().begin( propagation.getPageflow() );
- }
+// if (propagation.getPageflow() != null)
+// {
+// Pageflow.instance().begin( propagation.getPageflow() );
+// }
break;
case JOIN:
if ( !isLongRunningConversation )
{
beginConversation();
-
- if (propagation.getPageflow() != null)
- {
- Pageflow.instance().begin( propagation.getPageflow() );
- }
+//
+// if (propagation.getPageflow() != null)
+// {
+// Pageflow.instance().begin( propagation.getPageflow() );
+// }
}
break;
case NESTED:
@@ -565,7 +565,7 @@
if (propagation.getPageflow() != null)
{
- Pageflow.instance().begin( propagation.getPageflow() );
+// Pageflow.instance().begin( propagation.getPageflow() );
}
break;
case END:
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/drools/DroolsActionHandler.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/drools/DroolsActionHandler.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/drools/DroolsActionHandler.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,37 +0,0 @@
-package org.jboss.seam.drools;
-
-import java.util.List;
-
-import org.drools.WorkingMemory;
-import org.jbpm.graph.def.ActionHandler;
-import org.jbpm.graph.exe.ExecutionContext;
-
-/**
- * A jBPM ActionHandler that delegates to a Drools WorkingMemory
- * held in a Seam context variable.
- *
- * @author Jeff Delong
- * @author Gavin King
- * @author Tihomir Surdilovic
- *
- */
-public class DroolsActionHandler extends DroolsHandler implements ActionHandler
-{
- private static final long serialVersionUID = 7752070876220597913L;
-
- public List<String> assertObjects;
- public List<String> retractObjects;
- public String workingMemoryName;
- public String startProcessId;
-
- public void execute(ExecutionContext executionContext) throws Exception
- {
- WorkingMemory workingMemory = getWorkingMemory(workingMemoryName, assertObjects, retractObjects, executionContext);
- if(startProcessId != null && startProcessId.trim().length() > 0 )
- {
- workingMemory.startProcess(startProcessId);
- }
- workingMemory.fireAllRules();
- }
-
-}
\ No newline at end of file
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/drools/DroolsAssignmentHandler.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/drools/DroolsAssignmentHandler.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/drools/DroolsAssignmentHandler.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,38 +0,0 @@
-package org.jboss.seam.drools;
-
-import java.util.List;
-
-import org.drools.WorkingMemory;
-import org.jbpm.graph.exe.ExecutionContext;
-import org.jbpm.taskmgmt.def.AssignmentHandler;
-import org.jbpm.taskmgmt.exe.Assignable;
-
-/**
- * A jBPM AssignmentHandler that delegates to a Drools WorkingMemory
- * held in a Seam context variable.
- *
- * @author Jeff Delong
- * @author Gavin King
- *
- */
-public class DroolsAssignmentHandler extends DroolsHandler implements AssignmentHandler
-{
- private static final long serialVersionUID = -7114640047036854546L;
-
- public String workingMemoryName;
- public List<String> assertObjects;
- public List<String> retractObjects;
- public String startProcessId;
-
- public void assign(Assignable assignable, ExecutionContext executionContext) throws Exception
- {
- WorkingMemory workingMemory = getWorkingMemory(workingMemoryName, assertObjects, retractObjects, executionContext);
- workingMemory.setGlobal( "assignable", assignable );
- if(startProcessId != null && startProcessId.trim().length() > 0 )
- {
- workingMemory.startProcess(startProcessId);
- }
- workingMemory.fireAllRules();
- }
-
-}
\ No newline at end of file
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/drools/DroolsDecisionHandler.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/drools/DroolsDecisionHandler.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/drools/DroolsDecisionHandler.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,38 +0,0 @@
-package org.jboss.seam.drools;
-
-import java.util.List;
-
-import org.drools.WorkingMemory;
-import org.jbpm.graph.exe.ExecutionContext;
-import org.jbpm.graph.node.DecisionHandler;
-
-/**
- * A jBPM DecisionHandler that delegates to a Drools WorkingMemory
- * held in a Seam context variable. The decision outcome is returned
- * by setting the outcome attribute of the global named "decision".
- *
- * @author Gavin King
- *
- */
-public class DroolsDecisionHandler extends DroolsHandler implements DecisionHandler
-{
- private static final long serialVersionUID = -8900810376838166513L;
-
- public List<String> assertObjects;
- public List<String> retractObjects;
- public String workingMemoryName;
- public String startProcessId;
-
- public String decide(ExecutionContext executionContext) throws Exception
- {
- WorkingMemory workingMemory = getWorkingMemory(workingMemoryName, assertObjects, retractObjects, executionContext);
- workingMemory.setGlobal( "decision", new Decision() );
- if(startProcessId != null && startProcessId.trim().length() > 0 )
- {
- workingMemory.startProcess(startProcessId);
- }
- workingMemory.fireAllRules();
- return ( (Decision) workingMemory.getGlobal("decision") ).getOutcome();
- }
-
-}
\ No newline at end of file
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/drools/DroolsHandler.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/drools/DroolsHandler.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/drools/DroolsHandler.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -2,13 +2,12 @@
import java.util.List;
+import javax.el.ELException;
+
import org.drools.FactHandle;
import org.drools.WorkingMemory;
import org.jboss.seam.Component;
-import org.jboss.seam.bpm.Actor;
import org.jboss.seam.core.Expressions;
-import org.jbpm.graph.exe.ExecutionContext;
-import org.jbpm.jpdl.el.ELException;
/**
* Common functionality for jBPM handlers for Drools.
@@ -19,7 +18,7 @@
*/
public class DroolsHandler
{
- protected WorkingMemory getWorkingMemory(String workingMemoryName, List<String> expressions, List<String> retractions, ExecutionContext executionContext)
+ protected WorkingMemory getWorkingMemory(String workingMemoryName, List<String> expressions, List<String> retractions)//, ExecutionContext executionContext)
throws ELException
{
WorkingMemory workingMemory = (WorkingMemory) Component.getInstance(workingMemoryName, true);
@@ -67,7 +66,7 @@
}
//workingMemory.setGlobal( "contextInstance", executionContext.getContextInstance() );
- workingMemory.insert(Actor.instance());
+ //workingMemory.insert(Actor.instance());
return workingMemory;
}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/faces/FacesManager.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/faces/FacesManager.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/faces/FacesManager.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -33,7 +33,7 @@
import org.jboss.seam.log.Logging;
import org.jboss.seam.navigation.ConversationIdParameter;
import org.jboss.seam.navigation.Pages;
-import org.jboss.seam.pageflow.Pageflow;
+//import org.jboss.seam.pageflow.Pageflow;
/**
* An extended conversation manager for the JSF environment.
@@ -264,14 +264,14 @@
Conversation conversation = Conversation.instance();
//stuff from jPDL takes precedence
- org.jboss.seam.pageflow.Page page =
- Manager.instance().isLongRunningConversation() &&
- Init.instance().isJbpmInstalled() &&
- Pageflow.instance().isInProcess() && Pageflow.instance().isStarted() ?
- Pageflow.instance().getPage() : null;
+// org.jboss.seam.pageflow.Page page =
+// Manager.instance().isLongRunningConversation() &&
+// Init.instance().isJbpmInstalled() &&
+// Pageflow.instance().isInProcess() && Pageflow.instance().isStarted() ?
+// Pageflow.instance().getPage() : null;
- if (page==null)
- {
+// if (page==null)
+// {
//handle stuff defined in pages.xml
Pages pages = Pages.instance();
if (pages!=null) //for tests
@@ -293,20 +293,20 @@
conversation.setTimeout( pages.getTimeout(viewId) );
conversation.setConcurrentRequestTimeout( pages.getConcurrentRequestTimeout(viewId) );
}
- }
- else
- {
- //use stuff from the pageflow definition
- if ( page.isSwitchEnabled() )
- {
- conversation.setViewId( Pageflow.instance().getPageViewId() );
- }
- if ( page.hasDescription() )
- {
- conversation.setDescription( page.getDescription() );
- }
- conversation.setTimeout( page.getTimeout() );
- }
+// }
+// else
+// {
+// //use stuff from the pageflow definition
+// if ( page.isSwitchEnabled() )
+// {
+// conversation.setViewId( Pageflow.instance().getPageViewId() );
+// }
+// if ( page.hasDescription() )
+// {
+// conversation.setDescription( page.getDescription() );
+// }
+// conversation.setTimeout( page.getTimeout() );
+// }
flushConversationMetadata();
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/faces/FacesPage.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/faces/FacesPage.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/faces/FacesPage.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -13,7 +13,7 @@
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.core.Init;
import org.jboss.seam.core.Manager;
-import org.jboss.seam.pageflow.Pageflow;
+//import org.jboss.seam.pageflow.Pageflow;
import org.jboss.seam.web.Session;
/**
@@ -65,22 +65,22 @@
public void storePageflow()
{
- if ( Init.instance().isJbpmInstalled() )
- {
- Pageflow pageflow = Pageflow.instance();
- if ( pageflow.isInProcess() /*&& !pageflow.getProcessInstance().hasEnded()*/ && Manager.instance().isLongRunningConversation() )
- {
- pageflowName = pageflow.getSubProcessInstance().getProcessDefinition().getName();
- pageflowNodeName = pageflow.getNode().getName();
- pageflowCounter = pageflow.getPageflowCounter();
- }
- else
- {
- pageflowName = null;
- pageflowNodeName = null;
- pageflowCounter = null;
- }
- }
+// if ( Init.instance().isJbpmInstalled() )
+// {
+// Pageflow pageflow = Pageflow.instance();
+// if ( pageflow.isInProcess() /*&& !pageflow.getProcessInstance().hasEnded()*/ && Manager.instance().isLongRunningConversation() )
+// {
+// pageflowName = pageflow.getSubProcessInstance().getProcessDefinition().getName();
+// pageflowNodeName = pageflow.getNode().getName();
+// pageflowCounter = pageflow.getPageflowCounter();
+// }
+// else
+// {
+// pageflowName = null;
+// pageflowNodeName = null;
+// pageflowCounter = null;
+// }
+// }
}
public static FacesPage instance()
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/framework/BusinessProcessController.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/framework/BusinessProcessController.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/framework/BusinessProcessController.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,40 +0,0 @@
-package org.jboss.seam.framework;
-
-import org.jboss.seam.bpm.BusinessProcess;
-import org.jboss.seam.bpm.ManagedJbpmContext;
-import org.jbpm.JbpmContext;
-import org.jbpm.graph.exe.ProcessInstance;
-import org.jbpm.taskmgmt.exe.TaskInstance;
-
-/**
- * Superclass for controller objects that control
- * the business process context programmatically.
- * Adds convenience methods for control of the
- * jBPM business process.
- *
- * @author Gavin King
- *
- */
-public class BusinessProcessController extends Controller
-{
- protected BusinessProcess getBusinessProcess()
- {
- return BusinessProcess.instance();
- }
-
- protected JbpmContext getJbpmContext()
- {
- return ManagedJbpmContext.instance();
- }
-
- protected TaskInstance getTaskInstance()
- {
- return org.jboss.seam.bpm.TaskInstance.instance();
- }
-
- protected ProcessInstance getProcessInstance()
- {
- return org.jboss.seam.bpm.ProcessInstance.instance();
- }
-
-}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/init/Initialization.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/init/Initialization.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/init/Initialization.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -41,7 +41,7 @@
import org.jboss.seam.annotations.Namespace;
import org.jboss.seam.annotations.Role;
import org.jboss.seam.annotations.Roles;
-import org.jboss.seam.bpm.Jbpm;
+//import org.jboss.seam.bpm.Jbpm;
import org.jboss.seam.contexts.Context;
import org.jboss.seam.contexts.Contexts;
import org.jboss.seam.contexts.Lifecycle;
@@ -777,11 +777,11 @@
// access to custom deployment handlers for processing custom annotations
Contexts.getEventContext().set(StandardDeploymentStrategy.NAME, standardDeploymentStrategy);
scanForComponents();
- ComponentDescriptor desc = findDescriptor(Jbpm.class);
- if (desc != null && desc.isInstalled())
- {
- init.setJbpmInstalled(true);
- }
+// ComponentDescriptor desc = findDescriptor(Jbpm.class);
+// if (desc != null && desc.isInstalled())
+// {
+// init.setJbpmInstalled(true);
+// }
init.checkDefaultInterceptors();
init.setTimestamp(System.currentTimeMillis());
addSpecialComponents(init);
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/AgentID.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/AgentID.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/AgentID.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,103 +0,0 @@
-package org.jboss.seam.jmx;
-
-import java.net.InetAddress;
-import java.security.AccessController;
-import java.security.PrivilegedExceptionAction;
-import java.security.PrivilegedActionException;
-import java.util.Random;
-
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import EDU.oswego.cs.dl.util.concurrent.SynchronizedLong;
-
-import org.jboss.mx.server.ServerConstants;
-
-/**
- * Utility class for creating JMX agent identifiers. Also contains the
- * helper method for retrieving the <tt>AgentID</tt> of an existing MBean server
- * instance.
- *
- * @see javax.management.MBeanServerDelegateMBean
- *
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision: 81019 $
- *
- */
-public class AgentID
- implements ServerConstants
-{
- // Static ----------------------------------------------------
- private static SynchronizedLong id = new SynchronizedLong(0);
-
- private static final Random rand = new Random(System.currentTimeMillis());
-
- /**
- * Creates a new agent ID string. The identifier is of the form
- * <tt><ip.address>/<creation time in ms>/<VMID+(random int 0-100)>/<sequence #></tt>.<P>
- *
- * This AgentID string is globally unique.
- *
- * @return Agent ID string
- */
- public static String create()
- {
- String ipAddress = null;
-
- try
- {
- ipAddress = (String) AccessController.doPrivileged(
- new PrivilegedExceptionAction()
- {
- public Object run() throws Exception
- {
- return InetAddress.getLocalHost().getHostAddress();
- }
- }
- );
- }
- catch(PrivilegedActionException e)
- {
- ipAddress = "127.0.0.1";
- }
- // use the VMID to create a more unique ID that can be used to guarantee that this
- // MBeanServerID is unique across multiple JVMs, even on the same host
- String vmid = new java.rmi.dgc.VMID().toString().replace(':','x').replace('-','X') + rand.nextInt(100);
-
- return ipAddress + "/" + System.currentTimeMillis() + "/" + vmid + "/"+ (id.increment());
- }
- /**
- * test
- *
- * @param args
- */
- public static void main (String args[])
- {
- for (int c=0;c<10;c++)
- System.out.println(AgentID.create());
- }
-
- /**
- * Returns the agent identifier string of a given MBean server instance.
- *
- * @return <tt>MBeanServerId</tt> attribute of the MBean server delegate.
- */
- public static String get(MBeanServer server)
- {
- try
- {
- ObjectName name = new ObjectName(MBEAN_SERVER_DELEGATE);
- String agentID = (String)server.getAttribute(name, "MBeanServerId");
-
- return agentID;
- }
- catch (Throwable t)
- {
- throw new Error("Cannot find the MBean server delegate: " + t.toString());
- }
- }
-}
-
-
-
-
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/DefaultExceptionHandler.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/DefaultExceptionHandler.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/DefaultExceptionHandler.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,110 +0,0 @@
-package org.jboss.seam.jmx;
-
-
-import java.lang.reflect.Method;
-
-import javax.management.InstanceNotFoundException;
-import javax.management.AttributeNotFoundException;
-import javax.management.InvalidAttributeValueException;
-import javax.management.MBeanException;
-import javax.management.ReflectionException;
-import javax.management.RuntimeOperationsException;
-import javax.management.RuntimeMBeanException;
-import javax.management.RuntimeErrorException;
-
-/**
- * Default exception handler for MBean proxy.
- *
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision: 81019 $
- *
- */
-public class DefaultExceptionHandler
- implements ProxyExceptionHandler
-{
-
- // InstanceNotFound, AttributeNotFound and InvalidAttributeValue
- // are not exceptions declared in the mgmt interface and therefore
- // must be rethrown as runtime exceptions to avoid UndeclaredThrowable
- // exceptions on the client
-
- public Object handleInstanceNotFound(ProxyContext ctx,
- InstanceNotFoundException e,
- Method m, Object[] args)
- throws Exception
- {
- throw new RuntimeProxyException("Instance not found: " + e.toString());
- }
-
- public Object handleAttributeNotFound(ProxyContext ctx,
- AttributeNotFoundException e,
- Method m, Object[] args)
- throws Exception
- {
- throw new RuntimeProxyException("Attribute not found: " + e.toString());
- }
-
- public Object handleInvalidAttributeValue(ProxyContext ctx,
- InvalidAttributeValueException e,
- Method m, Object[] args)
- throws Exception
- {
- throw new RuntimeProxyException("Invalid attribute value: " + e.toString());
- }
-
- public Object handleMBeanException(ProxyContext ctx, MBeanException e,
- Method m, Object[] args)
- throws Exception
- {
- // assuming MBeanException only wraps mgmt interface "application"
- // exceptions therefore we can safely rethrow the target exception
- // as its declared in the mgmt interface
- throw e.getTargetException();
- }
-
- public Object handleReflectionException(ProxyContext ctx,
- ReflectionException e,
- Method m, Object[] args)
- throws Exception
- {
- // use of reflection exception is inconsistent in the API so the
- // safest bet is to rethrow a runtime exception
-
- Exception target = e.getTargetException();
- if (target instanceof RuntimeException)
- throw target;
- else
- throw new RuntimeProxyException(target.toString());
- }
-
- public Object handleRuntimeOperationsException(ProxyContext ctx,
- RuntimeOperationsException e,
- Method m, Object[] args)
- throws Exception
- {
- // target is always a runtime exception, so its ok to throw it from here
- throw e.getTargetException();
- }
-
- public Object handleRuntimeMBeanException(ProxyContext ctx,
- RuntimeMBeanException e,
- Method m, Object[] args)
- throws Exception
- {
- // target is always a runtime exception, so its ok to throw it from here
- throw e.getTargetException();
- }
-
- public Object handleRuntimeError(ProxyContext ctx, RuntimeErrorException e,
- Method m, Object[] args)
- throws Exception
- {
- // just unwrap and throw the actual error
- throw e.getTargetError();
- }
-
-}
-
-
-
-
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/JBossClusterMonitor.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/JBossClusterMonitor.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/JBossClusterMonitor.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,155 +0,0 @@
-package org.jboss.seam.jmx;
-
-import static org.jboss.seam.ScopeType.APPLICATION;
-import static org.jboss.seam.annotations.Install.BUILT_IN;
-
-import java.util.Vector;
-
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import javax.servlet.ServletContext;
-
-import org.jboss.seam.Seam;
-import org.jboss.seam.annotations.Create;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.Startup;
-import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.log.Log;
-import org.jboss.seam.log.Logging;
-
-/**
- * The purpose of this component is to detect a clustered environment and
- * to inform the HttpSessionListener whether the origin of a session destroyed
- * event is the failover of a session from one node to the next. If a node
- * is failing over, we don't want the SFSBs referenced by the session to be
- * destroyed.
- *
- * @author Dan Allen
- */
- at Name("org.jboss.seam.jmx.jbossClusterMonitor")
- at BypassInterceptors
- at Scope(APPLICATION)
- at Startup
- at Install(precedence=BUILT_IN, classDependencies="org.jgroups.MembershipListener")
-public class JBossClusterMonitor
-{
- private static Log log = Logging.getLog(JBossClusterMonitor.class);
-
- private MBeanServer jbossMBeanServer;
-
- private boolean clustered;
-
- private ObjectName clusteringCacheObjectName;
-
- private ObjectName serverObjectName;
-
- @Create
- public void create()
- {
- jbossMBeanServer = locateJBoss();
-
- if (!isJBoss())
- {
- return;
- }
-
- try
- {
- clusteringCacheObjectName = new ObjectName("jboss.cache:service=TomcatClusteringCache");
- serverObjectName = new ObjectName("jboss.system:type=Server");
- }
- catch (MalformedObjectNameException e)
- {
- log.warn("Invalid JMX name: " + e.getMessage());
- }
-
- try
- {
- jbossMBeanServer.getMBeanInfo(clusteringCacheObjectName);
- clustered = true;
- log.info("JBoss cluster detected");
- }
- catch (Exception e) {}
- }
-
- public boolean isClustered()
- {
- return clustered;
- }
-
- /**
- * Consults the jboss.system:type=Server MBean to determine if this instance
- * of JBoss AS is currently being shutdown. Note that the flag only returns
- * true if the shutdown() method on this MBean is used. It does not detect a
- * force halt via a process signal (i.e., CTRL-C).
- */
- public boolean nodeIsShuttingDown()
- {
- if (!isJBoss())
- {
- return false;
- }
-
- try
- {
- return (Boolean) jbossMBeanServer.getAttribute(serverObjectName, "InShutdown");
- }
- catch (Exception e)
- {
- return false;
- }
- }
-
- public boolean isLastNode()
- {
- if (!clustered)
- {
- return true;
- }
-
- // other options
- // object name => jboss.jgroups:cluster=DefaultPartition,type=channel
- // object name => jboss.jgroups:cluster=Tomcat-Cluster,type=channel
- // attribute => NumberOfTasksInTimer
-
- try
- {
- return ((Vector) jbossMBeanServer.getAttribute(clusteringCacheObjectName, "Members")).size() == 1;
- }
- catch (Exception e) {
- log.warn("Could not determine number of members in cluster", e);
- return true;
- }
- }
-
- public boolean failover()
- {
- return isClustered() && nodeIsShuttingDown() && !isLastNode();
- }
-
- public boolean isJBoss()
- {
- return jbossMBeanServer != null;
- }
-
- protected MBeanServer locateJBoss()
- {
- for (Object o: MBeanServerFactory.findMBeanServer(null)) {
- MBeanServer server = (MBeanServer) o;
- if ("jboss".equals(server.getDefaultDomain())) {
- return server;
- }
- }
- return null;
- }
-
- // FIXME my sense is that this could lookup could be more elegant or conforming
- public static JBossClusterMonitor getInstance(ServletContext ctx)
- {
- return (JBossClusterMonitor) ctx.getAttribute(Seam.getComponentName(JBossClusterMonitor.class));
- }
-}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/JMXInvocationHandler.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/JMXInvocationHandler.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/JMXInvocationHandler.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,445 +0,0 @@
-package org.jboss.seam.jmx;
-
-
-import java.io.Serializable;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-
-import java.util.HashMap;
-
-import javax.management.Attribute;
-import javax.management.AttributeList;
-import javax.management.AttributeNotFoundException;
-import javax.management.DynamicMBean;
-import javax.management.InstanceNotFoundException;
-import javax.management.IntrospectionException;
-import javax.management.InvalidAttributeValueException;
-import javax.management.MBeanAttributeInfo;
-import javax.management.MBeanException;
-import javax.management.MBeanInfo;
-import javax.management.MBeanOperationInfo;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-import javax.management.ReflectionException;
-import javax.management.RuntimeErrorException;
-import javax.management.RuntimeMBeanException;
-import javax.management.RuntimeOperationsException;
-
-/**
- * Invocation handler for MBean proxies.
- *
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision: 81019 $
- *
- */
-public class JMXInvocationHandler
- implements ProxyContext, InvocationHandler, Serializable
-{
- private static final long serialVersionUID = 3714728148040623702L;
-
- // Attributes -------------------------------------------------
-
- /**
- * Reference to the MBean server this proxy connects to.
- */
- protected MBeanServer server = null;
-
- /**
- * The object name of the MBean this proxy represents.
- */
- protected ObjectName objectName = null;
-
- /**
- * Default exception handler for the proxy.
- */
- private ProxyExceptionHandler handler = new DefaultExceptionHandler();
-
- /**
- * MBean attribute meta data.
- */
- private HashMap attributeMap = new HashMap();
-
- /**
- * Indicates whether Object.toString() should be delegated to the resource
- * or handled by the proxy.
- */
- private boolean delegateToStringToResource = false;
-
- /**
- * Indicates whether Object.equals() should be delegated to the resource
- * or handled by the proxy.
- */
- private boolean delegateEqualsToResource = false;
-
- /**
- * Indicates whether Object.hashCode() should be delegated to the resource
- * or handled by the proxy.
- */
- private boolean delegateHashCodeToResource = false;
-
-
- // Constructors -----------------------------------------------
-
- /**
- * Constructs a new JMX MBean Proxy invocation handler.
- *
- * @param server reference to the MBean server this proxy connects to
- * @param name object name of the MBean this proxy represents
- *
- * @throws MBeanProxyCreationException wraps underlying JMX exceptions in
- * case the proxy creation fails
- */
- public JMXInvocationHandler(MBeanServer server, ObjectName name)
- throws MBeanProxyCreationException
- {
- try
- {
- if (server == null)
- throw new MBeanProxyCreationException("null agent reference");
-
- this.server = server;
- this.objectName = name;
-
- MBeanInfo info = server.getMBeanInfo(objectName);
- MBeanAttributeInfo[] attributes = info.getAttributes();
- MBeanOperationInfo[] operations = info.getOperations();
-
- // collect the MBean attribute metadata for standard mbean proxies
- for (int i = 0; i < attributes.length; ++i)
- attributeMap.put(attributes[i].getName(), attributes[i]);
-
- // Check whether the target resource exposes the common object methods.
- // Dynamic Proxy will delegate these methods automatically to the
- // invoke() implementation.
- for (int i = 0; i < operations.length; ++i)
- {
- if (operations[i].getName().equals("toString") &&
- operations[i].getReturnType().equals("java.lang.String") &&
- operations[i].getSignature().length == 0)
- {
- delegateToStringToResource = true;
- }
-
- else if (operations[i].getName().equals("equals") &&
- operations[i].getReturnType().equals(Boolean.TYPE.getName()) &&
- operations[i].getSignature().length == 1 &&
- operations[i].getSignature() [0].getType().equals("java.lang.Object"))
- {
- delegateEqualsToResource = true;
- }
-
- else if (operations[i].getName().equals("hashCode") &&
- operations[i].getReturnType().equals(Integer.TYPE.getName()) &&
- operations[i].getSignature().length == 0)
- {
- delegateHashCodeToResource = true;
- }
- }
- }
- catch (InstanceNotFoundException e)
- {
- throw new MBeanProxyCreationException("Object name " + name + " not found: " + e.toString());
- }
- catch (IntrospectionException e)
- {
- throw new MBeanProxyCreationException(e.toString());
- }
- catch (ReflectionException e)
- {
- throw new MBeanProxyCreationException(e.toString());
- }
- }
-
-
- // InvocationHandler implementation ---------------------------
-
- public Object invoke(Object proxy, Method method, Object[] args)
- throws Exception
- {
- Class declaringClass = method.getDeclaringClass();
-
- // Handle methods from Object class. If the target resource exposes
- // operation metadata with same signature then the invocations will be
- // delegated to the target. Otherwise this instance of invocation handler
- // will execute them.
- if (declaringClass == Object.class)
- return handleObjectMethods(method, args);
-
- // Check methods from ProxyContext interface. If invoked, delegate
- // to the context implementation part of this invocation handler.
- if (declaringClass == ProxyContext.class)
- return method.invoke(this, args);
-
- // Check methods from DynamicMBean interface. This allows the proxy
- // to be used in cases where the underlying metadata has changed (a la
- // Dynamic MBean).
- if (declaringClass == DynamicMBean.class)
- return handleDynamicMBeanInvocation(method, args);
-
- try
- {
- String methodName = method.getName();
-
- // Assume a get/setAttribute convention on the typed proxy interface.
- // If the MBean metadata exposes a matching attribute then use the
- // MBeanServer attribute accessors to read/modify the value. If not,
- // fallback to MBeanServer.invoke() assuming this is an operation
- // invocation despite the accessor naming convention.
-
- // getter
- if (methodName.startsWith("get") && args == null)
- {
- String attrName = methodName.substring(3, methodName.length());
-
- // check that the metadata exists
- MBeanAttributeInfo info = (MBeanAttributeInfo)attributeMap.get(attrName);
- if (info != null)
- {
- String retType = method.getReturnType().getName();
-
- // check for correct return type on the getter
- if (retType.equals(info.getType()))
- {
- return server.getAttribute(objectName, attrName);
- }
- }
- }
-
- // boolean getter
- else if (methodName.startsWith("is") && args == null)
- {
- String attrName = methodName.substring(2, methodName.length());
-
- // check that the metadata exists
- MBeanAttributeInfo info = (MBeanAttributeInfo)attributeMap.get(attrName);
- if (info != null && info.isIs())
- {
- Class retType = method.getReturnType();
-
- // check for correct return type on the getter
- if (retType.equals(Boolean.class) || retType.equals(Boolean.TYPE))
- {
- return server.getAttribute(objectName, attrName);
- }
- }
- }
-
- // setter
- else if (methodName.startsWith("set") && args != null && args.length == 1)
- {
- String attrName = methodName.substring(3, methodName.length());
-
- // check that the metadata exists
- MBeanAttributeInfo info = (MBeanAttributeInfo)attributeMap.get(attrName);
- if (info != null && method.getReturnType().equals(Void.TYPE))
- {
- ClassLoader cl = Thread.currentThread().getContextClassLoader();
-
- Class signatureClass = null;
- String classType = info.getType();
-
- if (isPrimitive(classType))
- signatureClass = getPrimitiveClass(classType);
- else
- signatureClass = cl.loadClass(info.getType());
-
- if (signatureClass.isAssignableFrom(args[0].getClass()))
- {
- server.setAttribute(objectName, new Attribute(attrName, args[0]));
- return null;
- }
- }
- }
-
- String[] signature = null;
-
- if (args != null)
- {
- signature = new String[args.length];
- Class[] sign = method.getParameterTypes();
-
- for (int i = 0; i < sign.length; ++i)
- signature[i] = sign[i].getName();
- }
-
- return server.invoke(objectName, methodName, args, signature);
- }
- catch (InstanceNotFoundException e)
- {
- return getExceptionHandler().handleInstanceNotFound(this, e, method, args);
- }
- catch (AttributeNotFoundException e)
- {
- return getExceptionHandler().handleAttributeNotFound(this, e, method, args);
- }
- catch (InvalidAttributeValueException e)
- {
- return getExceptionHandler().handleInvalidAttributeValue(this, e, method, args);
- }
- catch (MBeanException e)
- {
- return getExceptionHandler().handleMBeanException(this, e, method, args);
- }
- catch (ReflectionException e)
- {
- return getExceptionHandler().handleReflectionException(this, e, method, args);
- }
- catch (RuntimeOperationsException e)
- {
- return getExceptionHandler().handleRuntimeOperationsException(this, e, method, args);
- }
- catch (RuntimeMBeanException e)
- {
- return getExceptionHandler().handleRuntimeMBeanException(this, e, method, args);
- }
- catch (RuntimeErrorException e)
- {
- return getExceptionHandler().handleRuntimeError(this, e, method, args);
- }
- }
-
- public ProxyExceptionHandler getExceptionHandler()
- {
- return handler;
- }
-
-
- // ProxyContext implementation -----------------------------------
-
- // The proxy provides an access point for the client to methods not part
- // of the MBean's management interface. It can be used to configure the
- // invocation (with context, client side interceptors, RPC), exception
- // handling, act as an access point to MBean server interface and so on.
-
- public void setExceptionHandler(ProxyExceptionHandler handler)
- {
- this.handler = handler;
- }
-
- public MBeanServer getMBeanServer()
- {
- return server;
- }
-
- public ObjectName getObjectName()
- {
- return objectName;
- }
-
-
- // Object overrides ----------------------------------------------
- @Override
- public String toString()
- {
- return "MBeanProxy for " + objectName + " (Agent ID: " + AgentID.get(server) + ")";
- }
-
-
- // Private -------------------------------------------------------
-
- private Object handleObjectMethods(Method method, Object[] args)
- throws InstanceNotFoundException, ReflectionException,
- IntrospectionException, MBeanException
- {
- if (method.getName().equals("toString"))
- {
- if (delegateToStringToResource)
- return server.invoke(objectName, "toString", null, null);
- else
- return toString();
- }
-
- else if (method.getName().equals("equals"))
- {
- if (delegateEqualsToResource)
- {
- return server.invoke(objectName, "equals",
- new Object[] { args[0] },
- new String[] { "java.lang.Object" }
- );
- }
- else if (Proxy.isProxyClass(args[0].getClass()))
- {
- Proxy prxy = (Proxy)args[0];
- return new Boolean(this.equals(Proxy.getInvocationHandler(prxy)));
- }
- else
- {
- return new Boolean(this.equals(args[0]));
- }
- }
-
- else if (method.getName().equals("hashCode"))
- {
- if (delegateHashCodeToResource)
- return server.invoke(objectName, "hashCode", null, null);
- else
- return new Integer(this.hashCode());
- }
-
- else throw new Error("Unexpected method invocation!");
- }
-
- private Object handleDynamicMBeanInvocation(Method method, Object[] args)
- throws InstanceNotFoundException, ReflectionException,
- IntrospectionException, MBeanException, AttributeNotFoundException,
- InvalidAttributeValueException
- {
- String methodName = method.getName();
-
- if (methodName.equals("setAttribute"))
- {
- server.setAttribute(objectName, (Attribute)args[0]);
- return null;
- }
- else if (methodName.equals("setAttributes"))
- return server.setAttributes(objectName, (AttributeList)args[0]);
- else if (methodName.equals("getAttribute"))
- return server.getAttribute(objectName, (String)args[0]);
- else if (methodName.equals("getAttributes"))
- return server.getAttributes(objectName, (String[])args[0]);
- else if (methodName.equals("invoke"))
- return server.invoke(objectName, (String)args[0], (Object[])args[1], (String[])args[2]);
- else if (methodName.equals("getMBeanInfo"))
- return server.getMBeanInfo(objectName);
-
- else throw new Error("Unexpected method invocation!");
- }
-
- private boolean isPrimitive(String type)
- {
- if (type.equals(Integer.TYPE.getName())) return true;
- if (type.equals(Long.TYPE.getName())) return true;
- if (type.equals(Boolean.TYPE.getName())) return true;
- if (type.equals(Byte.TYPE.getName())) return true;
- if (type.equals(Character.TYPE.getName())) return true;
- if (type.equals(Short.TYPE.getName())) return true;
- if (type.equals(Float.TYPE.getName())) return true;
- if (type.equals(Double.TYPE.getName())) return true;
- if (type.equals(Void.TYPE.getName())) return true;
-
- return false;
- }
-
- private Class getPrimitiveClass(String type)
- {
- if (type.equals(Integer.TYPE.getName())) return Integer.TYPE;
- if (type.equals(Long.TYPE.getName())) return Long.TYPE;
- if (type.equals(Boolean.TYPE.getName())) return Boolean.TYPE;
- if (type.equals(Byte.TYPE.getName())) return Byte.TYPE;
- if (type.equals(Character.TYPE.getName()))return Character.TYPE;
- if (type.equals(Short.TYPE.getName())) return Short.TYPE;
- if (type.equals(Float.TYPE.getName())) return Float.TYPE;
- if (type.equals(Double.TYPE.getName())) return Double.TYPE;
- if (type.equals(Void.TYPE.getName())) return Void.TYPE;
-
- return null;
- }
-
-}
-
-
-
-
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/MBeanProxy.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/MBeanProxy.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/MBeanProxy.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,119 +0,0 @@
-package org.jboss.seam.jmx;
-
-import java.lang.reflect.Proxy;
-
-import javax.management.DynamicMBean;
-import javax.management.InstanceAlreadyExistsException;
-import javax.management.MBeanException;
-import javax.management.MBeanRegistrationException;
-import javax.management.MBeanServer;
-import javax.management.MBeanServerFactory;
-import javax.management.NotCompliantMBeanException;
-import javax.management.ObjectName;
-import javax.management.ReflectionException;
-
-public class MBeanProxy
-{
-
- // Static --------------------------------------------------------
-
- /**
- * Creates a proxy to an MBean in the given MBean server.
- *
- * @param intrface the interface this proxy implements
- * @param name object name of the MBean this proxy connects to
- * @param agentID agent ID of the MBean server this proxy connects to
- *
- * @return proxy instance
- *
- * @throws MBeanProxyCreationException if the proxy could not be created
- */
- public static Object get(Class intrface, ObjectName name, String agentID) throws MBeanProxyCreationException
- {
- return get(intrface, name, (MBeanServer) MBeanServerFactory.findMBeanServer(agentID).get(0));
- }
-
- /**
- * Creates a proxy to an MBean in the given MBean server.
- *
- * @param intrface the interface this proxy implements
- * @param name object name of the MBean this proxy connects to
- * @param server MBean server this proxy connects to
- *
- * @return proxy instance
- *
- * @throws MBeanProxyCreationException if the proxy could not be created
- */
- public static Object get(Class intrface, ObjectName name, MBeanServer server) throws MBeanProxyCreationException
- {
- return get(new Class[] { intrface, ProxyContext.class, DynamicMBean.class }, name, server);
- }
-
- /**
- */
- public static Object get(ObjectName name, MBeanServer server) throws MBeanProxyCreationException
- {
- return get(new Class[] { ProxyContext.class, DynamicMBean.class }, name, server);
- }
-
- private static Object get(Class[] interfaces, ObjectName name, MBeanServer server) throws MBeanProxyCreationException
- {
- return Proxy.newProxyInstance(
- Thread.currentThread().getContextClassLoader(),
- interfaces, new JMXInvocationHandler(server, name)
- );
- }
-
- /**
- * Convenience method for registering an MBean and retrieving a proxy for it.
- *
- * @param instance MBean instance to be registered
- * @param intrface the interface this proxy implements
- * @param name object name of the MBean
- * @param agentID agent ID of the MBean server this proxy connects to
- *
- * @return proxy instance
- *
- * @throws MBeanProxyCreationException if the proxy could not be created
- */
- public static Object create(Class instance, Class intrface, ObjectName name, String agentID) throws MBeanProxyCreationException
- {
- return create(instance, intrface, name,(MBeanServer) MBeanServerFactory.findMBeanServer(agentID).get(0));
- }
-
- /**
- * Convenience method for registering an MBean and retrieving a proxy for it.
- *
- * @param instance MBean instance to be registered
- * @param intrface the interface this proxy implements
- * @param name object name of the MBean
- * @param server MBean server this proxy connects to
- *
- * @throws MBeanProxyCreationException if the proxy could not be created
- */
- public static Object create(Class instance, Class intrface, ObjectName name, MBeanServer server) throws MBeanProxyCreationException
- {
- try
- {
- server.createMBean(instance.getName(), name);
- return get(intrface, name, server);
- }
- catch (ReflectionException e) {
- throw new MBeanProxyCreationException("Creating the MBean failed: " + e.toString());
- }
- catch (InstanceAlreadyExistsException e) {
- throw new MBeanProxyCreationException("Instance already exists: " + name);
- }
- catch (MBeanRegistrationException e) {
- throw new MBeanProxyCreationException("Error registering the MBean to the server: " + e.toString());
- }
- catch (MBeanException e) {
- throw new MBeanProxyCreationException(e.toString());
- }
- catch (NotCompliantMBeanException e) {
- throw new MBeanProxyCreationException("Not a compliant MBean " + instance.getClass().getName() + ": " + e.toString());
- }
- }
-
-}
-
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/MBeanProxyCreationException.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/MBeanProxyCreationException.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/MBeanProxyCreationException.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,24 +0,0 @@
-package org.jboss.seam.jmx;
-
-import javax.management.JMException;
-
-public class MBeanProxyCreationException
- extends JMException
-{
- private static final long serialVersionUID = 1008637966352433381L;
-
- // Constructors --------------------------------------------------
- public MBeanProxyCreationException()
- {
- super();
- }
-
- public MBeanProxyCreationException(String msg)
- {
- super(msg);
- }
-}
-
-
-
-
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/Mbean.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/Mbean.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/Mbean.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,46 +0,0 @@
-package org.jboss.seam.jmx;
-
-import javax.management.ObjectName;
-
-import org.jboss.seam.annotations.Unwrap;
-
-public class Mbean
-{
- String objectName;
- String agentId;
- String proxyClass;
-
- public String getAgentId() {
- return agentId;
- }
-
- public void setAgentId(String agentId) {
- this.agentId = agentId;
- }
-
- public String getObjectName() {
- return objectName;
- }
-
- public void setObjectName(String objectName) {
- this.objectName = objectName;
- }
-
- public String getProxyClass() {
- return proxyClass;
- }
-
- public void setProxyClass(String proxyClass) {
- this.proxyClass = proxyClass;
- }
-
- @Unwrap
- public Object createProxy() {
- try {
- Object o = MBeanProxy.get(Class.forName(proxyClass), new ObjectName(getObjectName()), getAgentId());
- return o;
- } catch (Exception e) {
- throw new RuntimeException(e);
- }
- }
-}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/ProxyContext.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/ProxyContext.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/ProxyContext.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,23 +0,0 @@
-package org.jboss.seam.jmx;
-
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-/**
- *
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision: 81019 $
- *
- */
-public interface ProxyContext
-{
- void setExceptionHandler(ProxyExceptionHandler handler);
-
- MBeanServer getMBeanServer();
-
- ObjectName getObjectName();
-}
-
-
-
-
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/ProxyExceptionHandler.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/ProxyExceptionHandler.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/ProxyExceptionHandler.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,40 +0,0 @@
-package org.jboss.seam.jmx;
-
-import java.lang.reflect.Method;
-
-import javax.management.InstanceNotFoundException;
-import javax.management.AttributeNotFoundException;
-import javax.management.InvalidAttributeValueException;
-import javax.management.MBeanException;
-import javax.management.ReflectionException;
-import javax.management.RuntimeOperationsException;
-import javax.management.RuntimeMBeanException;
-import javax.management.RuntimeErrorException;
-
-/**
- *
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision: 81019 $
- */
-public interface ProxyExceptionHandler
-{
- public Object handleInstanceNotFound(ProxyContext ctx, InstanceNotFoundException e, Method m, Object[] args) throws Exception;
-
- public Object handleAttributeNotFound(ProxyContext ctx, AttributeNotFoundException e, Method m, Object[] args) throws Exception;
-
- public Object handleInvalidAttributeValue(ProxyContext ctx, InvalidAttributeValueException e, Method m, Object[] args) throws Exception;
-
- public Object handleMBeanException(ProxyContext ctx, MBeanException e, Method m, Object[] args) throws Exception;
-
- public Object handleReflectionException(ProxyContext ctx, ReflectionException e, Method m, Object[] args) throws Exception;
-
- public Object handleRuntimeOperationsException(ProxyContext ctx, RuntimeOperationsException e, Method m, Object[] args) throws Exception;
-
- public Object handleRuntimeMBeanException(ProxyContext ctx, RuntimeMBeanException e, Method m, Object[] args) throws Exception;
-
- public Object handleRuntimeError(ProxyContext ctx, RuntimeErrorException e, Method m, Object[] args) throws Exception;
-}
-
-
-
-
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/RuntimeProxyException.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/RuntimeProxyException.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jmx/RuntimeProxyException.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,29 +0,0 @@
-package org.jboss.seam.jmx;
-
-import javax.management.JMRuntimeException;
-
-/**
- *
- * @author <a href="mailto:juha at jboss.org">Juha Lindfors</a>.
- * @version $Revision: 81019 $
- */
-public class RuntimeProxyException
- extends JMRuntimeException
-{
- private static final long serialVersionUID = -1166909485463779459L;
-
- // Constructors --------------------------------------------------
- public RuntimeProxyException()
- {
- super();
- }
-
- public RuntimeProxyException(String msg)
- {
- super(msg);
- }
-}
-
-
-
-
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jsf/SeamNavigationHandler.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jsf/SeamNavigationHandler.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jsf/SeamNavigationHandler.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -11,7 +11,7 @@
import org.jboss.seam.core.Init;
import org.jboss.seam.faces.FacesManager;
import org.jboss.seam.navigation.Pages;
-import org.jboss.seam.pageflow.Pageflow;
+//import org.jboss.seam.pageflow.Pageflow;
/**
* Adds three new navigation possibilities beyond the
@@ -40,10 +40,10 @@
{
FacesManager.instance().interpolateAndRedirect(outcome);
}
- else if ( Init.instance().isJbpmInstalled() && Pageflow.instance().isInProcess() && Pageflow.instance().hasTransition(outcome) )
- {
- Pageflow.instance().navigate(context, outcome);
- }
+// else if ( Init.instance().isJbpmInstalled() && Pageflow.instance().isInProcess() && Pageflow.instance().hasTransition(outcome) )
+// {
+// Pageflow.instance().navigate(context, outcome);
+// }
else if ( !Pages.instance().navigate(context, fromAction, outcome) )
{
baseNavigationHandler.handleNavigation(context, fromAction, outcome);
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jsf/SeamPhaseListener.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jsf/SeamPhaseListener.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/jsf/SeamPhaseListener.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -40,7 +40,7 @@
import org.jboss.seam.log.LogProvider;
import org.jboss.seam.log.Logging;
import org.jboss.seam.navigation.Pages;
-import org.jboss.seam.pageflow.Pageflow;
+//import org.jboss.seam.pageflow.Pageflow;
import org.jboss.seam.persistence.PersistenceContexts;
import org.jboss.seam.transaction.Transaction;
import org.jboss.seam.transaction.UserTransaction;
@@ -541,10 +541,10 @@
Manager.instance().handleConversationPropagation(parameters);
- if ( Init.instance().isJbpmInstalled() && !isExceptionHandlerRedirect() )
- {
- Pageflow.instance().validatePageflow(facesContext);
- }
+// if ( Init.instance().isJbpmInstalled() && !isExceptionHandlerRedirect() )
+// {
+// Pageflow.instance().validatePageflow(facesContext);
+// }
Pages.instance().postRestore(facesContext);
}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/mock/AbstractSeamTest.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/mock/AbstractSeamTest.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/mock/AbstractSeamTest.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -53,7 +53,7 @@
import org.jboss.seam.init.Initialization;
import org.jboss.seam.jsf.SeamPhaseListener;
import org.jboss.seam.mail.MailSession;
-import org.jboss.seam.pageflow.Pageflow;
+//import org.jboss.seam.pageflow.Pageflow;
import org.jboss.seam.servlet.SeamFilter;
import org.jboss.seam.servlet.ServletSessionMap;
import org.jboss.seam.transaction.Transaction;
@@ -400,15 +400,15 @@
*/
protected String getRenderedViewId()
{
- if (Init.instance().isJbpmInstalled() && Pageflow.instance().isInProcess())
+ /*if (Init.instance().isJbpmInstalled() && Pageflow.instance().isInProcess())
{
return Pageflow.instance().getPageViewId();
}
else
- {
+ {*/
// TODO: not working right now, 'cos no mock navigation handler!
return getFacesContext().getViewRoot().getViewId();
- }
+// }
}
/**
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/ConversationControl.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/ConversationControl.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/ConversationControl.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -5,7 +5,7 @@
import org.jboss.seam.core.ConversationEntry;
import org.jboss.seam.core.Manager;
import org.jboss.seam.core.Expressions.ValueExpression;
-import org.jboss.seam.pageflow.Pageflow;
+//import org.jboss.seam.pageflow.Pageflow;
/**
*
* Demarcation of the conversation in pages.xml
@@ -78,7 +78,7 @@
}
if ( pageflow!=null )
{
- Pageflow.instance().begin(pageflow);
+ // Pageflow.instance().begin(pageflow);
}
}
}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/Page.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/Page.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/Page.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -43,7 +43,7 @@
private boolean conversationRequired;
private boolean loginRequired;
private ConversationControl conversationControl = new ConversationControl();
- private TaskControl taskControl = new TaskControl();
+ // private TaskControl taskControl = new TaskControl();
private ProcessControl processControl = new ProcessControl();
private ConversationIdParameter conversationIdParameter;
private List<String> eventTypes = new ArrayList<String>();
@@ -234,10 +234,10 @@
return conversationControl;
}
- public TaskControl getTaskControl()
- {
- return taskControl;
- }
+// public TaskControl getTaskControl()
+// {
+// return taskControl;
+// }
public ProcessControl getProcessControl()
{
@@ -287,7 +287,7 @@
boolean result = false;
getConversationControl().beginOrEndConversation();
- getTaskControl().beginOrEndTask();
+ // getTaskControl().beginOrEndTask();
getProcessControl().createOrResumeProcess();
for ( Input in: getInputs() ) in.in();
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/Pages.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/Pages.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/Pages.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -56,7 +56,7 @@
import org.jboss.seam.international.StatusMessage;
import org.jboss.seam.log.LogProvider;
import org.jboss.seam.log.Logging;
-import org.jboss.seam.pageflow.Pageflow;
+//import org.jboss.seam.pageflow.Pageflow;
import org.jboss.seam.security.Identity;
import org.jboss.seam.security.NotLoggedInException;
import org.jboss.seam.util.Resources;
@@ -581,7 +581,7 @@
}
else
{
- noConversationViewId = Pageflow.instance().getNoConversationViewId(pageflowName, pageflowNodeName);
+ //noConversationViewId = Pageflow.instance().getNoConversationViewId(pageflowName, pageflowNodeName);
}
if (noConversationViewId!=null)
@@ -1135,7 +1135,7 @@
parsePage(page, element, viewId);
parseConversationControl( element, page.getConversationControl() );
- parseTaskControl(element, page.getTaskControl());
+ //parseTaskControl(element, page.getTaskControl());
parseProcessControl(element, page.getProcessControl());
List<Element> children = element.elements("param");
for (Element param: children)
@@ -1339,7 +1339,7 @@
/**
* Parse begin-task, start-task and end-task
*/
- private static void parseTaskControl(Element element, TaskControl control)
+ /* private static void parseTaskControl(Element element, TaskControl control)
{
Element endTask = element.element("end-task");
if ( endTask!=null )
@@ -1388,7 +1388,7 @@
{
throw new IllegalStateException("cannot use both <start-task/> and <end-task/>");
}
- }
+ }*/
/**
* Parse create-process and end-process
@@ -1451,7 +1451,7 @@
parseEvent(element, rule);
parseNavigationHandler(element, rule);
parseConversationControl( element, rule.getConversationControl() );
- parseTaskControl(element, rule.getTaskControl());
+ //parseTaskControl(element, rule.getTaskControl());
parseProcessControl(element, rule.getProcessControl());
navigation.setRule(rule);
@@ -1550,7 +1550,7 @@
}
parseConversationControl( element, rule.getConversationControl() );
- parseTaskControl(element, rule.getTaskControl());
+ //parseTaskControl(element, rule.getTaskControl());
parseProcessControl(element, rule.getProcessControl());
parseEvent(element, rule);
parseNavigationHandler(element, rule);
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/ProcessControl.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/ProcessControl.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/ProcessControl.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,6 +1,6 @@
package org.jboss.seam.navigation;
-import org.jboss.seam.bpm.BusinessProcess;
+//import org.jboss.seam.bpm.BusinessProcess;
import org.jboss.seam.core.Expressions.ValueExpression;
/**
@@ -19,11 +19,11 @@
{
if ( createProcess() )
{
- BusinessProcess.instance().createProcess(definition);
+ //BusinessProcess.instance().createProcess(definition);
}
if ( resumeProcess() )
{
- BusinessProcess.instance().resumeProcess( processId.getValue() );
+ //BusinessProcess.instance().resumeProcess( processId.getValue() );
}
}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/Rule.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/Rule.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/Rule.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -21,7 +21,7 @@
private ValueExpression condition;
private List<Output> outputs = new ArrayList<Output>();
private ConversationControl conversationControl = new ConversationControl();
- private TaskControl taskControl = new TaskControl();
+ //private TaskControl taskControl = new TaskControl();
private ProcessControl processControl = new ProcessControl();
private List<NavigationHandler> navigationHandlers = new ArrayList<NavigationHandler>();
private List<String> eventTypes = new ArrayList<String>();
@@ -48,10 +48,10 @@
return conversationControl;
}
- public TaskControl getTaskControl()
- {
- return taskControl;
- }
+// public TaskControl getTaskControl()
+// {
+// return taskControl;
+// }
public ProcessControl getProcessControl()
{
@@ -86,7 +86,7 @@
public boolean execute(FacesContext context)
{
getConversationControl().beginOrEndConversation();
- getTaskControl().beginOrEndTask();
+ //getTaskControl().beginOrEndTask();
getProcessControl().createOrResumeProcess();
for ( Output output: getOutputs() )
{
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/TaskControl.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/TaskControl.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/navigation/TaskControl.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,105 +0,0 @@
-package org.jboss.seam.navigation;
-
-import org.jboss.seam.bpm.BusinessProcess;
-import org.jboss.seam.core.Expressions.ValueExpression;
-
-public class TaskControl
-{
-
- private boolean isBeginTask;
-
- private boolean isStartTask;
-
- private boolean isEndTask;
-
- private ValueExpression<Long> taskId;
-
- private ValueExpression<String> transition;
-
- public void beginOrEndTask()
- {
- if ( endTask() )
- {
- BusinessProcess.instance().validateTask();
- BusinessProcess.instance().endTask(transition == null ? null : transition.getValue());
- }
- if ( beginTask() || startTask() )
- {
- if (taskId==null || taskId.getValue() == null)
- {
- throw new NullPointerException("task id may not be null");
- }
- BusinessProcess.instance().resumeTask(taskId.getValue());
- }
- if ( startTask() )
- {
- BusinessProcess.instance().startTask();
- }
- }
-
- private boolean beginTask()
- {
- return isBeginTask && taskId.getValue() != null;
- }
-
- private boolean startTask()
- {
- return isStartTask && taskId.getValue() != null;
- }
-
- private boolean endTask()
- {
- return isEndTask;
- }
-
- public boolean isBeginTask()
- {
- return isBeginTask;
- }
-
- public void setBeginTask(boolean isBeginTask)
- {
- this.isBeginTask = isBeginTask;
- }
-
- public boolean isEndTask()
- {
- return isEndTask;
- }
-
- public void setEndTask(boolean isEndTask)
- {
- this.isEndTask = isEndTask;
- }
-
- public boolean isStartTask()
- {
- return isStartTask;
- }
-
- public void setStartTask(boolean isStartTask)
- {
- this.isStartTask = isStartTask;
- }
-
- public void setTaskId(ValueExpression<Long> taskId)
- {
- this.taskId = taskId;
- }
-
- public ValueExpression<Long> getTaskId()
- {
- return taskId;
- }
-
- public ValueExpression<String> getTransition()
- {
- return transition;
- }
-
- public void setTransition(ValueExpression<String> transition)
- {
- this.transition = transition;
- }
-
-}
\ No newline at end of file
Deleted: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/pageflow/Page.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/pageflow/Page.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/pageflow/Page.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,193 +0,0 @@
-package org.jboss.seam.pageflow;
-
-import org.dom4j.Element;
-import org.jboss.seam.bpm.BusinessProcess;
-import org.jboss.seam.core.Conversation;
-import org.jboss.seam.core.Interpolator;
-import org.jbpm.graph.def.Node;
-import org.jbpm.graph.exe.ExecutionContext;
-import org.jbpm.jpdl.xml.JpdlXmlReader;
-import org.jbpm.jpdl.xml.Parsable;
-
-/**
- * A page node in a jPDL pageflow
- *
- * @author Tom Baeyens
- * @author Gavin King
- *
- */
-public class Page extends Node implements Parsable
-{
-
- // This classname is configured in the jbpm configuration
- // file : org/jbpm/graph/node/node.types.xml inside
- // the jbpm-{version}.jar
-
- // In case it would be necessary, that file, can be customized
- // by updating the reference to it in the central jbpm configuration
- // file 'jbpm.cfg.xml'
-
- private static final long serialVersionUID = 1L;
-
- private String viewId;
- private boolean isConversationEnd = false;
- private boolean isConversationEndBeforeRedirect = false;
- private boolean isTaskEnd = false;
- private String transition;
- private String processToCreate;
- private boolean redirect;
- private String description;
- private Integer timeout;
- private boolean backEnabled;
- private boolean switchEnabled;
- private String noConversationViewId;
-
- /**
- * parses the dom4j element that corresponds to this page.
- */
- @Override
- public void read(Element pageElement, JpdlXmlReader jpdlXmlReader)
- {
- super.read(pageElement, jpdlXmlReader);
- viewId = pageElement.attributeValue("view-id");
- if (viewId==null)
- {
- throw new IllegalStateException("must specify view-id for <page/> node: " + pageElement.attributeValue("name"));
- }
- noConversationViewId = pageElement.attributeValue("no-conversation-view-id");
- backEnabled = "enabled".equals( pageElement.attributeValue("back") );
- switchEnabled = !"disabled".equals( pageElement.attributeValue("switch") );
- Element endConversationElement = pageElement.element("end-conversation");
- if ( endConversationElement!=null )
- {
- isConversationEnd = true;
- isConversationEndBeforeRedirect = Boolean.parseBoolean( endConversationElement.attributeValue("before-redirect") );
- processToCreate = endConversationElement.attributeValue("create-process");
- }
- Element endTaskElement = pageElement.element("end-task");
- if (endTaskElement!=null)
- {
- isTaskEnd = true;
- transition = endTaskElement.attributeValue("transition");
- }
- redirect = Boolean.parseBoolean( pageElement.attributeValue("redirect") );
- if ( pageElement.element("redirect")!=null )
- {
- redirect = true;
- }
- Element descriptionElement = pageElement.element("description");
- if (descriptionElement!=null)
- {
- description = descriptionElement.getTextTrim();
- }
- String timeoutString = pageElement.attributeValue("timeout");
- if ( timeoutString!=null )
- {
- timeout = Integer.valueOf(timeoutString);
- }
- }
-
- /**
- * is executed when execution arrives in this page at runtime.
- */
- @Override
- public void execute(ExecutionContext executionContext)
- {
- if ( isConversationEnd && processToCreate!=null )
- {
- BusinessProcess.instance().createProcess(processToCreate);
- }
-
- if ( isTaskEnd )
- {
- BusinessProcess.instance().endTask(transition);
- }
-
- if (isConversationEnd || isTaskEnd )
- {
- if (isConversationEndBeforeRedirect)
- {
- Conversation.instance().endBeforeRedirect();
- }
- else
- {
- Conversation.instance().end();
- }
- }
- if (getAction() != null)
- {
- try
- {
- getAction().execute(executionContext);
- }
- catch (Exception e)
- {
- raiseException(e, executionContext);
- }
- }
- }
-
- public boolean isConversationEnd()
- {
- return isConversationEnd;
- }
-
- public String getTransition()
- {
- return transition;
- }
-
- public String getViewId()
- {
- return Interpolator.instance().interpolate(viewId);
- }
-
- public boolean isRedirect()
- {
- return redirect;
- }
-
- public boolean hasDescription()
- {
- return description!=null;
- }
-
- @Override
- public String getDescription() {
- return Interpolator.instance().interpolate(description);
- }
-
- public Integer getTimeout() {
- return timeout;
- }
-
- public boolean isBackEnabled()
- {
- return backEnabled;
- }
-
- public boolean isSwitchEnabled()
- {
- return switchEnabled;
- }
-
- public String getNoConversationViewId()
- {
- return noConversationViewId;
- }
-
- protected boolean isTaskEnd()
- {
- return isTaskEnd;
- }
-
- protected String getProcessToCreate()
- {
- return processToCreate;
- }
-
- public boolean isConversationEndBeforeRedirect()
- {
- return isConversationEndBeforeRedirect;
- }
-}
Deleted: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/pageflow/Pageflow.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/pageflow/Pageflow.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/pageflow/Pageflow.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,493 +0,0 @@
-package org.jboss.seam.pageflow;
-
-import static org.jboss.seam.annotations.Install.BUILT_IN;
-
-import java.io.Serializable;
-import java.util.List;
-
-import javax.faces.component.UIViewRoot;
-import javax.faces.context.FacesContext;
-import javax.faces.event.PhaseId;
-
-import org.jboss.seam.Component;
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Install;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.PerNestedConversation;
-import org.jboss.seam.annotations.Scope;
-import org.jboss.seam.annotations.intercept.BypassInterceptors;
-import org.jboss.seam.bpm.Jbpm;
-import org.jboss.seam.contexts.Contexts;
-import org.jboss.seam.contexts.FacesLifecycle;
-import org.jboss.seam.core.AbstractMutable;
-import org.jboss.seam.core.Events;
-import org.jboss.seam.faces.FacesManager;
-import org.jboss.seam.faces.FacesPage;
-import org.jboss.seam.international.StatusMessage;
-import org.jboss.seam.international.StatusMessages;
-import org.jboss.seam.log.LogProvider;
-import org.jboss.seam.log.Logging;
-import org.jboss.seam.navigation.Pages;
-import org.jbpm.JbpmContext;
-import org.jbpm.graph.def.Action;
-import org.jbpm.graph.def.Event;
-import org.jbpm.graph.def.Node;
-import org.jbpm.graph.def.ProcessDefinition;
-import org.jbpm.graph.exe.ExecutionContext;
-import org.jbpm.graph.exe.ProcessInstance;
-
-/**
- * A Seam component that manages the current
- * jBPM ProcessInstance used for pageflow.
- *
- * @author Gavin King
- */
- at Scope(ScopeType.CONVERSATION)
- at PerNestedConversation
- at Name("org.jboss.seam.pageflow.pageflow")
- at BypassInterceptors
- at Install(dependencies="org.jboss.seam.bpm.jbpm", precedence=BUILT_IN, classDependencies="javax.faces.context.FacesContext")
-public class Pageflow extends AbstractMutable implements Serializable
-{
- private static final long serialVersionUID = -2337682140346213333L;
-
- private static final LogProvider log = Logging.getLogProvider(Pageflow.class);
-
- private int counter;
-
- private ProcessInstance processInstance;
-
- public boolean isInProcess()
- {
- return processInstance!=null;
- }
-
- public boolean isStarted()
- {
- return getSubProcessInstance().getRootToken().getNode() != null;
- }
-
- public ProcessInstance getProcessInstance()
- {
- return processInstance;
- }
-
- public void setProcessInstance(ProcessInstance processInstance)
- {
- this.processInstance = processInstance;
- setDirty();
- }
-
- public static Pageflow instance()
- {
- if ( !Contexts.isConversationContextActive() )
- {
- throw new IllegalStateException("No active conversation context");
- }
- return (Pageflow) Component.getInstance(Pageflow.class, ScopeType.CONVERSATION);
- }
-
- /**
- * Get the current counter value, used for detecting
- * illegal use of the backbutton.
- */
- public int getPageflowCounter()
- {
- return counter;
- }
-
- /**
- * Check that the current state of the pageflow matches
- * what is expected by the faces request.
- */
- public void validatePageflow(FacesContext facesContext)
- {
- if ( processInstance!=null )
- {
- org.jboss.seam.faces.FacesPage page = org.jboss.seam.faces.FacesPage.instance();
- String pageflowName = page.getPageflowName();
- String pageflowNodeName = page.getPageflowNodeName();
- boolean canReposition = getPage().isBackEnabled() &&
- getSubProcessInstance().getProcessDefinition().getName().equals(pageflowName) && //possibly not necessary?
- pageflowNodeName!=null;
- if (canReposition)
- {
- //check the node name to make sure we are still on the same node
- if ( !pageflowNodeName.equals( getNode().getName() ) )
- {
- //legal use of back/forward button, so reposition the pageflow
- reposition(pageflowNodeName);
- }
- }
- else
- {
- //check the counter to detect illegal use of backbutton
- //(we user counter instead of view id since multiple
- //nodes can share the same view id)
- Integer pageCounter = org.jboss.seam.faces.FacesPage.instance().getPageflowCounter();
- if ( pageCounter!=null && getPageflowCounter()!=pageCounter )
- {
- illegalNavigationError();
- }
- }
-
- //now check that the restored view id matches what we expect
- //from the pageflow node
- //TODO: we need some way to disable this check, since users
- // might want some adhoc nav in and out of a pageflow?
- String viewId = Pages.getViewId(facesContext);
- if ( !viewId.equals( getPage().getViewId() ) )
- {
- illegalNavigationError();
- }
- }
- }
-
- private void illegalNavigationError()
- {
- FacesContext context = FacesContext.getCurrentInstance();
- navigate(context);
- illegalNavigation();
- context.renderResponse();
- }
-
- /**
- * Add a message to indicate that illegal navigation
- * occurred. May be overridden by user to perform
- * special processing.
- */
- protected void illegalNavigation()
- {
- StatusMessages.instance().addFromResourceBundleOrDefault(
- StatusMessage.Severity.WARN,
- "org.jboss.seam.IllegalNavigation",
- "Illegal navigation"
- );
- }
-
- /**
- * Get the current Node of the pageflow.
- */
- public Node getNode()
- {
- if (processInstance==null) return null;
- Node node = getSubProcessInstance().getRootToken().getNode();
- if (node==null)
- {
- throw new IllegalStateException("pageflow has not yet started");
- }
- return node;
- }
-
- public ProcessInstance getSubProcessInstance()
- {
- return getSubProcess(processInstance);
- }
-
- private static ProcessInstance getSubProcess(ProcessInstance processInstance)
- {
- ProcessInstance subProcess = processInstance.getRootToken().getSubProcessInstance();
- if (subProcess!=null)
- {
- return getSubProcess(subProcess);
- }
- else
- {
- return processInstance;
- }
- }
-
- /**
- * Reposition the pageflow at the named node.
- *
- * @param nodeName the name of a node
- */
- public void reposition(String nodeName)
- {
- if (processInstance==null)
- {
- throw new IllegalStateException("no pageflow in progress");
- }
- ProcessInstance subProcess = getSubProcessInstance();
- Node node = subProcess.getProcessDefinition().getNode(nodeName);
- if (node==null)
- {
- throw new IllegalArgumentException(
- "no node named: " + nodeName +
- " for pageflow: " + subProcess.getProcessDefinition().getName()
- );
- }
- subProcess.getRootToken().setNode(node);
- setDirty();
- }
-
- /**
- * Get the current Page of the pageflow.
- */
- public Page getPage()
- {
- Node node = getNode();
- if ( node!=null && !(node instanceof Page) )
- {
- throw new IllegalStateException("pageflow is not currently at a <page> or <start-page> node (note that pageflows that begin during the RENDER_RESPONSE phase should use <start-page> instead of <start-state>)");
- }
- return (Page) node;
- }
-
- /**
- * Navigate to the current page.
- */
- protected void navigate(FacesContext context)
- {
- Page page = getPage();
- if ( !page.isRedirect() )
- {
- render(context, page);
- }
- else
- {
- redirect(page);
- }
-
- counter++;
- setDirty();
- }
-
- /**
- * Redirect to the Page.
- */
- protected void redirect(Page page)
- {
- FacesManager.instance().redirect( getViewId(page) );
- }
-
- /**
- * Proceed to render the Page.
- */
- protected void render(FacesContext context, Page page)
- {
- UIViewRoot viewRoot = context.getApplication().getViewHandler()
- .createView( context, getViewId(page) );
- context.setViewRoot(viewRoot);
- }
-
- /**
- * Allows the user to extend this class and use some
- * logical naming of pages other than the JSF view id
- * in their pageflow.
- *
- * @param page the Page object
- * @return a JSF view id
- */
- protected String getViewId(Page page)
- {
- return page.getViewId();
- }
-
- /**
- * Get the JSF view id of the current page in the
- * pageflow.
- */
- public String getPageViewId()
- {
- Page page = getPage();
- return page==null ? null : getViewId(page);
- }
-
- /**
- * Does the current node have a default transition?
- */
- public boolean hasDefaultTransition()
- {
- //we don't use jBPM's default transition,
- //instead we use the "anonymous" transition
- return getNode().getLeavingTransition(null)!=null;
- }
-
- private boolean isNullOutcome(String outcome)
- {
- return outcome==null || "".equals(outcome);
- }
-
- public boolean hasTransition(String outcome)
- {
- return isNullOutcome(outcome) ?
- hasDefaultTransition() :
- getNode().getLeavingTransition(outcome)!=null;
- }
-
- /**
- * Given the JSF action outcome, perform navigation according
- * to the current pageflow.
- */
- public void navigate(FacesContext context, String outcome)
- {
- ProcessInstance subProcess = getSubProcessInstance();
- if ( isNullOutcome(outcome) )
- {
- //if it has a default transition defined, trigger it,
- //otherwise just redisplay the page
- if ( hasDefaultTransition() )
- {
- //we don't use jBPM's default transition,
- //instead we use the "anonymous" transition
- Pageflow.signal(subProcess, null);
- navigate(context);
- }
- }
- else
- {
- //trigger the named transition
- Pageflow.signal(subProcess, outcome);
- navigate(context);
- }
-
- raiseEndEventIfNecessary();
- }
-
- protected void raiseEndEventIfNecessary()
- {
- if ( processInstance.hasEnded() )
- {
- Events.instance().raiseEvent(
- "org.jboss.seam.endPageflow." +
- processInstance.getProcessDefinition().getName()
- );
- Events.instance().raiseEvent(
- "org.jboss.seam.endPageflow");
- }
- }
-
- /**
- * Process events defined in the pageflow.
- *
- * @param type one of: "process-validations", "update-model-values",
- * "invoke-application", "render-response"
- */
- public void processEvents(String type)
- {
- Event event = getNode().getEvent(type);
- if (event!=null)
- {
- for ( Action action: (List<Action>) event.getActions() )
- {
- try
- {
- action.execute( ExecutionContext.currentExecutionContext() );
- }
- catch (Exception e)
- {
- throw new RuntimeException(e);
- }
- }
- }
- }
-
- /**
- * Begin executing a pageflow.
- *
- * @param pageflowDefinitionName the name of the pageflow definition
- */
- public void begin(String pageflowDefinitionName)
- {
- if ( log.isDebugEnabled() )
- {
- log.debug("beginning pageflow: " + pageflowDefinitionName);
- }
-
- processInstance = Pageflow.createInstance( getPageflowProcessDefinition(pageflowDefinitionName) );
-
- //if ( Lifecycle.getPhaseId().equals(PhaseId.RENDER_RESPONSE) )
- //{
- //if a pageflow starts during the render response phase
- //(as a result of a @Create method), we know the navigation
- //handler will not get called, so we should force the
- //pageflow out of the start state immediately
- //TODO: this is not actually completely true, what about <s:actionLink/>
- //pi.signal();
- //}
-
- setDirty();
-
- raiseBeginEvent(pageflowDefinitionName);
-
- storePageflowToViewRootIfNecessary();
-
- }
-
- protected void raiseBeginEvent(String pageflowDefinitionName)
- {
- Events.instance().raiseEvent("org.jboss.seam.beginPageflow." + pageflowDefinitionName);
- Events.instance().raiseEvent("org.jboss.seam.beginPageflow");
- }
-
- private void storePageflowToViewRootIfNecessary()
- {
- FacesContext facesContext = FacesContext.getCurrentInstance();
- if ( facesContext!=null && FacesLifecycle.getPhaseId()==PhaseId.RENDER_RESPONSE )
- {
- FacesPage.instance().storePageflow();
- }
- }
-
- public String getNoConversationViewId(String pageflowName, String pageflowNodeName)
- {
- ProcessDefinition pageflowProcessDefinition = getPageflowProcessDefinition(pageflowName);
- Node node = pageflowProcessDefinition.getNode(pageflowNodeName);
- if (node!=null && node instanceof Page)
- {
- return ( (Page) node ).getNoConversationViewId();
- }
- else
- {
- return null;
- }
- }
-
- protected ProcessDefinition getPageflowProcessDefinition(String pageflowName)
- {
- ProcessDefinition pageflowProcessDefinition = Jbpm.instance().getPageflowProcessDefinition(pageflowName);
- if (pageflowProcessDefinition==null)
- {
- throw new IllegalArgumentException("pageflow definition not found: " + pageflowName);
- }
- return pageflowProcessDefinition;
- }
-
- @Override
- public String toString()
- {
- String name = processInstance==null ?
- "null" : processInstance.getProcessDefinition().getName();
- return "Pageflow(" + name + ")";
- }
-
- private static ProcessInstance createInstance(ProcessDefinition processDefinition)
- {
- JbpmContext jbpmContext = Jbpm.createPageflowContext();
- try
- {
- log.debug( "new pageflow instance for definition: " + processDefinition.getName() );
- return processDefinition.createProcessInstance();
- }
- finally
- {
- jbpmContext.close();
- }
- }
-
- private static void signal(ProcessInstance processInstance, String outcome)
- {
- JbpmContext jbpmContext = Jbpm.createPageflowContext();
- try
- {
- log.debug("signaling pageflow transition for outcome: " + outcome);
- processInstance.signal(outcome);
- }
- finally
- {
- jbpmContext.close();
- }
- }
-
-}
Deleted: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/pageflow/package-info.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/pageflow/package-info.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/pageflow/package-info.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,7 +0,0 @@
-/**
- * Support for jPDL-based pageflows.
- */
- at AutoCreate
-package org.jboss.seam.pageflow;
-
-import org.jboss.seam.annotations.AutoCreate;
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/servlet/SeamListener.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/servlet/SeamListener.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/servlet/SeamListener.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -14,7 +14,7 @@
import org.jboss.seam.Seam;
import org.jboss.seam.contexts.ServletLifecycle;
import org.jboss.seam.init.Initialization;
-import org.jboss.seam.jmx.JBossClusterMonitor;
+//import org.jboss.seam.jmx.JBossClusterMonitor;
import org.jboss.seam.log.LogProvider;
import org.jboss.seam.log.Logging;
@@ -48,16 +48,16 @@
public void sessionDestroyed(HttpSessionEvent event)
{
- JBossClusterMonitor monitor = JBossClusterMonitor.getInstance(event.getSession().getServletContext());
+ /*JBossClusterMonitor monitor = JBossClusterMonitor.getInstance(event.getSession().getServletContext());
if (monitor != null && monitor.failover())
{
// If application is unfarmed or all nodes shutdown simultaneously, cluster cache may still fail to retrieve SFSBs to destroy
log.debug("Detected fail-over, not destroying session context");
}
else
- {
+ {*/
ServletLifecycle.endSession( event.getSession() );
- }
+// }
}
}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/transaction/TransactionInterceptor.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/transaction/TransactionInterceptor.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/main/java/org/jboss/seam/transaction/TransactionInterceptor.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -11,7 +11,7 @@
import org.jboss.seam.annotations.Transactional;
import org.jboss.seam.annotations.intercept.AroundInvoke;
import org.jboss.seam.annotations.intercept.Interceptor;
-import org.jboss.seam.bpm.BusinessProcessInterceptor;
+//import org.jboss.seam.bpm.BusinessProcessInterceptor;
import org.jboss.seam.core.BijectionInterceptor;
import org.jboss.seam.core.ConversationInterceptor;
import org.jboss.seam.intercept.AbstractInterceptor;
@@ -25,7 +25,7 @@
* @author Shane Bryzak
*/
@Interceptor(stateless=false,
- around={RollbackInterceptor.class, BusinessProcessInterceptor.class,
+ around={RollbackInterceptor.class, //BusinessProcessInterceptor.class,
ConversationInterceptor.class, BijectionInterceptor.class})
public class TransactionInterceptor extends AbstractInterceptor
{
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/PageflowConfigurationTest.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/PageflowConfigurationTest.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/PageflowConfigurationTest.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,38 +0,0 @@
-package org.jboss.seam.test.unit;
-
-import org.jbpm.JbpmConfiguration;
-import org.jbpm.JbpmContext;
-import org.jbpm.graph.def.ProcessDefinition;
-import org.jbpm.graph.exe.ProcessInstance;
-import org.testng.annotations.Test;
-
-public class PageflowConfigurationTest{
-
- static JbpmConfiguration pageflowConfiguration = JbpmConfiguration.parseResource("org/jboss/seam/bpm/jbpm.pageflow.cfg.xml");
-
- @Test
- public void testOne() {
- JbpmContext jbpmContext = pageflowConfiguration.createJbpmContext();
- ProcessDefinition processDefinition = ProcessDefinition.parseXmlString(
- "<process-definition name='navigation'>" +
- " <start-state name='start'>" +
- " <transition to='a' />" +
- " </start-state>" +
- " <state name='a'>" +
- " <transition to='end' />" +
- " </state>" +
- " <end-state name='end' />" +
- "</process-definition>"
- );
-
- ProcessInstance processInstance = processDefinition.createProcessInstance();
-
- processInstance.signal();
- processInstance.signal();
-
- assert processInstance.hasEnded();
-
- jbpmContext.close();
- }
-
-}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/PageflowTest.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/PageflowTest.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/PageflowTest.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,110 +0,0 @@
-package org.jboss.seam.test.unit;
-
-import java.io.StringReader;
-
-import org.jboss.seam.bpm.PageflowParser;
-import org.jboss.seam.pageflow.Page;
-import org.jbpm.JbpmConfiguration;
-import org.jbpm.JbpmContext;
-import org.jbpm.graph.def.ProcessDefinition;
-import org.jbpm.graph.exe.ProcessInstance;
-import org.jbpm.graph.exe.Token;
-import org.jbpm.graph.node.StartState;
-import org.testng.annotations.Test;
-
-public class PageflowTest
-{
-
- JbpmConfiguration jbpmConfiguration = JbpmConfiguration.parseXmlString(
- "<jbpm-configuration />"
- );
-
- @Test
- public void testPageflowWithStartState() {
- JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
-
- StringReader stringReader = new StringReader(
- "<pageflow-definition name='hoepla'>" +
- " <start-state name='start' />" +
- "</pageflow-definition>"
- );
- PageflowParser pageflowParser = new PageflowParser(stringReader);
- ProcessDefinition processDefinition = pageflowParser.readProcessDefinition();
- assert "start".equals(processDefinition.getStartState().getName());
-
- jbpmContext.close();
- }
-
- @Test
- public void testPageflowWithStartPage() {
- JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
- StringReader stringReader = new StringReader(
- "<pageflow-definition name='hoepla'>" +
- " <start-page name='start' view-id='/start.xhtml'/>" +
- "</pageflow-definition>");
- PageflowParser pageflowParser = new PageflowParser(stringReader);
- ProcessDefinition processDefinition = pageflowParser.readProcessDefinition();
-
- assert "start".equals(processDefinition.getStartState().getName());
-
- jbpmContext.close();
- }
-
- @Test
- public void testPageflowWithStartPageAttribute() {
- JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
-
- StringReader stringReader = new StringReader(
- "<pageflow-definition name='hoepla' start-page='start'>" +
- " <page name='start' view-id='/start.xhtml'/>" +
- "</pageflow-definition>"
- );
- PageflowParser pageflowParser = new PageflowParser(stringReader);
- ProcessDefinition processDefinition = pageflowParser.readProcessDefinition();
- assert "start".equals(processDefinition.getStartState().getName());
-
- jbpmContext.close();
- }
-
- @Test
- public void testOrderPageflow() {
- StringReader stringReader = new StringReader(
- "<pageflow-definition name='checkout'>" +
- " <start-state name='start'>" +
- " <transition to='confirm'/>" +
- " </start-state>" +
- " <page name='confirm' view-id='/confirm.xhtml'>" +
- " <redirect/>" +
- " <transition name='update' to='continue'/>" +
- " <transition name='purchase' to='complete'>" +
- " <action expression='#{checkout.submitOrder}' />" +
- " </transition>" +
- " </page>" +
- " <page name='complete' view-id='/complete.xhtml'>" +
- " <redirect/>" +
- " <end-conversation/>" +
- " </page>" +
- " <page name='continue' view-id='/browse.xhtml'>" +
- " <end-conversation/>" +
- " </page>" +
- "</pageflow-definition>"
- );
- PageflowParser pageflowParser = new PageflowParser(stringReader);
- ProcessDefinition processDefinition = pageflowParser.readProcessDefinition();
-
- StartState start = (StartState) processDefinition.getStartState();
- Page confirm = (Page) processDefinition.getNode("confirm");
- Page complete = (Page) processDefinition.getNode("complete");
- Page cont = (Page) processDefinition.getNode("continue");
- assert confirm!=null;
- assert complete!=null;
- assert cont!=null;
-
- ProcessInstance processInstance = new ProcessInstance(processDefinition);
- Token token = processInstance.getRootToken();
- assert start.equals(token.getNode());
-
- processInstance.signal();
- }
-
-}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/bpm/ActorTest.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/bpm/ActorTest.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/bpm/ActorTest.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,72 +0,0 @@
-package org.jboss.seam.test.unit.bpm;
-
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Set;
-
-import org.jboss.seam.bpm.Actor;
-import org.testng.annotations.Test;
-
-/**
- * @author Pete Muir
- *
- */
-public class ActorTest
-{
-
- @Test
- public void testActorDirtyChecking()
- {
- // Test dirty checking on id
- Actor actor = new Actor();
- assert !actor.clearDirty();
- actor.setId("gavin");
- assert actor.clearDirty();
- actor.setId("pete");
- assert actor.clearDirty();
-
- // Test dirty checking on group actor ids
- actor.getGroupActorIds().add("manager");
- assert actor.clearDirty();
- actor.getGroupActorIds().remove("manager");
- assert actor.clearDirty();
- actor.getGroupActorIds().add("director");
- actor.clearDirty();
- assert !actor.clearDirty();
- actor.getGroupActorIds().clear();
- assert actor.clearDirty();
-
-
- Set<String> someAdditions = new HashSet<String>();
- someAdditions.add("engineering manager");
- someAdditions.add("sales manager");
- Set<String> additions = new HashSet<String>();
- additions.add("marketing manager");
- additions.addAll(someAdditions);
- actor.getGroupActorIds().addAll(additions);
- assert actor.getGroupActorIds().size() == 3;
- assert actor.clearDirty();
- actor.getGroupActorIds().removeAll(additions);
- assert actor.clearDirty();
- assert actor.getGroupActorIds().size() == 0;
-
- actor.getGroupActorIds().addAll(additions);
- assert actor.getGroupActorIds().size() == 3;
- actor.clearDirty();
- actor.getGroupActorIds().retainAll(someAdditions);
- assert actor.clearDirty();
- assert actor.getGroupActorIds().size() == 2;
-
- // Test dirt checking on group actor ids iterator
- actor.getGroupActorIds().add("slave");
- actor.clearDirty();
- Iterator it = actor.getGroupActorIds().iterator();
- assert it.hasNext();
- it.next();
- it.remove();
- assert actor.clearDirty();
-
-
- }
-
-}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/bpm/JbpmTest.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/bpm/JbpmTest.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/bpm/JbpmTest.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,57 +0,0 @@
-package org.jboss.seam.test.unit.bpm;
-
-import org.jboss.seam.bpm.Jbpm;
-import org.jbpm.graph.def.ProcessDefinition;
-import org.testng.annotations.Test;
-
-/**
- * @author Marek Novotny
- *
- */
-public class JbpmTest
-{
-
- private static final String PROCESS_DEFINITION = "<process-definition name=\"test\"> " +
- "<start-state name=\"start\"> " +
- " <transition to=\"decision\" /> " +
- "</start-state> " +
- "<decision name=\"decision\"> " +
- " <transition to=\"done\" name=\"true\" />" +
- " <transition to=\"done\" name=\"false\" /> " +
- "</decision> " +
- "<end-state name=\"done\"/> " +
- "</process-definition>";
-
- private static final String PAGE_FLOW_DEFINITION = "<pageflow-definition name=\"newuser\" >" +
- "<start-state name=\"start\">" +
- " <transition to=\"account\"/>" +
- "</start-state>" +
- "<page name=\"account\" view-id=\"/newuser/account.xhtml\">" +
- " <redirect/>" +
- " <transition name=\"next\" to=\"checkPassword\" />" +
- "</page>" +
- "</pageflow-definition>" ;
-
- @Test
- public void testGetProcessDefinitionFromXml()
- {
-
- Jbpm jbpm = new Jbpm();
- ProcessDefinition pd = jbpm.getProcessDefinitionFromXml(PROCESS_DEFINITION);
- assert "start".equals(pd.getStartState().getName());
- assert "test".equals(pd.getName());
-
- }
-
- @Test
- public void testGetPageflowDefinitionFromXml()
- {
-
- Jbpm jbpm = new Jbpm();
- ProcessDefinition pd = jbpm.getPageflowDefinitionFromXml(PAGE_FLOW_DEFINITION);
- assert "start".equals(pd.getStartState().getName());
- assert "newuser".equals(pd.getName());
-
- }
-
-}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/bpm/TaskListTest.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/bpm/TaskListTest.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/bpm/TaskListTest.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,64 +0,0 @@
-package org.jboss.seam.test.unit.bpm;
-
-import java.util.HashMap;
-
-import javax.transaction.Status;
-import javax.transaction.SystemException;
-
-import org.jboss.seam.Component;
-import org.jboss.seam.Seam;
-import org.jboss.seam.bpm.Actor;
-import org.jboss.seam.bpm.PooledTaskInstanceList;
-import org.jboss.seam.contexts.Context;
-import org.jboss.seam.contexts.Contexts;
-import org.jboss.seam.contexts.Lifecycle;
-import org.jboss.seam.init.Initialization;
-import org.jboss.seam.mock.MockServletContext;
-import org.jboss.seam.transaction.NoTransaction;
-import org.testng.annotations.AfterMethod;
-import org.testng.annotations.BeforeMethod;
-import org.testng.annotations.Test;
-
-public class TaskListTest
-{
- @BeforeMethod
- protected void setUp()
- {
- Lifecycle.beginApplication(new HashMap<String, Object>());
- new Initialization(new MockServletContext()).create().init();
- Lifecycle.setupApplication();
- installComponent(Contexts.getApplicationContext(), Actor.class);
- installComponent(Contexts.getApplicationContext(), PooledTaskInstanceList.class);
- installComponent(Contexts.getApplicationContext(), MockRolledBackTransaction.class);
- Lifecycle.beginCall();
- }
-
- @Test
- public void emptyPooledTaskListIfNoGroupActorIds()
- {
- Object pooledTaskInstanceList = Component.getInstance("org.jboss.seam.bpm.pooledTaskInstanceList");
- assert pooledTaskInstanceList == null;
- }
-
- @AfterMethod
- protected void tearDown()
- {
- Lifecycle.endApplication();
- }
-
- private void installComponent(Context appContext, Class clazz)
- {
- appContext.set(Seam.getComponentName(clazz) + ".component", new Component(clazz));
- }
-
- public static class MockRolledBackTransaction extends NoTransaction
- {
-
- @Override
- public int getStatus() throws SystemException
- {
- return Status.STATUS_MARKED_ROLLBACK;
- }
-
- }
-}
Modified: branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/testng.xml
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/testng.xml 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam/src/test/java/org/jboss/seam/test/unit/testng.xml 2012-10-08 12:31:58 UTC (rev 15212)
@@ -13,14 +13,14 @@
</classes>
</test>
- <test name="Seam Unit Tests BPM and Pageflow">
- <classes>
- <class name="org.jboss.seam.test.unit.bpm.ActorTest" />
- <class name="org.jboss.seam.test.unit.bpm.TaskListTest" />
- <class name="org.jboss.seam.test.unit.PageflowTest"/>
- <class name="org.jboss.seam.test.unit.bpm.JbpmTest"/>
- </classes>
- </test>
+<!-- <test name="Seam Unit Tests BPM and Pageflow"> -->
+<!-- <classes> -->
+<!-- <class name="org.jboss.seam.test.unit.bpm.ActorTest" /> -->
+<!-- <class name="org.jboss.seam.test.unit.bpm.TaskListTest" /> -->
+<!-- <class name="org.jboss.seam.test.unit.PageflowTest"/> -->
+<!-- <class name="org.jboss.seam.test.unit.bpm.JbpmTest"/> -->
+<!-- </classes> -->
+<!-- </test> -->
<test name="Seam Unit Tests JSF integration">
<classes>
Modified: branches/enterprise/WFK-2_1/jboss-seam-ioc/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam-ioc/pom.xml 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam-ioc/pom.xml 2012-10-08 12:31:58 UTC (rev 15212)
@@ -116,7 +116,7 @@
</goals>
<phase>package</phase>
<configuration>
- <excludeGroupIds>org.jboss.seam</excludeGroupIds>
+ <excludeGroupIds>org.jboss.seam, org.springframework</excludeGroupIds>
<excludeClassifiers>sources, project, distribution</excludeClassifiers>
<outputDirectory>../jar-dependencies</outputDirectory>
<stripVersion>true</stripVersion>
Modified: branches/enterprise/WFK-2_1/jboss-seam-ui/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam-ui/pom.xml 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam-ui/pom.xml 2012-10-08 12:31:58 UTC (rev 15212)
@@ -161,20 +161,7 @@
<scope>provided</scope>
</dependency>
-
<dependency>
- <groupId>org.jbpm.jbpm3</groupId>
- <artifactId>jbpm-jpdl</artifactId>
- <optional>true</optional>
- <exclusions>
- <exclusion>
- <groupId>commons-logging</groupId>
- <artifactId>commons-logging</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<scope>provided</scope>
Modified: branches/enterprise/WFK-2_1/jboss-seam-ui/src/main/java/org/jboss/seam/ui/component/UISeamCommandBase.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam-ui/src/main/java/org/jboss/seam/ui/component/UISeamCommandBase.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam-ui/src/main/java/org/jboss/seam/ui/component/UISeamCommandBase.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -105,13 +105,13 @@
url.addParameter(name);
}
- ValueExpression taskInstanceValueExpression = getValueExpression("taskInstance");
- if (taskInstanceValueExpression != null)
- {
- UITaskId uiTaskId = UITaskId.newInstance();
- uiTaskId.setValueExpression("taskInstance", taskInstanceValueExpression);
- url.addParameter(uiTaskId);
- }
+// ValueExpression taskInstanceValueExpression = getValueExpression("taskInstance");
+// if (taskInstanceValueExpression != null)
+// {
+// UITaskId uiTaskId = UITaskId.newInstance();
+// uiTaskId.setValueExpression("taskInstance", taskInstanceValueExpression);
+// url.addParameter(uiTaskId);
+// }
if (!usedParameters.contains("dataModelSelection"))
{
Deleted: branches/enterprise/WFK-2_1/jboss-seam-ui/src/main/java/org/jboss/seam/ui/component/UITaskId.java
===================================================================
--- branches/enterprise/WFK-2_1/jboss-seam-ui/src/main/java/org/jboss/seam/ui/component/UITaskId.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/jboss-seam-ui/src/main/java/org/jboss/seam/ui/component/UITaskId.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,63 +0,0 @@
-/**
- * License Agreement.
- *
- * Ajax4jsf 1.1 - Natural Ajax for Java Server Faces (JSF)
- *
- * Copyright (C) 2007 Exadel, Inc.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License version 2.1 as published by the Free Software Foundation.
- *
- * This library 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 library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-package org.jboss.seam.ui.component;
-
-import javax.el.ValueExpression;
-import javax.faces.component.UIParameter;
-import javax.faces.context.FacesContext;
-
-import org.jbpm.taskmgmt.exe.TaskInstance;
-import org.richfaces.cdk.annotations.Description;
-import org.richfaces.cdk.annotations.JsfComponent;
-import org.richfaces.cdk.annotations.Tag;
-
-/**
- * JSF component class
- *
- */
- at JsfComponent(description=@Description(displayName="org.jboss.seam.ui.TaskId",value="Add the task id to an output link (or similar JSF control), when the task is available via #{task}."),
-family="org.jboss.seam.ui.TaskId", type="org.jboss.seam.ui.TaskId",generate="org.jboss.seam.ui.component.html.HtmlTaskId",
-tag = @Tag(baseClass="org.jboss.seam.ui.util.cdk.UIComponentTagBase", name="taskid"),
-attributes = {"taskid.xml" })
-public abstract class UITaskId extends UIParameter {
-
- private static final String COMPONENT_TYPE = "org.jboss.seam.ui.TaskId";
-
- @Override
- public String getName()
- {
- return "taskId";
- }
-
- @Override
- public Object getValue()
- {
- ValueExpression valueExpression = getValueExpression("taskInstance");
- if (valueExpression==null) valueExpression = getFacesContext().getApplication().getExpressionFactory().createValueExpression(getFacesContext().getELContext(), "#{task}", TaskInstance.class);
- TaskInstance taskInstance = (TaskInstance) valueExpression.getValue( getFacesContext().getELContext() );
- return taskInstance==null ? null : taskInstance.getId();
- }
-
- public static UITaskId newInstance() {
- return (UITaskId) FacesContext.getCurrentInstance().getApplication().createComponent(COMPONENT_TYPE);
- }
-}
Modified: branches/enterprise/WFK-2_1/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/pom.xml 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/pom.xml 2012-10-08 12:31:58 UTC (rev 15212)
@@ -46,14 +46,13 @@
<!-- Version string properties -->
<version.seam>2.3.0.Final-redhat-1</version.seam>
<version.arquillian_core>1.0.1.Final</version.arquillian_core>
- <version.wicket>1.4.14</version.wicket>
<version.testng>5.14.10</version.testng>
<version.resteasy>2.0.1.GA</version.resteasy>
<version.jbossas7>7.1.1.Final</version.jbossas7>
<version.emma>2.0.5312</version.emma>
<version.jsf2>2.1.7</version.jsf2>
<version.junit>4.8.2</version.junit>
- <version.richfaces>4.2.2.Final</version.richfaces>
+ <version.richfaces>4.2.3.Final-redhat-1</version.richfaces>
<!-- ***************** -->
<!-- Repository Deployment URLs -->
@@ -227,7 +226,7 @@
<dependency>
<groupId>dom4j</groupId>
<artifactId>dom4j</artifactId>
- <version>1.6.1-brew</version>
+ <version>1.6.1-redhat-1</version>
<exclusions>
<exclusion>
<groupId>xml-apis</groupId>
@@ -278,11 +277,11 @@
<version>2.21.0</version>
</dependency>
- <dependency>
- <groupId>org.eclipse.jdt</groupId>
- <artifactId>core</artifactId>
- <version>3.4.2.v_883_R34x</version>
- </dependency>
+<!-- <dependency> -->
+<!-- <groupId>org.eclipse.jdt</groupId> -->
+<!-- <artifactId>core</artifactId> -->
+<!-- <version>3.4.2.v_883_R34x</version> -->
+<!-- </dependency> -->
<dependency>
<groupId>org.jboss.as</groupId>
Modified: branches/enterprise/WFK-2_1/seam-integration-tests/pom.xml
===================================================================
--- branches/enterprise/WFK-2_1/seam-integration-tests/pom.xml 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/seam-integration-tests/pom.xml 2012-10-08 12:31:58 UTC (rev 15212)
@@ -60,23 +60,8 @@
</build>
- <dependencies>
+ <dependencies>
<dependency>
- <groupId>org.jbpm.jbpm3</groupId>
- <artifactId>jbpm-jpdl</artifactId>
- <exclusions>
- <exclusion>
- <groupId>org.hibernate</groupId>
- <artifactId>hibernate-core</artifactId>
- </exclusion>
- <exclusion>
- <groupId>org.apache.jackrabbit</groupId>
- <artifactId>jackrabbit-core</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
-
- <dependency>
<groupId>org.beanshell</groupId>
<artifactId>bsh</artifactId>
</dependency>
Modified: branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/bpm/SeamExpressionEvaluatorTest.java
===================================================================
--- branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/bpm/SeamExpressionEvaluatorTest.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/bpm/SeamExpressionEvaluatorTest.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,100 +0,0 @@
-package org.jboss.seam.test.integration.bpm;
-
-import org.jboss.arquillian.container.test.api.Deployment;
-import org.jboss.arquillian.container.test.api.OverProtocol;
-import org.jboss.arquillian.junit.Arquillian;
-import org.jboss.seam.mock.JUnitSeamTest;
-import org.jboss.seam.test.integration.Deployments;
-import org.jboss.shrinkwrap.api.Archive;
-import org.jbpm.jpdl.el.ELException;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-
-/**
- * @author Pete Muir
- *
- */
-//@Ignore
- at RunWith(Arquillian.class)
-public class SeamExpressionEvaluatorTest extends JUnitSeamTest
-{
- @Deployment(name="SeamExpressionEvaluatorTest")
- @OverProtocol("Servlet 3.0")
- public static Archive<?> createDeployment()
- {
- return Deployments.jbpmSeamDeployment()
- .addClasses(SeamExpressionEvaluatorTestController.class);
- }
-
- // Test for JBSEAM-1937
- @Test
- public void testValueExpression() throws Exception
- {
- new FacesRequest()
- {
-
- @Override
- protected void invokeApplication() throws Exception
- {
- invokeAction("#{seamExpressionEvaluatorTestController.createProcess2}");
- }
-
- }.run();
- }
-
- // Test for JBSEAM-3250
- @Test
- public void testUnqualifiedValueExpression() throws Exception
- {
- new FacesRequest()
- {
-
- @Override
- protected void invokeApplication() throws Exception
- {
- invokeAction("#{seamExpressionEvaluatorTestController.createProcess4}");
- }
-
- }.run();
- }
-
- // Test for JBSEAM-2152
- @Test
- public void testMissingMethod() throws Exception
- {
- new FacesRequest()
- {
-
- @Override
- protected void invokeApplication() throws Exception
- {
- try
- {
- invokeAction("#{seamExpressionEvaluatorTestController.createProcess3}");
- }
- catch (Exception e)
- {
- if (!(isRootCause(e, ELException.class) || isRootCause(e, javax.el.ELException.class)))
- {
- e.printStackTrace();
- assert false;
- }
- }
- }
-
- }.run();
- }
-
- private static boolean isRootCause(Throwable t, Class clazz)
- {
- for (Throwable cause = t.getCause(); cause != null && cause != cause.getCause(); cause = cause.getCause())
- {
- if (clazz.isAssignableFrom(cause.getClass()))
- {
- return true;
- }
- }
- return false;
- }
-
-}
Modified: branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/bpm/SeamExpressionEvaluatorTestController.java
===================================================================
--- branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/bpm/SeamExpressionEvaluatorTestController.java 2012-10-08 12:31:06 UTC (rev 15211)
+++ branches/enterprise/WFK-2_1/seam-integration-tests/src/test/java/org/jboss/seam/test/integration/bpm/SeamExpressionEvaluatorTestController.java 2012-10-08 12:31:58 UTC (rev 15212)
@@ -1,50 +0,0 @@
-package org.jboss.seam.test.integration.bpm;
-
-import org.jboss.seam.ScopeType;
-import org.jboss.seam.annotations.Factory;
-import org.jboss.seam.annotations.Name;
-import org.jboss.seam.annotations.bpm.CreateProcess;
-
- at Name("seamExpressionEvaluatorTestController")
-public class SeamExpressionEvaluatorTestController {
-
- private String name = "foo";
-
- @Factory(value="testBoolean", scope=ScopeType.BUSINESS_PROCESS)
- public Boolean testNameFactory()
- {
- return false;
- }
-
- @CreateProcess(definition="TestProcess2")
- public void createProcess2()
- {
- }
-
- @CreateProcess(definition="TestProcess3")
- public void createProcess3()
- {
- }
-
- @CreateProcess(definition="TestProcess4")
- public void createProcess4()
- {
- }
-
- public void logTrue()
- {
- System.out.println("true");
- }
-
- public String getName()
- {
- return this.name;
- }
-
- public void setName(String name)
- {
- this.name = name;
- }
-
-
-}
\ No newline at end of file
More information about the seam-commits
mailing list