[jbpm-commits] JBoss JBPM SVN: r2586 - in jbpm3/trunk/modules/core/src: test/java/org/jboss/seam/pageflow and 3 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Wed Oct 22 11:12:36 EDT 2008
Author: tom.baeyens at jboss.com
Date: 2008-10-22 11:12:35 -0400 (Wed, 22 Oct 2008)
New Revision: 2586
Removed:
jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/Page.java
jbpm3/trunk/modules/core/src/test/java/org/jboss/seam/pageflow/Page.java
jbpm3/trunk/modules/core/src/test/java/org/jbpm/seam/SeamPageFlowTest.java
jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testPageflowWithNamespace.xml
jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testPageflowWithSchemaLocation.xml
jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testPageflowWithoutNamespace.xml
Modified:
jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/xml/XmlSchemaTest.java
Log:
[JBPM-1724] removed pageflow
Deleted: jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/Page.java
===================================================================
--- jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/Page.java 2008-10-22 14:09:27 UTC (rev 2585)
+++ jbpm3/trunk/modules/core/src/main/java/org/jbpm/graph/node/Page.java 2008-10-22 15:12:35 UTC (rev 2586)
@@ -1,74 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.graph.node;
-
-import org.dom4j.Element;
-import org.jbpm.context.exe.ContextInstance;
-import org.jbpm.graph.def.Node;
-import org.jbpm.graph.exe.ExecutionContext;
-import org.jbpm.jpdl.xml.JpdlXmlReader;
-import org.jbpm.jpdl.xml.Parsable;
-import org.jbpm.taskmgmt.exe.TaskInstance;
-
-public class Page extends Node implements Parsable {
-
- private static final long serialVersionUID = 1L;
-
- String url;
- boolean isConversationEnd = false;
- String outcome;
-
- public void read(Element nodeElement, JpdlXmlReader jpdlXmlReader) {
- url = nodeElement.attributeValue("url");
- Element conversationEndElement = nodeElement.element("conversation-end");
- if (conversationEndElement!=null) {
- isConversationEnd = true;
- outcome = conversationEndElement.attributeValue("outcome");
- }
- }
-
- public void execute(ExecutionContext executionContext) {
- if (isConversationEnd) {
- // get the outer business process task instance
- ContextInstance contextInstance = executionContext.getContextInstance();
- String variableName = "taskInstance";
- TaskInstance taskInstance = (TaskInstance) contextInstance.getVariable(variableName);
-
- // complete the task
- if (outcome==null) {
- taskInstance.end();
- } else {
- taskInstance.end(outcome);
- }
- }
- }
-
- public boolean isConversationEnd() {
- return isConversationEnd;
- }
- public String getOutcome() {
- return outcome;
- }
- public String getUrl() {
- return url;
- }
-}
Deleted: jbpm3/trunk/modules/core/src/test/java/org/jboss/seam/pageflow/Page.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jboss/seam/pageflow/Page.java 2008-10-22 14:09:27 UTC (rev 2585)
+++ jbpm3/trunk/modules/core/src/test/java/org/jboss/seam/pageflow/Page.java 2008-10-22 15:12:35 UTC (rev 2586)
@@ -1,163 +0,0 @@
-package org.jboss.seam.pageflow;
-
-import org.dom4j.Element;
-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.
- */
- 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 = "true".equals(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 = "true".equals(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.
- */
- 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);
- return null;
- }
-
- public boolean isRedirect() {
- return redirect;
- }
-
- public boolean hasDescription() {
- return description != null;
- }
-
- public String getDescription() {
- // return Interpolator.instance().interpolate(description);
- return null;
- }
-
- 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;
- }
-}
Modified: jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/xml/XmlSchemaTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/xml/XmlSchemaTest.java 2008-10-22 14:09:27 UTC (rev 2585)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/jpdl/xml/XmlSchemaTest.java 2008-10-22 15:12:35 UTC (rev 2586)
@@ -116,22 +116,4 @@
public void testExceptionHandler() {parseXmlForThisMethod();}
public void testEndState() {parseXmlForThisMethod();}
public void testScript() {parseXmlForThisMethod();}
-
- public void testPageflowWithoutNamespace() { parseXmlForThisMethod(); }
-
- public void testPageflowWithNamespace() {
- try {
- parseXmlForThisMethod();
- fail("expected exception");
- }
- catch (JpdlException e) {
- List problems = e.getProblems();
- assertEquals(1, problems.size());
- Problem problem = (Problem) problems.get(0);
- assertEquals(Problem.LEVEL_ERROR, problem.getLevel());
- assertEquals(3, problem.getLine().intValue());
- }
- }
-
- public void testPageflowWithSchemaLocation() { parseXmlForThisMethod(); }
}
Deleted: jbpm3/trunk/modules/core/src/test/java/org/jbpm/seam/SeamPageFlowTest.java
===================================================================
--- jbpm3/trunk/modules/core/src/test/java/org/jbpm/seam/SeamPageFlowTest.java 2008-10-22 14:09:27 UTC (rev 2585)
+++ jbpm3/trunk/modules/core/src/test/java/org/jbpm/seam/SeamPageFlowTest.java 2008-10-22 15:12:35 UTC (rev 2586)
@@ -1,163 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jbpm.seam;
-
-import java.io.Serializable;
-import java.util.Collection;
-
-import org.jbpm.AbstractJbpmTestCase;
-import org.jbpm.context.exe.ContextInstance;
-import org.jbpm.graph.def.ProcessDefinition;
-import org.jbpm.graph.exe.ProcessInstance;
-import org.jbpm.graph.exe.Token;
-import org.jbpm.graph.node.Page;
-import org.jbpm.taskmgmt.exe.TaskInstance;
-
-public class SeamPageFlowTest extends AbstractJbpmTestCase {
-
- public static class Document implements Serializable {
- private static final long serialVersionUID = 1L;
- String text;
- public Document(String text) {
- this.text = text;
- }
- public String getText() {
- return text;
- }
- }
-
- public void testPageFlow() {
- // Here's a simple business process with one task
- ProcessDefinition businessProcessDefinition = ProcessDefinition.parseXmlString(
- "<process-definition name='business process'>" +
- " <start-state name='start biz proc'>" +
- " <transition to='review document' />" +
- " </start-state>" +
- " <task-node name='review document'>" +
- " <task name='business process review task'>" +
- // the task instance must have access to the
- // document process variable
- " <controller>" +
- " <variable name='document' />" +
- " </controller>" +
- " </task>" +
- " <transition name='approveDocument' to='file horizontally' />" +
- " <transition name='rejectDocument' to='put in shredder' />" +
- " </task-node>" +
- " <state name='file horizontally' />" +
- " <state name='put in shredder' />" +
- "</process-definition>"
- );
-
- // let's start a new process instance
- ProcessInstance businessProcessInstance = new ProcessInstance(businessProcessDefinition);
- // the root token is the main path of execution
- Token businessToken = businessProcessInstance.getRootToken();
- assertEquals("start biz proc", businessToken.getNode().getName());
-
- // we put the document somewhere in the process variables
- Document document = new Document("blablabla");
- ContextInstance contextInstance = businessProcessInstance.getContextInstance();
- contextInstance.setVariable("document", document);
-
- // let's kick the execution of the business process
- businessProcessInstance.signal();
-
- // so the execution should have arrived in the review document node
- assertEquals("review document", businessToken.getNode().getName());
-
- // there should be 1 task instance created in the business process
- Collection allTaskInstances = businessProcessInstance.getTaskMgmtInstance().getTaskInstances();
- assertNotNull(allTaskInstances);
- assertEquals(1, allTaskInstances.size());
- TaskInstance taskInstance = (TaskInstance) allTaskInstances.iterator().next();
- document = (Document) taskInstance.getVariable("document");
- assertEquals("blablabla", document.getText());
-
-
- // Now SEAM will handle the page flow that is specified here:
- ProcessDefinition pageFlowDefinition = ProcessDefinition.parseXmlString(
- "<process-definition name='approve document task'>" +
- " <start-state name='start page flow'>" +
- " <transition to='review' />" +
- " </start-state>" +
- " <page name='review' url='review.jsp'>" +
- " <transition name='approve' to='approved' />" +
- " <transition name='reject' to='rejected' />" +
- " </page>" +
- " <page name='approved' url='approved.jsp'>" +
- " <conversation-end outcome='approveDocument' />" +
- " </page>" +
- " <page name='rejected' url='rejected.jsp'>" +
- " <conversation-end outcome='rejectDocument' />" +
- " </page>" +
- "</process-definition>"
- );
-
- // A new page flow process is started
- ProcessInstance pageFlowInstance = new ProcessInstance(pageFlowDefinition);
- Token pageFlowToken = pageFlowInstance.getRootToken();
-
- // This page flow is in the context of a specific user that
- // clicked an entry in his task list. The task instance is
- // injected as a process context variable
- contextInstance = pageFlowInstance.getContextInstance();
- contextInstance.setVariable("taskInstance", taskInstance);
-
- // With the task instance information, the page flow process is started
- // and can now decide which is the first page to show the user
- pageFlowInstance.signal();
-
- // SEAM can expect that when a wait state is entered, the main
- // path of execution is positioned in a page. That page
- // contains the url that SEAM should render.
- // In this simple page flow process, we always start with the
- // review page.
- Page page = (Page) pageFlowToken.getNode();
- assertNotNull(page);
- assertEquals("review", page.getName());
- assertEquals("review.jsp", page.getUrl());
-
- // so now, the SEAM page flow renders the review page.
- // in review.jsp, the EL expression "taskInstance[document].text" should resolve
- // to 'blablabla'
- taskInstance = (TaskInstance) contextInstance.getVariable("taskInstance");
- document = (Document) taskInstance.getVariable("document");
- assertEquals("blablabla", document.getText());
- assertEquals("business process review task", taskInstance.getName());
-
- // suppose the user presses the approve button
- pageFlowToken.signal("approve");
-
- // now the page flow process should have moved to the
- // approved page with the approved.jsp
- page = (Page) pageFlowToken.getNode();
- assertNotNull(page);
- assertEquals("approved", page.getName());
- assertEquals("approved.jsp", page.getUrl());
-
- // ...and, the business process task instance should have ended.
- assertTrue(taskInstance.hasEnded());
- // causing the business process to move to the next state
- assertEquals("file horizontally", businessToken.getNode().getName());
- }
-}
Deleted: jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testPageflowWithNamespace.xml
===================================================================
--- jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testPageflowWithNamespace.xml 2008-10-22 14:09:27 UTC (rev 2585)
+++ jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testPageflowWithNamespace.xml 2008-10-22 15:12:35 UTC (rev 2586)
@@ -1,35 +0,0 @@
-<pageflow-definition name="numberGuess" xmlns="http://jboss.com/products/seam/pageflow">
-
- <i-do-not-belong-here>
- <the-parser-will-complain />
- </i-do-not-belong-here>
-
- <start-page name="displayGuess" view-id="/numberGuess.jsp">
- <redirect />
- <transition name="guess" to="evaluateGuess">
- <action expression="#{numberGuess.guess}" />
- </transition>
- </start-page>
-
- <decision name="evaluateGuess" expression="#{numberGuess.correctGuess}">
- <transition name="true" to="win" />
- <transition name="false" to="evaluateRemainingGuesses" />
- </decision>
-
- <decision name="evaluateRemainingGuesses"
- expression="#{numberGuess.lastGuess}">
- <transition name="true" to="lose" />
- <transition name="false" to="displayGuess" />
- </decision>
-
- <page name="win" view-id="/win.jsp">
- <end-conversation />
- <redirect />
- </page>
-
- <page name="lose" view-id="/lose.jsp">
- <end-conversation />
- <redirect />
- </page>
-
-</pageflow-definition>
\ No newline at end of file
Deleted: jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testPageflowWithSchemaLocation.xml
===================================================================
--- jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testPageflowWithSchemaLocation.xml 2008-10-22 14:09:27 UTC (rev 2585)
+++ jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testPageflowWithSchemaLocation.xml 2008-10-22 15:12:35 UTC (rev 2586)
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<pageflow-definition name="numberGuess"
- xsi:schemaLocation="http://jboss.com/products/seam/pageflow
- http://jboss.com/products/seam/pageflow-2.0.xsd"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="http://jboss.com/products/seam/pageflow">
-
- <start-page name="displayGuess" view-id="/numberGuess.jsp">
- <redirect />
- <transition name="guess" to="evaluateGuess">
- <action expression="#{numberGuess.guess}" />
- </transition>
- </start-page>
-
- <decision name="evaluateGuess" expression="#{numberGuess.correctGuess}">
- <transition name="true" to="win" />
- <transition name="false" to="evaluateRemainingGuesses" />
- </decision>
-
- <decision name="evaluateRemainingGuesses"
- expression="#{numberGuess.lastGuess}">
- <transition name="true" to="lose" />
- <transition name="false" to="displayGuess" />
- </decision>
-
- <page name="win" view-id="/win.jsp">
- <end-conversation />
- <redirect />
- </page>
-
- <page name="lose" view-id="/lose.jsp">
- <end-conversation />
- <redirect />
- </page>
-
-</pageflow-definition>
\ No newline at end of file
Deleted: jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testPageflowWithoutNamespace.xml
===================================================================
--- jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testPageflowWithoutNamespace.xml 2008-10-22 14:09:27 UTC (rev 2585)
+++ jbpm3/trunk/modules/core/src/test/resources/org/jbpm/jpdl/xml/files/testPageflowWithoutNamespace.xml 2008-10-22 15:12:35 UTC (rev 2586)
@@ -1,35 +0,0 @@
-<pageflow-definition name="numberGuess">
-
- <i-do-not-belong-here>
- <the-parser-will-not-complain />
- </i-do-not-belong-here>
-
- <start-page name="displayGuess" view-id="/numberGuess.jsp">
- <redirect />
- <transition name="guess" to="evaluateGuess">
- <action expression="#{numberGuess.guess}" />
- </transition>
- </start-page>
-
- <decision name="evaluateGuess" expression="#{numberGuess.correctGuess}">
- <transition name="true" to="win" />
- <transition name="false" to="evaluateRemainingGuesses" />
- </decision>
-
- <decision name="evaluateRemainingGuesses"
- expression="#{numberGuess.lastGuess}">
- <transition name="true" to="lose" />
- <transition name="false" to="displayGuess" />
- </decision>
-
- <page name="win" view-id="/win.jsp">
- <end-conversation />
- <redirect />
- </page>
-
- <page name="lose" view-id="/lose.jsp">
- <end-conversation />
- <redirect />
- </page>
-
-</pageflow-definition>
\ No newline at end of file
More information about the jbpm-commits
mailing list