[overlord-commits] Overlord SVN: r372 - in cdl/trunk: runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb and 3 other directories.

overlord-commits at lists.jboss.org overlord-commits at lists.jboss.org
Thu Oct 9 04:15:52 EDT 2008


Author: jeff.yuchang
Date: 2008-10-09 04:15:52 -0400 (Thu, 09 Oct 2008)
New Revision: 372

Modified:
   cdl/trunk/distribution/src/main/assembly/bin.xml
   cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/SessionManager.java
   cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/ConversationAction.java
   cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/CreateSessionAction.java
   cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SendMessageAction.java
   cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SetStateAction.java
   cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/WhileAction.java
   cdl/trunk/samples/jbossesb/brokerage/broker/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/Request4QuoteMain.java
   cdl/trunk/samples/jbossesb/brokerage/broker/src/main/resources/META-INF/jboss-esb.xml
Log:
* Fix the break that is caused by my last commit.
* Add javadoc for ConversationAction class.
* Add samplesguide in the distribution.


Modified: cdl/trunk/distribution/src/main/assembly/bin.xml
===================================================================
--- cdl/trunk/distribution/src/main/assembly/bin.xml	2008-10-08 15:09:55 UTC (rev 371)
+++ cdl/trunk/distribution/src/main/assembly/bin.xml	2008-10-09 08:15:52 UTC (rev 372)
@@ -72,6 +72,11 @@
 		   <outputDirectory>docs/userguide</outputDirectory>
 		</fileSet>
 
+		<fileSet>
+		   <directory>../docs/docbook/samplesguide/target/docbook/publish/en-US</directory>
+		   <outputDirectory>docs/samplesguide</outputDirectory>
+		</fileSet>
+
         <!-- Copy samples -->
 	    <fileSet>
 		    <directory>src/main/release/samples/jbossesb</directory>

Modified: cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/SessionManager.java
===================================================================
--- cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/SessionManager.java	2008-10-08 15:09:55 UTC (rev 371)
+++ cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/SessionManager.java	2008-10-09 08:15:52 UTC (rev 372)
@@ -201,7 +201,9 @@
 		String parentProperty = session.getProperties().get(Session.PARENT_REFERENCE_KEY);
 		if (parentProperty!= null && session.getParent() != null) {
 			Object parentBizObj = session.getParent().getBusinessObject();
-			MVEL.setProperty(session.getBusinessObject(), parentProperty, parentBizObj);
+			Object bizObj = session.getBusinessObject();
+			MVEL.setProperty(bizObj, parentProperty, parentBizObj);
+			session.setBusinessObject(bizObj);
 		}
 	}
 }

Modified: cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/ConversationAction.java
===================================================================
--- cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/ConversationAction.java	2008-10-08 15:09:55 UTC (rev 371)
+++ cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/ConversationAction.java	2008-10-09 08:15:52 UTC (rev 372)
@@ -44,8 +44,22 @@
 import org.mvel.MVEL;
 
 /**
- * Base activity, all the ESB aware actions extend from this one.
+ * Base activity, all the ESB conversation aware actions extend from this one.
  * 
+ * <pre>
+ * The procedure of processing a message is as following:
+ * 1. Get current session from the database. 
+ *    Include injecting context, such as injecting parent session business object if it exists
+ * 2. Unschedule current service, if it is first conversation action.
+ * 3. Handle Message. (This will be override by subclasses)
+ * 4. Save session object back to database.
+ *    Update the parent session if it is necessary.
+ * 5. If it is the last conversation action in current service.
+ *    And if it has no schedule items to invoke. Mark session status to 'Completed'
+ *    5.1 If it is sub-session, then invoke sub-session exit service.
+ * 6. Deliver message to services at last if it needs to.
+ * </pre>
+ * 
  * @author <a href="mailto:gary.brown at hattricksoftware.com">Gary Brown</a>
  * @author <a href="mailto:cyu at redhat.com>Jeff Yu</a>
  */
@@ -59,6 +73,8 @@
 	
 	protected boolean unscheduledServiceItem = false;
 	
+	protected boolean isCreateSessionAction = false;
+	
 	protected Session session;
 	
 	public ConversationAction(ConfigTree config) {
@@ -69,15 +85,78 @@
 		return(config);
 	}
 	
