From: <pka...@us...> - 2009-07-03 13:08:20
|
Revision: 309 http://cse-ip.svn.sourceforge.net/cse-ip/?rev=309&view=rev Author: pkasprzak Date: 2009-07-03 12:46:34 +0000 (Fri, 03 Jul 2009) Log Message: ----------- * ClientIds / ClientInstanceIds are now part of messages * Renameing / restructuring / cleanups Modified Paths: -------------- trunk/sandbox/lsf-adapter-demo/LSFClientAdapter/src/InboundClientAdapter.bpel Modified: trunk/sandbox/lsf-adapter-demo/LSFClientAdapter/src/InboundClientAdapter.bpel =================================================================== --- trunk/sandbox/lsf-adapter-demo/LSFClientAdapter/src/InboundClientAdapter.bpel 2009-07-03 12:46:21 UTC (rev 308) +++ trunk/sandbox/lsf-adapter-demo/LSFClientAdapter/src/InboundClientAdapter.bpel 2009-07-03 12:46:34 UTC (rev 309) @@ -1,19 +1,18 @@ <?xml version="1.0" encoding="UTF-8"?> -<process - name="InboundClientAdapter" - targetNamespace="http://enterprise.netbeans.org/bpel/LSFClientAdapter/InboundClientAdapter" - xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable" - xmlns:xsd="http://www.w3.org/2001/XMLSchema" - xmlns:sxt="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Trace" - xmlns:sxed="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Editor" - xmlns:sxat="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Attachment" - xmlns:sxeh="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/ErrorHandling" - xmlns:sxxf="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/XPathFunctions" - xmlns:lsfdt="http://cse.campussource.de/schema/LSFDataTypes" - xmlns:dt="http://cse.campussource.de/schema/DataTypes" - xmlns:tns="http://enterprise.netbeans.org/bpel/LSFClientAdapter/InboundClientAdapter" - xmlns:ns0="http://docs.oasis-open.org/wsbpel/2.0/process/executable" - xmlns:ns1="http://j2ee.netbeans.org/wsdl/ObjectProcessor/ObjectProcessor"> +<process name="InboundClientAdapter" + targetNamespace="http://enterprise.netbeans.org/bpel/LSFClientAdapter/InboundClientAdapter" + xmlns="http://docs.oasis-open.org/wsbpel/2.0/process/executable" + xmlns:xsd="http://www.w3.org/2001/XMLSchema" + xmlns:sxt="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Trace" + xmlns:sxed="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Editor" + xmlns:sxat="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Attachment" + xmlns:sxeh="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/ErrorHandling" + xmlns:sxxf="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/XPathFunctions" + xmlns:lsfdt="http://cse.campussource.de/schema/LSFDataTypes" + xmlns:dt="http://cse.campussource.de/schema/DataTypes" + xmlns:tns="http://enterprise.netbeans.org/bpel/LSFClientAdapter/InboundClientAdapter" + xmlns:ns0="http://docs.oasis-open.org/wsbpel/2.0/process/executable" + xmlns:ns1="http://j2ee.netbeans.org/wsdl/ObjectProcessor/ObjectProcessor"> <import namespace="http://j2ee.netbeans.org/wsdl/LSFClientAdapter/LSFClientAdapter" location="LSFClientAdapter.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/> <import namespace="http://cse.campussource.de/schema/LSFDataTypes" location="LSFDataTypes.xsd" importType="http://www.w3.org/2001/XMLSchema"/> @@ -39,6 +38,10 @@ <variable name="SynchronizationMessage" element="lsfdt:synchronizationMessage"/> <variable name="Messages" element="dt:messages"/> + + <variable name="SOURCE_SYSTEM_ID" type="xsd:string"/> + <variable name="TARGET_SYSTEM_ID" type="xsd:string"/> + </variables> <sequence> @@ -46,6 +49,19 @@ xmlns:tns="http://j2ee.netbeans.org/wsdl/LSFClientAdapter/LSFClientAdapter" portType="tns:LSFClientAdapterPortType" variable="ReceiveIn"/> + + <!-- Init some constants and stuff --> + <assign name="init"> + <copy> + <from>'LSF'</from> + <to>$SOURCE_SYSTEM_ID</to> + </copy> + <copy> + <from>'Core'</from> + <to>$TARGET_SYSTEM_ID</to> + </copy> + </assign> + <assign name="prepareXSLTTransform"> <copy> <from variable="ReceiveIn" part="InputData"/> @@ -74,11 +90,13 @@ </assign> <assign name="convertToMessages"> +<!-- <sxt:trace> <sxt:log level="info" location="onComplete"> <ns0:from>concat('*** Messages: ', sxxf:doMarshal($Messages))</ns0:from> </sxt:log> </sxt:trace> +--> <copy> <from>ns0:doXslTransform('urn:stylesheets:toCDDMMessages.xsl', $SynchronizationMessage)</from> <to>$Messages</to> @@ -87,78 +105,101 @@ <!-- Convert CSE:Courses -> CDDM:CourseMessages --> <forEach name="CourseSplitter" parallel="no" counterName="CourseCounter"> + <sxt:trace> <sxt:log level="info" location="onStart"> <ns0:from>'*** CourseSplitter start'</ns0:from> </sxt:log> </sxt:trace> + <startCounterValue>1</startCounterValue> <finalCounterValue>count($Messages/dt:courseMessages/*)</finalCounterValue> + <scope name="invokeObjectProcessorForCourseMessages"> <variables> - <variable name="ProcessCourseOperationIn" xmlns:tns="http://j2ee.netbeans.org/wsdl/ObjectProcessor/ObjectProcessor" messageType="tns:ProcessCourseOperationRequest"/> + <variable name="ProcessCourseEventIn" xmlns:tns="http://j2ee.netbeans.org/wsdl/ObjectProcessor/ObjectProcessor" messageType="tns:ProcessCourseEventRequest"/> </variables> <sequence name="CourseSplitSequence"> - <!-- Init courseMessage part of ProcessCourseOperationIn --> - <assign name="initCourseMessagePartStructure"> + + <!-- Extract message --> + <assign name="extractCourseMessage"> + <sxt:trace> + <sxt:log level="info" location="onComplete"> + <ns0:from>concat('*** Extracted courseMessage: ', sxxf:doMarshal($ProcessCourseEventIn.courseMessage))</ns0:from> + </sxt:log> + </sxt:trace> <copy> - <from>1</from> - <to variable="ProcessCourseOperationIn" part="clientInstanceId"/> + <from>$Messages/dt:courseMessages/dt:courseMessage[$CourseCounter]</from> + <to>$ProcessCourseEventIn.courseMessage</to> </copy> + </assign> + + <!-- Init courseMessage --> + <assign name="updateCourseMessage"> <copy> - <from>$Messages/dt:courseMessages/dt:courseMessage[$CourseCounter]/dt:course/dt:attribute[dt:name = 'clientId']/dt:value</from> - <to variable="ProcessCourseOperationIn" part="clientObjectId"/> + <from>string($SOURCE_SYSTEM_ID)</from> + <to>$ProcessCourseEventIn.courseMessage/dt:source</to> </copy> - </assign> - <!-- Extract message --> - <assign name="transformCourseToCDDMCourseMessage"> <copy> - <from>$Messages/dt:courseMessages/dt:courseMessage[$CourseCounter]</from> - <to>$ProcessCourseOperationIn.courseMessage</to> + <from>string($TARGET_SYSTEM_ID)</from> + <to>$ProcessCourseEventIn.courseMessage/dt:target</to> </copy> </assign> - <invoke name="processCourseMessage" partnerLink="ObjectProcessor" operation="ProcessCourseOperation" - portType="ns1:ObjectProcessorPortType" - inputVariable="ProcessCourseOperationIn"/> + + <invoke name="processCourseEvent" partnerLink="ObjectProcessor" operation="processCourseEvent" + portType="ns1:ObjectProcessorPortType" + inputVariable="ProcessCourseEventIn"/> </sequence> </scope> </forEach> <!-- Convert CSE:category -> CDDM:categoryMessage --> <forEach name="CategorySplitter" parallel="no" counterName="CategoryCounter"> + <sxt:trace> <sxt:log level="info" location="onStart"> <ns0:from>'*** CategorySplitter start'</ns0:from> </sxt:log> </sxt:trace> + <startCounterValue>1</startCounterValue> - <finalCounterValue>count($Messages/dt:courseMessages/*)</finalCounterValue> + <finalCounterValue>count($Messages/dt:categoryMessages/*)</finalCounterValue> + <scope name="invokeObjectProcessorForCategoryMessages"> <variables> - <variable name="ProcessCategoryOperationIn" messageType="ns1:ProcessCategoryOperationRequest"/> + <variable name="ProcessCategoryEventIn" messageType="ns1:ProcessCategoryEventRequest"/> </variables> + <sequence name="CategorySplitSequence"> - <!-- Init courseMessage part of ProcessCourseOperationIn --> - <assign name="initCourseMessagePartStructure"> + + <!-- Extract message --> + <assign name="extractCategoryMessage"> + <sxt:trace> + <sxt:log level="info" location="onComplete"> + <ns0:from>concat('*** Extracted categoryMessage: ', sxxf:doMarshal($ProcessCategoryEventIn.categoryMessage))</ns0:from> + </sxt:log> + </sxt:trace> <copy> - <from>1</from> - <to variable="ProcessCategoryOperationIn" part="clientInstanceId"/> + <from>$Messages/dt:categoryMessages/dt:categoryMessage[$CategoryCounter]</from> + <to>$ProcessCategoryEventIn.categoryMessage</to> </copy> + </assign> + + <!-- Init categoryMessage --> + <assign name="updateCategoryMessage"> <copy> - <from>$Messages/dt:categoryMessages/dt:categoryMessage[$CategoryCounter]/dt:category/dt:attribute[dt:name = 'clientId']/dt:value</from> - <to variable="ProcessCategoryOperationIn" part="clientObjectId"/> + <from>string($SOURCE_SYSTEM_ID)</from> + <to>$ProcessCategoryEventIn.categoryMessage/dt:source</to> </copy> - </assign> - <!-- Copy relevant attributes --> - <assign name="transformCategoryToCDDMCategoryMessage"> <copy> - <from>$Messages/dt:categoryMessages/dt:categoryMessage[$CategoryCounter]</from> - <to>$ProcessCategoryOperationIn.categoryMessage</to> + <from>string($TARGET_SYSTEM_ID)</from> + <to>$ProcessCategoryEventIn.categoryMessage/dt:target</to> </copy> </assign> - <invoke name="processCategoryMessage" partnerLink="ObjectProcessor" operation="ProcessCategoryOperation" + + <invoke name="processCategoryMessage" partnerLink="ObjectProcessor" operation="processCategoryEvent" portType="ns1:ObjectProcessorPortType" - inputVariable="ProcessCategoryOperationIn"/> + inputVariable="ProcessCategoryEventIn"/> </sequence> </scope> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |