[jbpm-commits] JBoss JBPM SVN: r5897 - in jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test: java/org/jbpm/examples/businesstrip/action and 1 other directories.

do-not-reply at jboss.org do-not-reply at jboss.org
Fri Nov 27 22:00:31 EST 2009


Author: alex.guizar at jboss.com
Date: 2009-11-27 22:00:30 -0500 (Fri, 27 Nov 2009)
New Revision: 5897

Modified:
   jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/java/org/jbpm/examples/businesstrip/BusinessTripRequestTest.java
   jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/java/org/jbpm/examples/businesstrip/action/QueryTravelAgentDbAction.java
   jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/java/org/jbpm/examples/businesstrip/action/UpdateErpAction.java
   jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/resources/businesstrip/form.trip.manager.evaluation.xhtml
   jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/resources/businesstrip/form.trip.submit.xhtml
   jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/resources/businesstrip/form.trip.ticket.purchase.xhtml
   jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/resources/businesstrip/forms.xml
   jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/resources/businesstrip/gpd.xml
   jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/resources/businesstrip/processdefinition.xml
   jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/resources/businesstrip/processimage.jpg
Log:
enhance business trip request process for customer demo

Modified: jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/java/org/jbpm/examples/businesstrip/BusinessTripRequestTest.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/java/org/jbpm/examples/businesstrip/BusinessTripRequestTest.java	2009-11-27 12:40:32 UTC (rev 5896)
+++ jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/java/org/jbpm/examples/businesstrip/BusinessTripRequestTest.java	2009-11-28 03:00:30 UTC (rev 5897)
@@ -42,7 +42,7 @@
 
   public void testTaskParameters() {
     TaskInstance taskInstance = createNewProcessInstance();
-    assertEquals("submit business trip request", taskInstance.getName());
+    assertEquals("Submit trip request", taskInstance.getName());
     assertEquals(0, taskInstance.getVariables().size());
 
     newTransaction();
@@ -130,7 +130,7 @@
     jbpmContext.save(managerTask);
 
     newTransaction();
-    List accountantTasksList = jbpmContext.getTaskList("accountant");
+    List accountantTasksList = jbpmContext.getTaskList("admin");
     assertEquals(1, accountantTasksList.size());
     TaskInstance accountantTask = (TaskInstance) accountantTasksList.get(0);
     accountantTask.end();

Modified: jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/java/org/jbpm/examples/businesstrip/action/QueryTravelAgentDbAction.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/java/org/jbpm/examples/businesstrip/action/QueryTravelAgentDbAction.java	2009-11-27 12:40:32 UTC (rev 5896)
+++ jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/java/org/jbpm/examples/businesstrip/action/QueryTravelAgentDbAction.java	2009-11-28 03:00:30 UTC (rev 5897)
@@ -11,8 +11,8 @@
 	private static final long serialVersionUID = 1L;
 
 	public void execute(ExecutionContext context) throws Exception {
-		String country = String.valueOf(context.getContextInstance().getVariable("country"));
-		String city = String.valueOf(context.getContextInstance().getVariable("city"));
+		String country = String.valueOf(context.getVariable("country"));
+		String city = String.valueOf(context.getVariable("city"));
 		log.info("Query ticket for: " + country + ", " + city);
 	}
 

Modified: jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/java/org/jbpm/examples/businesstrip/action/UpdateErpAction.java
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/java/org/jbpm/examples/businesstrip/action/UpdateErpAction.java	2009-11-27 12:40:32 UTC (rev 5896)
+++ jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/java/org/jbpm/examples/businesstrip/action/UpdateErpAction.java	2009-11-28 03:00:30 UTC (rev 5897)
@@ -11,9 +11,10 @@
 	private static final long serialVersionUID = 1L;
 
 	public void execute(ExecutionContext context) throws Exception {
-		String budget = String.valueOf(context.getContextInstance().getVariable("allocated budget"));
+		Integer budget = (Integer) context.getVariable("budget");
 		log.info("Updating ERP for business trip");
 		log.info("Allocating budget: " + budget);
+		context.leaveNode();
 	}
 
 }

Modified: jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/resources/businesstrip/form.trip.manager.evaluation.xhtml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/resources/businesstrip/form.trip.manager.evaluation.xhtml	2009-11-27 12:40:32 UTC (rev 5896)
+++ jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/resources/businesstrip/form.trip.manager.evaluation.xhtml	2009-11-28 03:00:30 UTC (rev 5897)
@@ -5,7 +5,8 @@
 	xmlns:c="http://java.sun.com/jstl/core"
 	xmlns:h="http://java.sun.com/jsf/html"
 	xmlns:f="http://java.sun.com/jsf/core"
-	xmlns:tf="http://jbpm.org/jsf/tf" xmlns:jbpm="http://jbpm.org/jsf">
+	xmlns:tf="http://jbpm.org/jsf/tf" xmlns:jbpm="http://jbpm.org/jsf"
+	xmlns:j4j="http://jbpm.org/jbpm4jsf/core">
 <ui:component>
 	<jbpm:dataform>
 		<f:facet name="header">
@@ -13,15 +14,15 @@
 		</f:facet>
 		<jbpm:datacell>
 			<f:facet name="header">
-				<h:outputText value="Purpose:" />
+				<h:outputText value="Purpose" />
 			</f:facet>
 			<h:outputText value="#{var['purpose']}" />
 		</jbpm:datacell>
 		<jbpm:datacell>
 			<f:facet name="header">
-				<h:outputText value="Description:" />
+				<h:outputText value="Description" />
 			</f:facet>
-			<h:outputText value="#{var['purpose']}" />
+			<h:outputText value="#{var['description']}" />
 		</jbpm:datacell>
 		<jbpm:datacell>
 			<f:facet name="header">
@@ -33,7 +34,9 @@
 			<f:facet name="header">
 				<h:outputText value="Departure date" />
 			</f:facet>
-			<h:outputText value="#{var['departureDate']}" />
+			<h:outputText value="#{var['departureDate']}">
+				<f:convertDateTime timeZone="#{j4j:getServerTimeZone()}" />
+			</h:outputText>
 		</jbpm:datacell>
 		<jbpm:datacell>
 			<f:facet name="header">
@@ -43,20 +46,33 @@
 		</jbpm:datacell>
 		<jbpm:datacell>
 			<f:facet name="header">
-				<h:outputText value="Destination" />
+				<h:outputText value="Country" />
 			</f:facet>
 			<h:outputText value="#{var['country']}" />
 		</jbpm:datacell>
 		<jbpm:datacell>
-      <f:facet name="header">
-        <h:outputText value="City:" />
-      </f:facet>
-      <h:outputText value="#{var['city']}" />
-    </jbpm:datacell>
+			<f:facet name="header">
+				<h:outputText value="City" />
+			</f:facet>
+			<h:outputText value="#{var['city']}" />
+		</jbpm:datacell>
 		<jbpm:datacell>
 			<f:facet name="header">
-				<h:outputText value="Actions:" />
+				<h:outputText value="Budget" />
 			</f:facet>
+			<h:inputText value="#{var['budget']}"
+				validatorMessage="Budget must be a positive amount."
+				required="true"
+				requiredMessage="Number of days cannot be blank"
+				converter="javax.faces.Integer"
+				converterMessage="Please enter a valid number of days">
+				<f:validateLongRange minimum="0"/>
+			</h:inputText>
+		</jbpm:datacell>
+		<jbpm:datacell>
+			<f:facet name="header">
+				<h:outputText value="Actions" />
+			</f:facet>
 			<tf:saveButton value="Save" />
 			<tf:transitionButton value="Approve" transition="approve" />
 			<tf:transitionButton value="Reject" transition="reject" />

Modified: jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/resources/businesstrip/form.trip.submit.xhtml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/resources/businesstrip/form.trip.submit.xhtml	2009-11-27 12:40:32 UTC (rev 5896)
+++ jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/resources/businesstrip/form.trip.submit.xhtml	2009-11-28 03:00:30 UTC (rev 5897)
@@ -5,7 +5,9 @@
 	xmlns:c="http://java.sun.com/jstl/core"
 	xmlns:h="http://java.sun.com/jsf/html"
 	xmlns:f="http://java.sun.com/jsf/core"
-	xmlns:tf="http://jbpm.org/jsf/tf" xmlns:jbpm="http://jbpm.org/jsf">
+	xmlns:tf="http://jbpm.org/jsf/tf"
+	xmlns:jbpm="http://jbpm.org/jsf"
+	xmlns:j4j="http://jbpm.org/jbpm4jsf/core">
 
 <ui:component>
 	<jbpm:dataform>
@@ -14,20 +16,20 @@
 		</f:facet>
 		<jbpm:datacell>
 			<f:facet name="header">
-				<h:outputText value="Purpose:" />
+				<h:outputText value="Purpose" />
 			</f:facet>
 			<h:inputText value="#{var['purpose']}" required="true"
 				requiredMessage="Please fill in the purpose of the trip" />
 		</jbpm:datacell>
 		<jbpm:datacell>
 			<f:facet name="header">
-				<h:outputText value="Description:" />
+				<h:outputText value="Description" />
 			</f:facet>
-			<h:inputTextarea value="#{var['purpose']}" rows="4" cols="40" />
+			<h:inputTextarea value="#{var['description']}" rows="4" cols="40" />
 		</jbpm:datacell>
 		<jbpm:datacell>
 			<f:facet name="header">
-				<h:outputText value="Self Paid" />
+				<h:outputText value="Self paid" />
 			</f:facet>
 			<h:selectBooleanCheckbox value="#{var['selfPaid']}" />
 		</jbpm:datacell>
@@ -36,9 +38,9 @@
 				<h:outputText value="Departure date" />
 			</f:facet>
 			<h:inputText value="#{var['departureDate']}"
-				validatorMessage="The value must be a valid date" required="true"
-				requiredMessage="This field cannot be blank">
-				<f:convertDateTime />
+				validatorMessage="Please enter a valid departure date" required="true"
+				requiredMessage="Departure date cannot be blank">
+				<f:convertDateTime timeZone="#{j4j:getServerTimeZone()}" />
 			</h:inputText>
 		</jbpm:datacell>
 		<jbpm:datacell>
@@ -46,16 +48,18 @@
 				<h:outputText value="Number of days" />
 			</f:facet>
 			<h:inputText value="#{var['daysNum']}"
-				validatorMessage="The value must be a valid date" required="true"
-				requiredMessage="This field cannot be blank"
+				validatorMessage="Trip must span at least one day."
+				required="true"
+				requiredMessage="Number of days cannot be blank"
 				converter="javax.faces.Integer"
-				converterMessage="Please enter a valid number">
+				converterMessage="Please enter a valid number of days">
+				<f:validateLongRange minimum="1"/>
 			</h:inputText>
 		</jbpm:datacell>
 
 		<jbpm:datacell>
 			<f:facet name="header">
-				<h:outputText value="Destination" />
+				<h:outputText value="Country" />
 			</f:facet>
 			<h:selectOneMenu id="country" value="#{var['country']}">
 				<f:selectItem itemLabel="Afghanistan" itemValue="Afghanistan" />
@@ -160,8 +164,6 @@
 				<f:selectItem itemLabel="Guinea-Bissau" itemValue="Guinea-Bissau" />
 				<f:selectItem itemLabel="Guyana" itemValue="Guyana" />
 				<f:selectItem itemLabel="Haiti" itemValue="Haiti" />
-				<f:selectItem itemLabel="Heard Island and McDonald Islands"
-					itemValue="Heard Island and McDonald Islands" />
 				<f:selectItem itemLabel="Honduras" itemValue="Honduras" />
 				<f:selectItem itemLabel="Hong Kong" itemValue="Hong Kong" />
 				<f:selectItem itemLabel="Hungary" itemValue="Hungary" />
@@ -327,17 +329,17 @@
 		</jbpm:datacell>
 		<jbpm:datacell>
 			<f:facet name="header">
-				<h:outputText value="City:" />
+				<h:outputText value="City" />
 			</f:facet>
 			<h:inputText value="#{var['city']}" required="true"
 				requiredMessage="Please fill in the destination city" />
 		</jbpm:datacell>
 		<jbpm:datacell>
 			<f:facet name="header">
-				<h:outputText value="Actions:" />
+				<h:outputText value="Actions" />
 			</f:facet>
 			<tf:saveButton value="Save" />
-			<tf:transitionButton value="Evaluate" transition="submit request" />
+			<tf:transitionButton value="Send to manager" transition="submit request" />
 		</jbpm:datacell>
 	</jbpm:dataform>
 </ui:component>

