incubator-hise-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r.@apache.org
Subject svn commit: r1026537 - in /incubator/hise/trunk: hise-examples/osgi/claims-handling-bundle/src/main/resources/ hise-examples/osgi/claims-handling-bundle/src/main/resources/META-INF/spring/ hise-services/src/main/java/org/apache/hise/engine/store/ hise-...
Date Sat, 23 Oct 2010 00:31:23 GMT
Author: rr
Date: Sat Oct 23 00:31:22 2010
New Revision: 1026537

URL: http://svn.apache.org/viewvc?rev=1026537&view=rev
Log:
Moved to Camel for claims handling OSGi example

Modified:
    incubator/hise/trunk/hise-examples/osgi/claims-handling-bundle/src/main/resources/Htd1.xml
    incubator/hise/trunk/hise-examples/osgi/claims-handling-bundle/src/main/resources/META-INF/spring/beans.xml
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HISERouteBuilder.java
    incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/Task.java

Modified: incubator/hise/trunk/hise-examples/osgi/claims-handling-bundle/src/main/resources/Htd1.xml
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-examples/osgi/claims-handling-bundle/src/main/resources/Htd1.xml?rev=1026537&r1=1026536&r2=1026537&view=diff
==============================================================================
--- incubator/hise/trunk/hise-examples/osgi/claims-handling-bundle/src/main/resources/Htd1.xml
(original)
+++ incubator/hise/trunk/hise-examples/osgi/claims-handling-bundle/src/main/resources/Htd1.xml
Sat Oct 23 00:31:22 2010
@@ -18,11 +18,11 @@
 
             <htd:documentation xml:lang="en-US">This task is used to handle claims
that require manual approval. </htd:documentation>
 
-            <htd:interface portType="tns:ClaimsHandlingPT" operation="approve" 
-                           responsePortType="tns:ClaimsResolvingPT" responseOperation="resolve"/>
+            <htd:interface portType="ClaimsHandling" operation="default" 
+                           responsePortType="ClaimsResolving" responseOperation="default"/>
 
             <htd:priority>  
-                xs:integer(htd:getInput("ClaimApprovalRequest")/cla:prio)
+                xs:integer(htd:getInput("message")/cla:prio)
             </htd:priority>
 
             <htd:peopleAssignments>
@@ -86,15 +86,15 @@
                 <htd:presentationParameters>
                     
                     <htd:presentationParameter name="firstname" type="xsd:string">
-                        xs:string(htd:getInput("ClaimApprovalRequest")/cla:cust/cla:firstname)
+                        xs:string(htd:getInput("message")/cla:cust/cla:firstname)
                     </htd:presentationParameter>
                     
                     <htd:presentationParameter name="lastname" type="xsd:string">
-                        xs:string(htd:getInput("ClaimApprovalRequest")/cla:cust/cla:lastname)
+                        xs:string(htd:getInput("message")/cla:cust/cla:lastname)
                     </htd:presentationParameter>
                     
                     <htd:presentationParameter name="euroAmount" type="xsd:double">
-                        xs:double(htd:getInput("ClaimApprovalRequest")/cla:amount)
+                        xs:double(htd:getInput("message")/cla:amount)
                     </htd:presentationParameter>
                         
                 </htd:presentationParameters>
@@ -112,7 +112,7 @@
             <htd:outcome>
                 <![CDATA[
                   <cla:resolve xmlns:cla="http://www.insurance.example.com/claims" xmlns:htd="http://www.example.org/WS-HT">
-                     <claimId>{htd:getInput("ClaimApprovalRequest")/cla:cust/cla:id/text()}</claimId>
+                     <claimId>{htd:getInput("message")/cla:cust/cla:id/text()}</claimId>
                      <ok>{$outcome}</ok>
                   </cla:resolve>
                 ]]>

Modified: incubator/hise/trunk/hise-examples/osgi/claims-handling-bundle/src/main/resources/META-INF/spring/beans.xml
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-examples/osgi/claims-handling-bundle/src/main/resources/META-INF/spring/beans.xml?rev=1026537&r1=1026536&r2=1026537&view=diff
==============================================================================
--- incubator/hise/trunk/hise-examples/osgi/claims-handling-bundle/src/main/resources/META-INF/spring/beans.xml
(original)
+++ incubator/hise/trunk/hise-examples/osgi/claims-handling-bundle/src/main/resources/META-INF/spring/beans.xml
Sat Oct 23 00:31:22 2010
@@ -26,64 +26,23 @@ xmlns:xsi="http://www.w3.org/2001/XMLSch
   
   <osgi:reference id="hiseEngine" interface="org.apache.hise.api.HISEEngine" bean-name="hiseEngine"/>
   <osgi:reference id="transactionManager" interface="org.springframework.transaction.PlatformTransactionManager"