-	protected org.w3c.dom.Element getElement(Message message) throws Exception {
-		org.w3c.dom.Element ret=null;
+	/**
+	 * This is the method that deals with business logic for derived conversation actions.
+	 * @param message
+	 * @return
+	 * @throws Exception
+	 */
+	public abstract Message handle(Message message) throws Exception;
+	
+	
+	/**
+	 * <pre>
+	 * The procedure of processing a message is as following:
+	 * 1. Get current session from the database. 
+	 *    Include injecting context, such as injecting parent session business object if it exists
+	 * 2. Unschedule current service, if it is first conversation action.
+	 * 3. Handle Message. (This will be override by subclasses)
+	 * 4. Save session object back to database.
+	 *    Update the parent session if it is necessary.
+	 * 5. If it is the last conversation action in current service.
+	 *    And if it has no schedule items to invoke. Mark session status to 'Completed'
+	 *    5.1 If it is sub-session, then invoke sub-session exit service.
+	 * 6. Deliver message to services at last if it needs to.
+	 * </pre>
+	 * 
+	 * @param message
+	 * @return
+	 * @throws Exception
+	 */
+	public final Message process(Message message) throws Exception {
 		
-		if (message.getBody().get() instanceof String) {
-			ret = (org.w3c.dom.Element)XMLUtils.getNode((String)message.getBody().get());
+		org.hibernate.Session hibernateSession = HibernateUtil.currentSession();
+		Transaction transaction = hibernateSession.beginTransaction();
+		try {
+			session = getSession(message);
+			if (session != null && isFirstOrLastConversationAction(message, true)) {
+				logger.debug("This is first conversation action to unschedule the item.");
+				unschedule(message);
+				unscheduledServiceItem = true;
+			}
+			
+			handle(message);
+			
+			if (session != null && !isCreateSessionAction) {
+				SessionManager.updateObject(session);
+				updateParentSessionBizObject();
+			}
+			
+			if (session != null && isFirstOrLastConversationAction(message, false)) {
+				logger.debug("This is the last conversation action.");
+				if (session.getScheduleItems().size() <= 0) {
+					session.setStatus(SessionStatus.Completed);
+					SessionManager.updateObject(session);
+					logger.debug("Completed the session of " + session);
+					if (session.getParent() != null) {
+						invokeSubsessionExitService(message, session);
+					}
+				}
+			}
+			
+			transaction.commit();
+		} catch (Exception e) {
+			transaction.rollback();
+			throw new Exception("Error in process message: " + e, e);
+		} finally {
+			HibernateUtil.closeSession();
 		}
 		
-		return(ret);
+		sendAsyncMessage(message);
+		
+		return message;
 	}
+
 	
 	/**
 	 * 
@@ -162,10 +241,6 @@
 		return(mesgType);
 	}
 	
-	private Session getSession(Message message) throws Exception {
-		return getSession(message, null);
-	}
-	
 	protected Session getSession(Message message, List<Identity> ids) throws Exception{
 		Session ret=(Session)message.getProperties().getProperty(MessageProperties.SESSION);
 		String sessionKey=(String)message.getProperties().getProperty(MessageProperties.SESSION_KEY);
@@ -180,82 +255,7 @@
 		}
 		return(ret);
 	}
-	
-	/**
-	 * Do not override this method, override the handle(message) instead.
-	 * @param message
-	 * @return
-	 * @throws Exception
-	 */
-	public Message process(Message message) throws Exception {
 		
-		org.hibernate.Session hibernateSession = HibernateUtil.currentSession();
-		Transaction transaction = hibernateSession.beginTransaction();
-		try {
-			session = getSession(message);
-			if (session != null && isFirstOrLastConversationAction(message, true)) {
-				logger.debug("This is first conversation action to unschedule the item.");
-				unschedule(message);
-				unscheduledServiceItem = true;
-			}
-			
-			handle(message);
-			
-			SessionManager.updateObject(session);
-			updateParentSessionBizObject();
-			
-			if (session != null && isFirstOrLastConversationAction(message, false)) {
-				logger.debug("This is the last conversation action.");
-				if (session.getScheduleItems().size() <= 0) {
-					session.setStatus(SessionStatus.Completed);
-					SessionManager.updateObject(session);
-					logger.debug("Completed the session of " + session);
-					if (session.getParent() != null) {
-						invokeSubsessionExitService(message, session);
-					}
-				}
-			}
-			
-			transaction.commit();
-		} catch (Exception e) {
-			transaction.rollback();
-			throw new Exception("Error in process message: " + e, e);
-		} finally {
-			HibernateUtil.closeSession();
-		}
-		
-		sendAsyncMessage(message);
-		
-		return message;
-	}
-
-	private void updateParentSessionBizObject() {
-		String parentProperty = session.getProperties().get(Session.PARENT_REFERENCE_KEY);
-		if (parentProperty != null && session.getParent() != null) {
-			Object parentBizObj = MVEL.eval(parentProperty, session.getBusinessObject());
-			Session parentSession = session.getParent();
-			parentSession.setBusinessObject(parentBizObj);
-			SessionManager.updateObject(parentSession);
-		}
-	}
-	
-	
-	private void invokeSubsessionExitService(Message message, Session session)
-			throws Exception {
-		List<ScheduleItem> items = session.getParent().getScheduleItems();
-		if (items.size() <= 0) {
-			throw new Exception("Completed sub-session, but haven't found any schedule items to run.");
-		}
-		if (items.size() > 1) {
-			throw new Exception("Should be only one schedule item waiting for sub-session.");
-		}
-		//set parent session in current message.
-		message.getProperties().setProperty(MessageProperties.SESSION_KEY, String.valueOf(session.getParent().getId()));
-		ScheduleItem si = items.get(0);
-		addScheduleItemToDeliver(si.getCategory(), si.getName());
-		logger.info("Invoke scheduleItem of " + si + "in session " + session.getParent());
-	}
-	
 	protected void sendAsyncMessage(Message message) throws Exception {
 		for(ScheduleItem si : scheduleItems) {
 			ServiceInvoker invoker = new ServiceInvoker(si.getCategory(), si.getName());
@@ -264,7 +264,7 @@
 	}
 	
 	/**
-	 * 
+	 * Determine whether the action is the first/last conversation aware action in current service.
 	 * @param message
 	 * @param isFirst : when isFirst is false, it will get the last conversation action.
 	 * @return
@@ -284,6 +284,40 @@
 		return false;
 	}
 	
+	
+	
+	protected String getMvelMethodName(String method) {
+		return method + "()";
+	}
+	
+	
+	protected void addScheduleItemToDeliver(String category, String name) {
+		for (ScheduleItem si : scheduleItems) {
+			if (category.equals(si.getCategory()) && name.equals(si.getName())) {
+				logger.error("Add duplicated schedule item of " + category + "/" + name);
+				return;
+			}
+		}
+		ScheduleItem si = new ScheduleItem(category, name);
+		scheduleItems.add(si);
+	}
+
+	private org.w3c.dom.Element getElement(Message message) throws Exception {
+		org.w3c.dom.Element ret=null;
+		
+		if (message.getBody().get() instanceof String) {
+			ret = (org.w3c.dom.Element)XMLUtils.getNode((String)message.getBody().get());
+		}
+		
+		return(ret);
+	}
+	
+	private void unschedule(Message message) throws Exception {
+		String serviceCategory=getConfig().getParent().getAttribute(ActionProperties.SERVICE_CATEGORY);
+		String serviceName=getConfig().getParent().getAttribute(ActionProperties.SERVICE_NAME);
+		session.unschedule(serviceCategory, serviceName);
+	}
+	
 	private ConfigTree getFirstOrLastConversationAction(boolean isFirst) throws ClassNotFoundException {
 		ConfigTree[] cts = config.getParent().getChildren(ActionProperties.ACTION_NODE);
 		ConfigTree config = null;
@@ -300,37 +334,34 @@
 		return config;
 	}
 	
-	
-	protected void unschedule(Message message) throws Exception {
-		String serviceCategory=getConfig().getParent().getAttribute(ActionProperties.SERVICE_CATEGORY);
-		String serviceName=getConfig().getParent().getAttribute(ActionProperties.SERVICE_NAME);
-		session.unschedule(serviceCategory, serviceName);
+	private void updateParentSessionBizObject() {
+		String parentProperty = session.getProperties().get(Session.PARENT_REFERENCE_KEY);
+		if (parentProperty != null && session.getParent() != null) {
+			Object parentBizObj = MVEL.eval(parentProperty, session.getBusinessObject());
+			Session parentSession = session.getParent();
+			parentSession.setBusinessObject(parentBizObj);
+			SessionManager.updateObject(parentSession);
+		}
 	}
 	
-	protected String getMvelMethodName(String method) {
-		return method + "()";
-	}
 	
-	
-	protected void addScheduleItemToDeliver(String category, String name) {
-		for (ScheduleItem si : scheduleItems) {
-			if (category.equals(si.getCategory()) && name.equals(si.getName())) {
-				logger.error("Add duplicated schedule item of " + category + "/" + name);
-				return;
-			}
+	private void invokeSubsessionExitService(Message message, Session session)
+			throws Exception {
+		List<ScheduleItem> items = session.getParent().getScheduleItems();
+		if (items.size() <= 0) {
+			throw new Exception("Completed sub-session, but haven't found any schedule items to run.");
 		}
-		ScheduleItem si = new ScheduleItem(category, name);
-		scheduleItems.add(si);
+		if (items.size() > 1) {
+			throw new Exception("Should be only one schedule item waiting for sub-session.");
+		}
+		//set parent session in current message.
+		message.getProperties().setProperty(MessageProperties.SESSION_KEY, String.valueOf(session.getParent().getId()));
+		ScheduleItem si = items.get(0);
+		addScheduleItemToDeliver(si.getCategory(), si.getName());
+		logger.info("Invoke scheduleItem of " + si + "in session " + session.getParent());
 	}
 	
-	
-	/**
-	 * This is the method that deals with business logic for derived conversation actions.
-	 * @param message
-	 * @return
-	 * @throws Exception
-	 */
-	public abstract Message handle(Message message) throws Exception;
-
-	
+	private Session getSession(Message message) throws Exception {
+		return getSession(message, null);
+	}
 }

Modified: cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/CreateSessionAction.java
===================================================================
--- cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/CreateSessionAction.java	2008-10-08 15:09:55 UTC (rev 371)
+++ cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/CreateSessionAction.java	2008-10-09 08:15:52 UTC (rev 372)
@@ -42,10 +42,6 @@
 	
 	public Message handle(Message message) throws Exception{
 		
-		// If root session, then need to actually create session,
-		// otherwise this would be invoked as part of a 'perform',
-		// in which case the pre-initialized session would be
-		// passed with the invocation.
 		String sessionName=getConfig().getAttribute(ActionProperties.SESSION_NAME);
 		
 		if (sessionName != null) {
@@ -58,9 +54,10 @@
 				session = SessionManager.createSession(sessionName);
 			}
 			
+			isCreateSessionAction = true;
 			logger.info("Set session '"+sessionName+"' = "+session);
 			
-			message.getProperties().setProperty(MessageProperties.SESSION, session);
+			//message.getProperties().setProperty(MessageProperties.SESSION, session);
 			message.getProperties().setProperty(MessageProperties.SESSION_KEY, String.valueOf(session.getId()));
 			
 		} else {		

Modified: cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SendMessageAction.java
===================================================================
--- cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SendMessageAction.java	2008-10-08 15:09:55 UTC (rev 371)
+++ cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SendMessageAction.java	2008-10-09 08:15:52 UTC (rev 372)
@@ -51,6 +51,9 @@
 	
 	private Logger logger = Logger.getLogger(SendMessageAction.class);
 	
+	private ServiceInvoker serviceInvoker;
+	private Courier courier;
+	private Message sendMessage;
 	
 	public SendMessageAction(ConfigTree config) {
 		super(config);
@@ -76,65 +79,48 @@
 			String categoryExpression = getConfig().getAttribute(SendMessageAction.SERVICE_CATEGORY_EXPRESSION);
         	
 			List<Identity> ids=getIdentities(message, null);
-			session.assimulateIdentities(ids);
+			session.assimulateIdentities(ids);			
 			
-			
 			// Send message
-	        Message mesg = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
-	        mesg.getBody().add(message.getBody().get());
+	        sendMessage = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+	        sendMessage.getBody().add(message.getBody().get());
 	        
 	        if ((serviceCategory != null && serviceName != null)
 	        		|| (categoryExpression != null && nameExpression != null)) {
 	        	
 		        // Check if response details provided
 		        if (respServiceName != null && respServiceCategory != null) {
-		        	LogicalEPR lepr= new LogicalEPR(respServiceCategory, respServiceName);
+		        	LogicalEPR lepr= new LogicalEPR(respServiceCategory, respServiceName);		        	
+		        	sendMessage.getHeader().getCall().setReplyTo(lepr);
 		        	
-		        	mesg.getHeader().getCall().setReplyTo(lepr);
-		        	
 		        	// Schedule response action pipeline
 		        	session.schedule(respServiceCategory, respServiceName, message);
 		        }
-		        
-		        
+		        		        
 		        if (serviceCategory == null && serviceName == null) {
 		        	serviceCategory = (String) MVEL.eval(categoryExpression, session.getBusinessObject());
 		        	serviceName = (String) MVEL.eval(nameExpression, session.getBusinessObject());
 		        }
 		        
-				ServiceInvoker invoker = new ServiceInvoker(serviceCategory, serviceName);
-				invoker.deliverAsync(mesg);
+				serviceInvoker = new ServiceInvoker(serviceCategory, serviceName);
 				
-				logger.info("Sent message to '"+serviceCategory+"/"+serviceName+"'");
-				
 	        } else if (clientEPR != null) {
-	        	EPR epr = session.getEPR(clientEPR);
-				
+	        	EPR epr = session.getEPR(clientEPR);				
 				if (epr == null) {					
-					throw new Exception("Client EPR '"+clientEPR+"' does not exist in session");
+					throw new NullPointerException("Client EPR '"+clientEPR+"' does not exist in session");
 				}
 				
-				Courier courier=null;
-				
-    			// Workaround, as CourierFactory currently does
-    			// not support logical EPRs.
+    			// Workaround, as CourierFactory currently does not support logical EPRs.
     			if (epr instanceof LogicalEPR) {
     				courier = new LogicalCourier((LogicalEPR) epr);
     			} else {
     				courier = CourierFactory.getCourier(epr);
     			}
-				
-		        logger.info("Sending response to '"+epr+"'");
-
-		        courier.deliver(mesg);
-				
-				courier.cleanup();
+    			
 	        } else {
-	        	throw new Exception("Failed to send message");
-	        }
+	        	throw new Exception("Failed to send message.");
+	        }		
 			
-			logger.info("MESSAGE TYPE '"+mesgMType+"' SENT.");
-			
 		} else {			
 			throw new Exception("Unexpected message type="+mesgMType+
 					  			", but expecting type="+requiredMType);
@@ -143,5 +129,19 @@
 		return(message);
 	}
 	
+	
+	@Override
+	protected void sendAsyncMessage(Message message) throws Exception {
+		if (serviceInvoker != null) {
+			serviceInvoker.deliverAsync(this.sendMessage);
+		} else if (courier != null) {
+			courier.deliver(this.sendMessage);
+			courier.cleanup();
+		} else {
+			throw new Exception ("Neither ServiceInvoker nor Courier can be found to deliver message");
+		}
+		logger.info("Message of  '"+ sendMessage+"' has been sent.");
+	}
+	
 }
 

Modified: cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SetStateAction.java
===================================================================
--- cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SetStateAction.java	2008-10-08 15:09:55 UTC (rev 371)
+++ cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/SetStateAction.java	2008-10-09 08:15:52 UTC (rev 372)
@@ -56,12 +56,14 @@
 		if (stateExpression != null) {			
 			Object result = MVEL.eval(stateExpression, bstate);
 			MVEL.setProperty(bstate, variable, result);
+			session.setBusinessObject(bstate);
 			logger.info("populated from stateExpression of: " + stateExpression);
 		} else if (messageExpression != null) {
 			String xmlBody = (String) message.getBody().get();
 			Element element = (Element) XMLUtils.getNode(xmlBody);
 			String result = XMLUtils.executeXpath(element, messageExpression);
 			MVEL.setProperty(bstate, variable, result);
+			session.setBusinessObject(bstate);
 			logger.info("populated from messageExpression of: " + messageExpression);
 		} else {
 			throw new Exception ("Neither stateExpression nor messageExpression has been specified.");

Modified: cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/WhileAction.java
===================================================================
--- cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/WhileAction.java	2008-10-08 15:09:55 UTC (rev 371)
+++ cdl/trunk/runtime/jbossesb/src/main/java/org/jboss/soa/overlord/jbossesb/actions/WhileAction.java	2008-10-09 08:15:52 UTC (rev 372)
@@ -62,10 +62,10 @@
 		logger.debug("decision method is : " + decisionMethod);
 		if (decisionMethod != null) {
 			Object response = MVEL.eval(getMvelMethodName(decisionMethod), session.getBusinessObject());
-			if (response instanceof Boolean) {
+			if ((response instanceof Boolean) && (response != null) ) {
 				Boolean flag = (Boolean) response;
 				logger.info("The result of decision method is: " + flag);
-				if (flag) {
+				if (flag.booleanValue()) {
 					String category = whileConfig.getAttribute(ActionProperties.SERVICE_CATEGORY);
 					String name = whileConfig.getAttribute(ActionProperties.SERVICE_NAME);
 					session.schedule(category, name, message);
@@ -79,7 +79,7 @@
 					logger.info("Scheduled items of " + category + "/" + name + ".");
 				}
 			} else {
-				throw new Exception("method return value is not Boolean.");
+				throw new Exception("method return value type is not Boolean Or is Null.");
 			}
 		} else {
 			throw new Exception("Haven't found the decision method in the configuration.");

Modified: cdl/trunk/samples/jbossesb/brokerage/broker/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/Request4QuoteMain.java
===================================================================
--- cdl/trunk/samples/jbossesb/brokerage/broker/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/Request4QuoteMain.java	2008-10-08 15:09:55 UTC (rev 371)
+++ cdl/trunk/samples/jbossesb/brokerage/broker/src/main/java/org/jboss/soa/overlord/samples/jbossesb/loan/broker/Request4QuoteMain.java	2008-10-09 08:15:52 UTC (rev 372)
@@ -34,6 +34,8 @@
 	private QuoteManager quoteManager;
 	
 	private Quote quote = new Quote();
+	
+	private String quoteValue;
 
 	public Supplier getSupplier() {
 		return supplier;
@@ -49,10 +51,18 @@
 
 	public void setQuote(Quote quote) {
 		this.quote = quote;
-		quoteManager.getQuotes().add(this.quote);
 	}
 	
+	public String getQuoteValue() {
+		return quoteValue;
+	}
 
+	public void setQuoteValue(String quoteValue) {
+		this.quoteValue = quoteValue;
+		this.quote.setValue(quoteValue);
+		this.quoteManager.getQuotes().add(quote);
+	}
+
 	public QuoteManager getQuoteManager() {
 		return quoteManager;
 	}

Modified: cdl/trunk/samples/jbossesb/brokerage/broker/src/main/resources/META-INF/jboss-esb.xml
===================================================================
--- cdl/trunk/samples/jbossesb/brokerage/broker/src/main/resources/META-INF/jboss-esb.xml	2008-10-08 15:09:55 UTC (rev 371)
+++ cdl/trunk/samples/jbossesb/brokerage/broker/src/main/resources/META-INF/jboss-esb.xml	2008-10-09 08:15:52 UTC (rev 372)
@@ -304,7 +304,7 @@
 					<property name="serviceCategory" value="ESBBroker.BrokerParticipant" />
 					<property name="serviceName" value="CompleteTransaction.main" />
 					<property name="returnServiceCategory" value="ESBBroker.BrokerParticipant" />
-					<property name="returnServiceName" value="ESBBrokerProcess.main.8" />
+                    <property name="returnServiceName" value="ESBBrokerProcess.main.8" />
 					<property name="bindDetails" >
 						<bind from-expression="getSelectedQuote()"
 									to-variable="quote" />
@@ -433,7 +433,7 @@
 				
 				<action class="org.jboss.soa.overlord.jbossesb.actions.SetStateAction" 
 							process="process" name="s9-3">
-					<property name="variable" value="quote.value" />
+					<property name="variable" value="quoteValue" />
 					<property name="messageExpression" value="/quote" />
 				</action>			
 			</actions>




More information about the overlord-commits mailing list