Modified: jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/resources/businesstrip/form.trip.ticket.purchase.xhtml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/resources/businesstrip/form.trip.ticket.purchase.xhtml	2009-11-27 12:40:32 UTC (rev 5896)
+++ jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/resources/businesstrip/form.trip.ticket.purchase.xhtml	2009-11-28 03:00:30 UTC (rev 5897)
@@ -5,7 +5,9 @@
 	xmlns:c="http://java.sun.com/jstl/core"
 	xmlns:h="http://java.sun.com/jsf/html"
 	xmlns:f="http://java.sun.com/jsf/core"
-	xmlns:tf="http://jbpm.org/jsf/tf" xmlns:jbpm="http://jbpm.org/jsf">
+	xmlns:tf="http://jbpm.org/jsf/tf"
+	xmlns:jbpm="http://jbpm.org/jsf"
+	xmlns:j4j="http://jbpm.org/jbpm4jsf/core">
 <ui:component>
 	<jbpm:dataform>
 		<f:facet name="header">
@@ -21,7 +23,9 @@
 			<f:facet name="header">
 				<h:outputText value="Departure date" />
 			</f:facet>
-			<h:outputText value="#{var['departureDate']}" />
+			<h:outputText value="#{var['departureDate']}">
+				<f:convertDateTime timeZone="#{j4j:getServerTimeZone()}" />
+			</h:outputText>
 		</jbpm:datacell>
 		<jbpm:datacell>
 			<f:facet name="header">
@@ -31,19 +35,19 @@
 		</jbpm:datacell>
 		<jbpm:datacell>
 			<f:facet name="header">
-				<h:outputText value="Destination" />
+				<h:outputText value="Country" />
 			</f:facet>
 			<h:outputText value="#{var['country']}" />
 		</jbpm:datacell>
 		<jbpm:datacell>
 			<f:facet name="header">
-				<h:outputText value="City:" />
+				<h:outputText value="City" />
 			</f:facet>
 			<h:outputText value="#{var['city']}" />
 		</jbpm:datacell>
 		<jbpm:datacell>
 			<f:facet name="header">
-				<h:outputText value="Actions:" />
+				<h:outputText value="Actions" />
 			</f:facet>
 			<tf:saveButton value="Save" />
 			<tf:transitionButton value="Deliver Documents" />

Modified: jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/resources/businesstrip/forms.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/resources/businesstrip/forms.xml	2009-11-27 12:40:32 UTC (rev 5896)
+++ jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/resources/businesstrip/forms.xml	2009-11-28 03:00:30 UTC (rev 5897)
@@ -1,12 +1,12 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
 <forms>
-  <form task="submit business trip request" 
+  <form task="Submit trip request" 
         form="form.trip.submit.xhtml"/>
         
-  <form task="manager evaluation"
+  <form task="Manager evaluation"
         form="form.trip.manager.evaluation.xhtml" />
         
-  <form task="ticket purchase" 
+  <form task="Purchase tickets" 
         form="form.trip.ticket.purchase.xhtml" />
 </forms>

Modified: jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/resources/businesstrip/gpd.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/resources/businesstrip/gpd.xml	2009-11-27 12:40:32 UTC (rev 5896)
+++ jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/resources/businesstrip/gpd.xml	2009-11-28 03:00:30 UTC (rev 5897)
@@ -1,13 +1,13 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<root-container name="business trip request" width="909" height="651">
-  <node name="submit business trip request" x="53" y="16" width="192" height="36">
+<root-container name="business trip request" width="638" height="490">
+  <node name="Submit trip request" x="16" y="14" width="162" height="36">
     <edge>
       <label x="4" y="-22"/>
       <bendpoint w1="0" h1="59" w2="-242" h2="18"/>
     </edge>
   </node>
-  <node name="manager evaluation" x="261" y="75" width="132" height="36">
+  <node name="Manager evaluation" x="221" y="73" width="138" height="36">
     <edge>
       <label x="-100" y="-17"/>
       <bendpoint w1="270" h1="-1" w2="-2" h2="-382"/>
@@ -16,36 +16,38 @@
       <label x="5" y="-10"/>
     </edge>
   </node>
-  <node name="preparations" x="276" y="151" width="103" height="24">
+  <node name="preparations" x="239" y="149" width="103" height="24">
     <edge>