bean-name="transactionManager"/>
-  <bean class="org.apache.hise.engine.store.HISEDeployer" init-method="init" destroy-method="destroy">
-    <property name="hiseEngine" ref="hiseEngine"/>
-    <property name="deploymentInfo">
-      <bean class="org.apache.hise.engine.store.HISEDD">
-        <property name="humanInteractionsResource" value="classpath:Htd1.xml"/>
-        <property name="tasksDI">
-          <list>
-            <bean class="org.apache.hise.engine.store.TaskDD">
-              <property name="taskName">
-                <bean class="javax.xml.namespace.QName" factory-method="valueOf">
-                  <constructor-arg type="java.lang.String" value="{http://www.insurance.example.com/claims}Task1"/>
-                </bean>
-              </property>
-              <property name="handler" ref="hiseJaxWSService1"/>
-              <property name="sender" ref="hiseJaxWSSender1"/>
-            </bean>
-          </list>
-        </property>
-      </bean>
-    </property>
-  </bean>
-  <bean id="hiseJaxWSService1" class="org.apache.hise.engine.jaxws.HISEJaxWSService" init-method="init">
+
+  <bean id="hiseRouteBuilder" class="org.apache.hise.engine.store.HISERouteBuilder">
+    <property name="humanInteractionsResource" value="classpath:Htd1.xml"/>
     <property name="hiseEngine" ref="hiseEngine"/>
     <property name="transactionManager" ref="transactionManager"/>
   </bean>
-  <jaxws:endpoint id="Htd1" implementor="#hiseJaxWSService1" serviceName="ins:ClaimsHandlingService"
endpointName="ins:ClaimsHandlingPort" publish="true" wsdlLocation="classpath:ExampleTasks.wsdl"/>
-  <bean id="hiseJaxWSSender1" class="org.apache.hise.engine.jaxws.HISEJaxWSClient" init-method="init">
-    <property name="wsdlDocumentLocation" value="classpath:ExampleTasks.wsdl"/>
-    <property name="serviceName">
-      <bean class="javax.xml.namespace.QName" factory-method="valueOf">
-        <constructor-arg type="java.lang.String" value="{http://www.insurance.example.com/claims}ClaimsResolvingService"/>
-      </bean>
-    </property>
-  </bean>
-  <jaxws:endpoint id="Htd2" address="/ClaimsReminderService" implementor="#hiseJaxWSService1"
serviceName="ins:ClaimApprovalReminderService" endpointName="ins:ClaimApprovalReminderPort"
publish="true" wsdlLocation="classpath:ExampleTasks.wsdl"/>
 
-    <camel-osgi:camelContext xmlns="http://camel.apache.org/schema/spring">
+  <camel-osgi:camelContext id="camelContext" xmlns="http://camel.apache.org/schema/spring">
+    <routeBuilder ref="hiseRouteBuilder"/>
         <route>
             <from uri="file:input?delete=true" />
-            <convertBodyTo type="javax.xml.transform.stream.StreamSource"/>
-            <enrich uri="nmr:{http://www.insurance.example.com/claims}ClaimsHandlingPort"/>
-            <to uri="file:input-processed"/>
+            <to uri="direct:ClaimsHandling"/>
         </route>
         <route>
-            <from uri="jetty:http://localhost:8280/ClaimsResolvingService"/>
+            <from uri="direct:ClaimsResolving"/>
             <to uri="file:output"/>
-            <setBody>
-                <constant>
-<![CDATA[
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
-  <SOAP-ENV:Header/>
-  <SOAP-ENV:Body>
-  </SOAP-ENV:Body>
-</SOAP-ENV:Envelope>
-]]>
-                </constant>
-            </setBody>
-            <convertBodyTo type="javax.xml.transform.stream.StreamSource"/>
         </route>
-    </camel-osgi:camelContext>
+  </camel-osgi:camelContext>
+
 </beans>

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HISERouteBuilder.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HISERouteBuilder.java?rev=1026537&r1=1026536&r2=1026537&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HISERouteBuilder.java
(original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/engine/store/HISERouteBuilder.java
Sat Oct 23 00:31:22 2010
@@ -12,6 +12,7 @@ import org.apache.hise.api.Handler;
 import org.apache.hise.api.Sender;
 import org.apache.hise.lang.HumanInteractions;
 import org.apache.hise.lang.TaskDefinition;
+import org.apache.hise.utils.DOMUtils;
 import org.springframework.core.io.Resource;
 import org.springframework.transaction.PlatformTransactionManager;
 import org.springframework.transaction.TransactionStatus;
@@ -40,7 +41,8 @@ public class HISERouteBuilder extends Ro
         	taskDD.setHandler(new CamelHandler());
         	final Sender sender = new Sender() {
 				public Node invoke(Node message, Node epr) {
-					getContext().createProducerTemplate().sendBody("direct:" + responseService, message);
+					String body = DOMUtils.domToString(message);
+					getContext().createProducerTemplate().sendBody("direct:" + responseService, body);
 					return null;
 				}
         	};

Modified: incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/Task.java
URL: http://svn.apache.org/viewvc/incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/Task.java?rev=1026537&r1=1026536&r2=1026537&view=diff
==============================================================================
--- incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/Task.java (original)
+++ incubator/hise/trunk/hise-services/src/main/java/org/apache/hise/runtime/Task.java Sat
Oct 23 00:31:22 2010
@@ -796,7 +796,7 @@ public class Task {
             Node response = taskEvaluator.evaluateOutcome(taskDto.getStatus() == Status.COMPLETED);
             hiseEngine.sendResponse(getTaskDefinition().getTaskName(),
                     response, 
-                    taskEvaluator.createEprFromHeader(DOMUtils.parse(taskDto.getSoapHeader()).getDocumentElement()));
+                    taskDto.getSoapHeader() == null ? null : taskEvaluator.createEprFromHeader(DOMUtils.parse(taskDto.getSoapHeader()).getDocumentElement()));
         } catch (Exception e) {
             throw new RuntimeException("Sending response failed: "+e.getMessage(), e);
         }



Mime
View raw message