-      <label x="5" y="-10"/>
+      <label x="-75" y="3"/>
+      <bendpoint w1="-102" h1="-1" w2="-1" h2="-78"/>
     </edge>
     <edge>
-      <label x="5" y="-10"/>
+      <label x="5" y="0"/>
+      <bendpoint w1="113" h1="-1" w2="0" h2="-77"/>
     </edge>
   </node>
-  <node name="erp update" x="160" y="222" width="132" height="36">
+  <node name="Update ERP" x="123" y="220" width="132" height="36">
     <edge>
       <label x="5" y="-10"/>
       <bendpoint w1="-1" h1="164" w2="-111" h2="0"/>
     </edge>
   </node>
-  <node name="query travel agent db" x="373" y="305" width="132" height="36">
+  <node name="Contact travel agency" x="326" y="303" width="155" height="36">
     <edge>
       <label x="5" y="-10"/>
       <bendpoint w1="0" h1="81" w2="103" h2="0"/>
     </edge>
   </node>
-  <node name="ticket purchase" x="374" y="221" width="132" height="36">
+  <node name="Purchase tickets" x="337" y="219" width="132" height="36">
     <edge>
       <label x="5" y="-10"/>
     </edge>
   </node>
-  <node name="join" x="287" y="392" width="99" height="24">
+  <node name="join" x="241" y="390" width="99" height="24">
     <edge>
       <label x="5" y="-10"/>
       <bendpoint w1="0" h1="68" w2="-263" h2="-2"/>
     </edge>
   </node>
-  <node name="end" x="532" y="454" width="132" height="36"/>
+  <node name="End" x="494" y="453" width="132" height="36"/>
 </root-container>

Modified: jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/resources/businesstrip/processdefinition.xml
===================================================================
--- jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/resources/businesstrip/processdefinition.xml	2009-11-27 12:40:32 UTC (rev 5896)
+++ jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/resources/businesstrip/processdefinition.xml	2009-11-28 03:00:30 UTC (rev 5897)
@@ -8,50 +8,47 @@
 		<assignment actor-id="manager" />
 	</swimlane>
 	<swimlane name="hr">
-		<assignment actor-id="hr" />
+		<assignment actor-id="admin" />
 	</swimlane>
-	<swimlane name="accountant">
-		<assignment actor-id="accountant" />
-	</swimlane>
 
-	<start-state name="submit business trip request">
+	<start-state name="Submit trip request">
 		<task swimlane="employee" />
-		<transition name="submit request" to="manager evaluation" />
+		<transition name="submit request" to="Manager evaluation" />
 	</start-state>
 
-	<task-node name="manager evaluation">
+	<task-node name="Manager evaluation">
 		<task swimlane="manager" />
-		<transition to="end" name="reject" />
+		<transition to="End" name="reject" />
 		<transition to="preparations" name="approve" />
 	</task-node>
 
 	<fork name="preparations">
-		<transition to="erp update" name="erp update"></transition>
-		<transition to="ticket purchase" name="book ticket"></transition>
+		<transition to="Update ERP" name="erp update"></transition>
+		<transition to="Purchase tickets" name="book ticket"></transition>
 	</fork>
 
-	<node name="erp update">
+	<node name="Update ERP">
 		<action
 			class="org.jbpm.examples.businesstrip.action.UpdateErpAction">
 		</action>
 		<transition to="join"></transition>
 	</node>
 
-	<node name="query travel agent db">
+	<node name="Contact travel agency">
 		<action
 			class="org.jbpm.examples.businesstrip.action.QueryTravelAgentDbAction">
 		</action>
 		<transition to="join"></transition>
 	</node>
 
-	<task-node name="ticket purchase">
-		<task swimlane="accountant" />
-		<transition to="query travel agent db"></transition>
+	<task-node name="Purchase tickets">
+		<task swimlane="hr" />
+		<transition to="Contact travel agency"></transition>
 	</task-node>
 
 	<join name="join">
-		<transition to="end"></transition>
+		<transition to="End"></transition>
 	</join>
 
-	<end-state name="end" />
+	<end-state name="End" />
 </process-definition>
\ No newline at end of file

Modified: jbpm3/branches/jbpm-3.2-soa/modules/examples/src/test/resources/businesstrip/processimage.jpg
===================================================================
(Binary files differ)



More information about the jbpm-commits mailing list