From: <ale...@us...> - 2009-06-25 14:27:40
|
Revision: 270 http://cse-ip.svn.sourceforge.net/cse-ip/?rev=270&view=rev Author: alexloewen Date: 2009-06-25 13:52:19 +0000 (Thu, 25 Jun 2009) Log Message: ----------- fault handling is almost compleet. changed updateCourse. Modified Paths: -------------- trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddCategory.bpel trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddCategory.wsdl trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddCourse.bpel trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddCourse.wsdl trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/DeleteCategory.bpel trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/DeleteCategory.wsdl trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/DeleteCourse.bpel trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/DeleteCourse.wsdl trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/OutboundClientAdapter.bpel trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/UpdateCategory.bpel trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/UpdateCategory.wsdl trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/UpdateCourse.bpel trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/UpdateCourse.wsdl Added Paths: ----------- trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/faultHandlingMsg.wsdl Removed Paths: ------------- trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/updateCourseXSLT.xsl Modified: trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddCategory.bpel =================================================================== --- trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddCategory.bpel 2009-06-25 13:51:28 UTC (rev 269) +++ trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddCategory.bpel 2009-06-25 13:52:19 UTC (rev 270) @@ -11,12 +11,14 @@ 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:il_objs="http://cse.campussource.de/schema/ilias/objects" - xmlns:tns="http://cse.campussource.de/bpel/ILIASClientAdapter/AddCategory"> + xmlns:tns="http://cse.campussource.de/bpel/ILIASClientAdapter/AddCategory" + xmlns:fltns="http://j2ee.netbeans.org/wsdl/ILIASClientAdapter/faultHandlingMsg" xmlns:sxed2="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Editor2"> <import namespace="http://enterprise.netbeans.org/bpel/ilias-3.10.5-Wrapper" location="ilias-3.10.5-Wrapper.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/> <import namespace="urn:ilUserAdministration" location="ilias-3.10.5-fixed.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/> <import namespace="http://cse.campussource.de/schema/ilias/objects" location="ilias-objects.xsd" importType="http://www.w3.org/2001/XMLSchema"/> <import namespace="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddCategory" location="AddCategory.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/> + <import namespace="http://j2ee.netbeans.org/wsdl/ILIASClientAdapter/faultHandlingMsg" location="faultHandlingMsg.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/> <partnerLinks> <partnerLink name="IliasAdapter" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddCategory" partnerLinkType="tns:AddCategory" myRole="AddCategoryPortTypeRole"/> @@ -32,73 +34,158 @@ <!-- Category description as object in Ilias-Format --> <variable name="CategoryXML" element="il_objs:Object"/> + + <!--FaultHandling Variables --> + <variable name="SystemFault" messageType="fltns:systemFaultMessage"/> + <variable name="UnknownFault" messageType="fltns:unknownFaultMessage"/> + <variable name="IliasFault" messageType="fltns:iliasFaultMessage"/> + </variables> <sequence> - <receive name="start" createInstance="yes" partnerLink="IliasAdapter" operation="addCategory" - xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddCategory" - portType="tns:AddCategoryPortType" - variable="AddCategoryIn"/> - <assign name="prepareAddCategory"> - <copy> - <from>$AddCategoryIn.SID</from> - <to>$AddObjectIn.sid</to> - </copy> - <copy> - <from>1</from> - <to>$AddObjectIn.target_id</to> - </copy> - <copy> - <from> - <literal> - <Object xmlns="http://cse.campussource.de/schema/ilias/objects" type="cat"> - <Title>categoryTest</Title> - <Description>test category</Description> - </Object> - </literal> - </from> - <to variable="CategoryXML"/> - </copy> - </assign> + <scope name="AddCategoryScope"> + <faultHandlers> + <catch faultName="sxeh:systemFault"> + <sequence > + <assign name="prepareSystemFaultReply"> + <!-- Set Fault Data--> + <sxt:trace> + <sxt:log level="info" location="onStart"> + <from>concat('*** System Fault occured in AddCategory()!', ' ')</from> + </sxt:log> + </sxt:trace> + <copy> + <from>'AddCategory failed with a SystemFault.'</from> + <to variable="SystemFault" part="cause"/> + </copy> -<!-- Copy the actial Title! .category/dt:attribute[dt:name = 'name']/dt:value!--> - <assign name="CopyTheTitle"> - <copy> - <from>$AddCategoryIn.category/dt:attribute[dt:name = 'name']/dt:value</from> - <to>$CategoryXML/il_objs:Title/text()</to> - </copy> - </assign> + <copy> + <from>'AddCategory.bpel'</from> + <to variable="SystemFault" part="process"/> + </copy> + <copy> + <from>sxxf:doMarshal($AddCategoryIn.category)</from> + <to variable="SystemFault" part="context"/> + </copy> + </assign> + <reply name="ReplyWithSystemFault" partnerLink="IliasAdapter" operation="addCategory" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddCategory" portType="tns:AddCategoryPortType" faultName="tns:SystemFault" variable="SystemFault"/> + </sequence> + </catch> + <catchAll> + <sequence> + <assign name="prepareUnknownFaultReply"> + <!-- Set Fault Data--> + <sxt:trace> + <sxt:log level="info" location="onStart"> + <from>concat('*** Unknown Fault occured in AddCategory!', ' ')</from> + </sxt:log> + </sxt:trace> + <copy> + <from>'AddCategory failed by Ilias with some unknown Fault'</from> + <to variable="UnknownFault" part="cause"/> + </copy> - <!-- Render XML to string --> - <assign name="marshalCategoryXMLToString"> - <copy> - <from>sxxf:doMarshal($CategoryXML)</from> - <to>$AddObjectIn.object_xml</to> - </copy> - </assign> - - <invoke name="addCategory" partnerLink="ILIAS" operation="addObject" xmlns:tns="urn:ilUserAdministration" + <copy> + <from>'AddCategory.bpel'</from> + <to variable="UnknownFault" part="process"/> + </copy> + <copy> + <from>sxxf:doMarshal($AddCategoryIn.category)</from> + <to variable="UnknownFault" part="context"/> + </copy> + </assign> + <reply name="ReplyWithUnknownFault" partnerLink="IliasAdapter" operation="addCategory" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddCategory" portType="tns:AddCategoryPortType" faultName="tns:UnknownFault" variable="UnknownFault"/> + </sequence> + </catchAll> + </faultHandlers> + <sequence> + <receive name="start" createInstance="yes" partnerLink="IliasAdapter" operation="addCategory" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddCategory" + portType="tns:AddCategoryPortType" + variable="AddCategoryIn"/> + <assign name="prepareAddCategory"> + <copy> + <from>$AddCategoryIn.SID</from> + <to>$AddObjectIn.sid</to> + </copy> + <copy> + <from>1</from> + <to>$AddObjectIn.target_id</to> + </copy> + <copy> + <from> + <literal> + <Object xmlns="http://cse.campussource.de/schema/ilias/objects" type="cat"> + <Title>categoryTest</Title> + <Description>test category</Description> + </Object> + </literal> + </from> + <to variable="CategoryXML"/> + </copy> + </assign> + <assign name="CopyTheTitle"> + <copy> + <from>$AddCategoryIn.category/dt:attribute[dt:name = 'name']/dt:value</from> + <to>$CategoryXML/il_objs:Title/text()</to> + </copy> + </assign> + <assign name="marshalCategoryXMLToString"> + <copy> + <from>sxxf:doMarshal($CategoryXML)</from> + <to>$AddObjectIn.object_xml</to> + </copy> + </assign> + <invoke name="addCategory" partnerLink="ILIAS" operation="addObject" xmlns:tns="urn:ilUserAdministration" portType="tns:ILIASSoapWebservicePortType" inputVariable="AddObjectIn" outputVariable="AddObjectOut"> - <sxt:trace> - <sxt:log level="info" location="onStart"> - <from>concat('*** Adding Category: ', $AddObjectIn.object_xml)</from> - </sxt:log> - </sxt:trace> - </invoke> + <sxt:trace> + <sxt:log level="info" location="onStart"> + <from>concat('*** Adding Category: ', $AddObjectIn.object_xml)</from> + </sxt:log> + </sxt:trace> + </invoke> + <if name="IfRefIdIsOk" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddCategory"> + <condition>0 <= $AddObjectOut.ref_id</condition> + <sequence name="Sequence1"> + <assign name="prepareReply"> + <copy> + <from>$AddObjectOut.ref_id</from> + <to>$AddCategoryOut.categoryId</to> + </copy> + </assign> + <reply name="returnCategoryId" partnerLink="IliasAdapter" operation="addCategory" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddCategory" + portType="tns:AddCategoryPortType" + variable="AddCategoryOut"/> + </sequence> + <else> + <sequence> + <assign name="prepareIliasFaultReply"> + <!-- Set Fault Data--> + <copy> + <from>'Ilias returned failed.'</from> + <to variable="IliasFault" part="cause"/> + </copy> + <copy> + <from>'DeleteCategory.bpel'</from> + <to variable="IliasFault" part="process"/> + </copy> + <copy> + <from>sxxf:doMarshal($AddCategoryIn.category)</from> + <to variable="IliasFault" part="context"/> + </copy> + </assign> + <reply name="ReplyWithIliasFault" partnerLink="IliasAdapter" operation="addCategory" portType="tns:AddCategoryPortType" faultName="tns:IliasFault" variable="IliasFault"/> + </sequence> + </else> + </if> + </sequence> + </scope> - <assign name="prepareReply"> - <copy> - <from>$AddObjectOut.ref_id</from> - <to>$AddCategoryOut.categoryId</to> - </copy> - </assign> +<!-- Copy the actial Title! .category/dt:attribute[dt:name = 'name']/dt:value!--> - <reply name="returnCategoryId" partnerLink="IliasAdapter" operation="addCategory" - xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddCategory" - portType="tns:AddCategoryPortType" - variable="AddCategoryOut"/> + + <!-- Render XML to string --> </sequence> </process> Modified: trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddCategory.wsdl =================================================================== --- trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddCategory.wsdl 2009-06-25 13:51:28 UTC (rev 269) +++ trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddCategory.wsdl 2009-06-25 13:52:19 UTC (rev 270) @@ -5,7 +5,8 @@ xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddCategory" xmlns:ns="http://cse.campussource.de/schema/DataTypes" - xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"> + xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" xmlns:ns0="http://j2ee.netbeans.org/wsdl/ILIASClientAdapter/faultHandlingMsg"> + <import location="faultHandlingMsg.wsdl" namespace="http://j2ee.netbeans.org/wsdl/ILIASClientAdapter/faultHandlingMsg"/> <types> <xsd:schema targetNamespace="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddCategory"> <xsd:import namespace="http://cse.campussource.de/schema/DataTypes" schemaLocation="Common/CDDM.xsd"/> @@ -22,6 +23,9 @@ <operation name="addCategory"> <input name="input1" message="tns:AddCategoryRequest"/> <output name="output1" message="tns:AddCategoryResponse"/> + <fault name="SystemFault" message="ns0:systemFaultMessage"/> + <fault name="IliasFault" message="ns0:iliasFaultMessage"/> + <fault name="UnknownFault" message="ns0:unknownFaultMessage"/> </operation> </portType> <plnk:partnerLinkType name="AddCategory"> Modified: trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddCourse.bpel =================================================================== --- trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddCourse.bpel 2009-06-25 13:51:28 UTC (rev 269) +++ trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddCourse.bpel 2009-06-25 13:52:19 UTC (rev 270) @@ -12,14 +12,17 @@ xmlns:ns0="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:il_crs="http://cse.campussource.de/schema/ilias/course" xmlns:il_objs="http://cse.campussource.de/schema/ilias/objects" + xmlns:fltns="http://j2ee.netbeans.org/wsdl/ILIASClientAdapter/faultHandlingMsg" xmlns:dt="http://cse.campussource.de/schema/DataTypes" - xmlns:tns="http://cse.campussource.de/bpel/ILIASClientAdapter/AddCourse"> + xmlns:tns="http://cse.campussource.de/bpel/ILIASClientAdapter/AddCourse" + xmlns:sxed2="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Editor2"> <import namespace="http://enterprise.netbeans.org/bpel/ilias-3.10.5-Wrapper" location="ilias-3.10.5-Wrapper.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/> <import namespace="urn:ilUserAdministration" location="ilias-3.10.5-fixed.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/> <import namespace="http://cse.campussource.de/schema/ilias/course" location="ilias-course.xsd" importType="http://www.w3.org/2001/XMLSchema"/> <import namespace="http://cse.campussource.de/schema/ilias/objects" location="ilias-objects.xsd" importType="http://www.w3.org/2001/XMLSchema"/> <import namespace="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddCourse" location="AddCourse.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/> + <import namespace="http://j2ee.netbeans.org/wsdl/ILIASClientAdapter/faultHandlingMsg" location="faultHandlingMsg.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/> <partnerLinks> <partnerLink name="IliasAdapter" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddCourse" partnerLinkType="tns:AddCourse" @@ -53,41 +56,102 @@ <!-- Course description in Ilias-Format --> <variable name="CourseXML" element="il_crs:Course"/> + <!--FaultHandling Variables --> + <variable name="SystemFault" messageType="fltns:systemFaultMessage"/> + <variable name="UnknownFault" messageType="fltns:unknownFaultMessage"/> + <variable name="IliasFault" messageType="fltns:iliasFaultMessage"/> + </variables> <sequence> <!-- Init variables --> - <receive name="start" createInstance="yes" partnerLink="IliasAdapter" operation="addCourse" - xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddCourse" + <scope name="AddCourseScope"> + <faultHandlers> + <catch faultName="sxeh:systemFault"> + <sequence> + <!-- Set Fault Data--> + <assign name="prepareSystemFaultReply"> + <sxt:trace> + <sxt:log level="info" location="onStart"> + <from>concat('*** System Fault occured in AddCourse()!', ' ')</from> + </sxt:log> + </sxt:trace> + <copy> + <from>'AddCourse failed with a SystemFault.'</from> + <to variable="SystemFault" part="cause"/> + </copy> + <copy> + <from>'AddCourse.bpel'</from> + <to variable="SystemFault" part="process"/> + </copy> + <copy> + <from>sxxf:doMarshal($AddCourseIn.course)</from> + <to variable="SystemFault" part="context"/> + </copy> + </assign> + <reply name="ReplyWithSystemFault" partnerLink="IliasAdapter" operation="addCourse" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddCourse" portType="tns:AddCoursePortType" faultName="tns:SystemFault" variable="SystemFault"/> + </sequence> + </catch> + <catchAll> + <sequence> + <!-- Set Fault Data--> + <assign name="prepareUnknownFaultReply"> + <sxt:trace> + <sxt:log level="info" location="onStart"> + <from>concat('***AddCourse failed with an UnknownFault', ' ')</from> + </sxt:log> + </sxt:trace> + + <copy> + <from>'AddCourse failed with an UnknownFault'</from> + <to variable="UnknownFault" part="cause"/> + </copy> + <copy> + <from>sxxf:doMarshal($AddCourseIn.course)</from> + <to variable="UnknownFault" part="context"/> + </copy> + <copy> + <from>'AddCourse.bpel'</from> + <to variable="UnknownFault" part="process"/> + </copy> + </assign> + <reply name="ReplyWithUnknownFault" partnerLink="IliasAdapter" operation="addCourse" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddCourse" portType="tns:AddCoursePortType" faultName="tns:UnknownFault" variable="UnknownFault"/> + </sequence> + </catchAll> + </faultHandlers> + + <sequence> + <receive name="start" createInstance="yes" partnerLink="IliasAdapter" operation="addCourse" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddCourse" portType="tns:AddCoursePortType" variable="AddCourseIn"/> - <assign name="init"> - <copy> - <from>0</from> - <to variable="CategoryRefId"/> - </copy> - </assign> + <assign name="init"> + <copy> + <from>0</from> + <to variable="CategoryRefId"/> + </copy> + </assign> + <!-- Prepeare search by title --> - <assign name="prepareGetObjectsByTitle"> - <copy> - <from>$AddCourseIn.SID</from> - <to>$GetObjectsByTitleIn.sid</to> - </copy> - <copy> - <from>'test'</from> - <to>$GetObjectsByTitleIn.title</to> - </copy> - <copy> - <from>0</from> - <to>$GetObjectsByTitleIn.user_id</to> - </copy> - </assign> + <assign name="prepareGetObjectsByTitle"> + <copy> + <from>$AddCourseIn.SID</from> + <to>$GetObjectsByTitleIn.sid</to> + </copy> + <copy> + <from>'test'</from> + <to>$GetObjectsByTitleIn.title</to> + </copy> + <copy> + <from>0</from> + <to>$GetObjectsByTitleIn.user_id</to> + </copy> + </assign> <!-- Do search --> - <invoke name="getObjectsByTitle" partnerLink="ILIAS" operation="getObjectsByTitle" xmlns:tns="urn:ilUserAdministration" + <invoke name="getObjectsByTitle" partnerLink="ILIAS" operation="getObjectsByTitle" xmlns:tns="urn:ilUserAdministration" portType="tns:ILIASSoapWebservicePortType" inputVariable="GetObjectsByTitleIn" outputVariable="GetObjectsByTitleOut"> @@ -100,27 +164,27 @@ </sxt:log> </sxt:trace> --> - </invoke> + </invoke> <!-- Don't try to unmarshal empty string (i.e. no objects found) --> - <if> - <condition>$GetObjectsByTitleOut.object_xml != ''</condition> - <sequence name="processObjectsXML"> - <sxt:trace> - <sxt:log level="info" location="onStart"> - <from>'*** Processing ObjectsXML...'</from> - </sxt:log> - </sxt:trace> + <if> + <condition>$GetObjectsByTitleOut.object_xml != ''</condition> + <sequence name="processObjectsXML"> + <sxt:trace> + <sxt:log level="info" location="onStart"> + <from>'*** Processing ObjectsXML...'</from> + </sxt:log> + </sxt:trace> <!-- Convert to XML structure --> - <assign name="unmarshalResult" > - <copy> - <from>sxxf:doUnMarshal($GetObjectsByTitleOut.object_xml)</from> - <to variable="ObjectsRawXML"/> - </copy> - </assign> + <assign name="unmarshalResult" > + <copy> + <from>sxxf:doUnMarshal($GetObjectsByTitleOut.object_xml)</from> + <to variable="ObjectsRawXML"/> + </copy> + </assign> - <assign> + <assign> <!-- BUG: java.util.logging.ErrorManager: 5: Error in extracting Name Value Pairs java.lang.NullPointerException @@ -130,14 +194,14 @@ </sxt:log> </sxt:trace> --> - <copy> - <from>ns0:doXslTransform('urn:stylesheets:setObjectsNS.xsl', $ObjectsRawXML)</from> - <to variable="ObjectsXML"/> - </copy> - </assign> + <copy> + <from>ns0:doXslTransform('urn:stylesheets:setObjectsNS.xsl', $ObjectsRawXML)</from> + <to variable="ObjectsXML"/> + </copy> + </assign> <!-- Determine, if there is a category in the result (Object/@type = "cat") and get it's refId for later --> - <assign name="checkForCategories"> + <assign name="checkForCategories"> <!-- BUG: java.util.logging.ErrorManager: 5: Error in extracting Name Value Pairs @@ -150,168 +214,202 @@ </sxt:trace> --> <!-- Note: if an empty node is return below, it is converted by number() to "NaN" --> - <copy> - <from>number($ObjectsXML/il_objs:Object[@il_objs:type = 'cat']/il_objs:References/@il_objs:ref_id)</from> - <to variable="CategoryRefId"/> - </copy> - </assign> - </sequence> - </if> + <copy> + <from>number($ObjectsXML/il_objs:Object[@il_objs:type = 'cat']/il_objs:References/@il_objs:ref_id)</from> + <to variable="CategoryRefId"/> + </copy> + </assign> + </sequence> + </if> <!-- If no appropriate catgeory was found, create one --> - <if> - <condition>string($CategoryRefId) = 'NaN' or $CategoryRefId = 0</condition> - <sequence name="addTestCategory"> - <assign name="prepareAddCategory"> - <copy> - <from>$AddCourseIn.SID</from> - <to>$AddObjectIn.sid</to> - </copy> - <copy> - <from>1</from> - <to>$AddObjectIn.target_id</to> - </copy> - <copy> - <from> - <literal> - <Object xmlns="http://cse.campussource.de/schema/ilias/objects" type="cat"> - <Title>test</Title> - <Description>test category</Description> - </Object> - </literal> - </from> - <to variable="CategoryXML"/> - </copy> - </assign> + <if> + <condition>string($CategoryRefId) = 'NaN' or $CategoryRefId = 0</condition> + <sequence name="addTestCategory"> + <assign name="prepareAddCategory"> + <copy> + <from>$AddCourseIn.SID</from> + <to>$AddObjectIn.sid</to> + </copy> + <copy> + <from>1</from> + <to>$AddObjectIn.target_id</to> + </copy> + <copy> + <from> + <literal> + <Object xmlns="http://cse.campussource.de/schema/ilias/objects" type="cat"> + <Title>test</Title> + <Description>test category</Description> + </Object> + </literal> + </from> + <to variable="CategoryXML"/> + </copy> + </assign> <!-- Render XML to string --> - <assign name="marshalCategoryXML"> - <copy> - <from>sxxf:doMarshal($CategoryXML)</from> - <to>$AddObjectIn.object_xml</to> - </copy> - </assign> + <assign name="marshalCategoryXML"> + <copy> + <from>sxxf:doMarshal($CategoryXML)</from> + <to>$AddObjectIn.object_xml</to> + </copy> + </assign> - <invoke name="addCategory" partnerLink="ILIAS" operation="addObject" xmlns:tns="urn:ilUserAdministration" + <invoke name="addCategory" partnerLink="ILIAS" operation="addObject" xmlns:tns="urn:ilUserAdministration" portType="tns:ILIASSoapWebservicePortType" inputVariable="AddObjectIn" outputVariable="AddObjectOut"> - <sxt:trace> - <sxt:log level="info" location="onStart"> - <from>concat('*** Adding Category: ', $AddObjectIn.object_xml)</from> - </sxt:log> - </sxt:trace> - </invoke> + <sxt:trace> + <sxt:log level="info" location="onStart"> + <from>concat('*** Adding Category: ', $AddObjectIn.object_xml)</from> + </sxt:log> + </sxt:trace> + </invoke> <!-- Set RefId --> - <assign name="setRefId"> + <assign name="setRefId"> + <copy> + <from>$AddObjectOut.ref_id</from> + <to variable="CategoryRefId"/> + </copy> + </assign> + </sequence> + </if> + + <!-- Initialize course xml skeleton --> + <assign name="initializeCourseXML"> <copy> - <from>$AddObjectOut.ref_id</from> - <to variable="CategoryRefId"/> + <from> + <literal> + <Course xmlns="http://cse.campussource.de/schema/ilias/course"> + <MetaData xmlns="http://cse.campussource.de/schema/ilias/course"> + <General> + <Title Language="en"/> + <Language Language="en">en</Language> + <Description Language="en">No description provided</Description> + </General> + </MetaData> + </Course> + </literal> + </from> + <to variable="CourseXML"/> </copy> </assign> - </sequence> - </if> - <!-- Initialize course xml skeleton --> - <assign name="initializeCourseXML"> - <copy> - <from> - <literal> - <Course xmlns="http://cse.campussource.de/schema/ilias/course"> - <MetaData xmlns="http://cse.campussource.de/schema/ilias/course"> - <General> - <Title Language="en"/> - <Language Language="en">en</Language> - <Description Language="en">No description provided</Description> - </General> - </MetaData> - </Course> - </literal> - </from> - <to variable="CourseXML"/> - </copy> - </assign> - <!-- Set relevant course data --> - <assign name="setCourseData"> + <assign name="setCourseData"> <!-- Set title --> - <copy> - <from>$AddCourseIn.course/dt:attribute[dt:name = 'title']/dt:value</from> - <to>$CourseXML/il_crs:MetaData/il_crs:General/il_crs:Title/text()</to> - </copy> + <copy> + <from>$AddCourseIn.course/dt:attribute[dt:name = 'title']/dt:value</from> + <to>$CourseXML/il_crs:MetaData/il_crs:General/il_crs:Title/text()</to> + </copy> <!-- Set Description --> - <copy ignoreMissingFromData="yes"> - <from>$AddCourseIn.course/dt:attribute[dt:name = 'shortDescription']/dt:value</from> - <to>$CourseXML/il_crs:MetaData/il_crs:General/il_crs:Description/text()</to> - </copy> + <copy ignoreMissingFromData="yes"> + <from>$AddCourseIn.course/dt:attribute[dt:name = 'shortDescription']/dt:value</from> + <to>$CourseXML/il_crs:MetaData/il_crs:General/il_crs:Description/text()</to> + </copy> <!-- Set Language: use init value as default --> - <copy ignoreMissingFromData="yes"> - <from>$AddCourseIn.course/dt:attribute[dt:name = 'languageISO']/dt:value</from> - <to>$CourseXML/il_crs:MetaData/il_crs:General/il_crs:Title/@il_crs:Language</to> - </copy> - <copy ignoreMissingFromData="yes"> - <from>$AddCourseIn.course/dt:attribute[dt:name = 'languageISO']/dt:value</from> - <to>$CourseXML/il_crs:MetaData/il_crs:General/il_crs:Language/@il_crs:Language</to> - </copy> - <copy ignoreMissingFromData="yes"> - <from>$AddCourseIn.course/dt:attribute[dt:name = 'languageISO']/dt:value</from> - <to>$CourseXML/il_crs:MetaData/il_crs:General/il_crs:Language/text()</to> - </copy> - <copy ignoreMissingFromData="yes"> - <from>$AddCourseIn.course/dt:attribute[dt:name = 'languageISO']/dt:value</from> - <to>$CourseXML/il_crs:MetaData/il_crs:General/il_crs:Description/@il_crs:Language</to> - </copy> + <copy ignoreMissingFromData="yes"> + <from>$AddCourseIn.course/dt:attribute[dt:name = 'languageISO']/dt:value</from> + <to>$CourseXML/il_crs:MetaData/il_crs:General/il_crs:Title/@il_crs:Language</to> + </copy> + <copy ignoreMissingFromData="yes"> + <from>$AddCourseIn.course/dt:attribute[dt:name = 'languageISO']/dt:value</from> + <to>$CourseXML/il_crs:MetaData/il_crs:General/il_crs:Language/@il_crs:Language</to> + </copy> + <copy ignoreMissingFromData="yes"> + <from>$AddCourseIn.course/dt:attribute[dt:name = 'languageISO']/dt:value</from> + <to>$CourseXML/il_crs:MetaData/il_crs:General/il_crs:Language/text()</to> + </copy> + <copy ignoreMissingFromData="yes"> + <from>$AddCourseIn.course/dt:attribute[dt:name = 'languageISO']/dt:value</from> + <to>$CourseXML/il_crs:MetaData/il_crs:General/il_crs:Description/@il_crs:Language</to> + </copy> - </assign> + </assign> <!-- Set all parts for addCourse call --> - <assign name="prepareAddCourse"> + <assign name="prepareAddCourse"> <!-- Set SID --> - <copy> - <from>$AddCourseIn.SID</from> - <to variable="IliasAddCourseIn" part="sid"/> - </copy> + <copy> + <from>$AddCourseIn.SID</from> + <to variable="IliasAddCourseIn" part="sid"/> + </copy> <!-- Set targetRefId with defaut value (= catgeory-root hopefully...) --> - <copy> - <from variable="CategoryRefId"/> - <to variable="IliasAddCourseIn" part="target_id"/> - </copy> + <copy> + <from variable="CategoryRefId"/> + <to variable="IliasAddCourseIn" part="target_id"/> + </copy> <!-- Set CourseXML (as string) --> - <copy> - <from>sxxf:doMarshal($CourseXML)</from> - <to variable="IliasAddCourseIn" part="crs_xml"/> - </copy> - </assign> + <copy> + <from>sxxf:doMarshal($CourseXML)</from> + <to variable="IliasAddCourseIn" part="crs_xml"/> + </copy> + </assign> - <invoke name="createLecture" partnerLink="ILIAS" operation="addCourse" xmlns:tns="urn:ilUserAdministration" + <invoke name="createLecture" partnerLink="ILIAS" operation="addCourse" xmlns:tns="urn:ilUserAdministration" portType="tns:ILIASSoapWebservicePortType" inputVariable="IliasAddCourseIn" outputVariable="IliasAddCourseOut"> - <sxt:trace> - <sxt:log level="info" location="onStart"> - <from>concat('*** Adding Course (refId: ', $IliasAddCourseIn.target_id, ', xml: ', $IliasAddCourseIn.crs_xml, ')')</from> - </sxt:log> + <sxt:trace> + <sxt:log level="info" location="onStart"> + <from>concat('*** Adding Course (refId: ', $IliasAddCourseIn.target_id, ', xml: ', $IliasAddCourseIn.crs_xml, ')')</from> + </sxt:log> - <sxt:log level="info" location="onComplete"> - <from>concat('*** Result of addCourse: ', $IliasAddCourseOut.course_id)</from> - </sxt:log> - </sxt:trace> - </invoke> + <sxt:log level="info" location="onComplete"> + <from>concat('*** Result of addCourse: ', $IliasAddCourseOut.course_id)</from> + </sxt:log> + </sxt:trace> + </invoke> - <assign name="prepeareReply"> - <copy> - <from>$IliasAddCourseOut.course_id</from> - <to>$AddCourseOut.courseId</to> - </copy> - </assign> - - <reply name="returnCourseId" partnerLink="IliasAdapter" operation="addCourse" - xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddCourse" + <!-- If courseId less or equel 0, fault reply, otherwise reply with CourseId--> + <if> + <condition>0 <= $IliasAddCourseOut.course_id</condition> + <sequence> + <assign name="prepeareReply"> + <copy> + <from>$IliasAddCourseOut.course_id</from> + <to>$AddCourseOut.courseId</to> + </copy> + </assign> + <reply name="returnCourseId" partnerLink="IliasAdapter" operation="addCourse" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddCourse" portType="tns:AddCoursePortType" variable="AddCourseOut"/> + </sequence> + <else> + <sequence> + <!-- Set Fault Data--> + <assign name="PrepareForReplyWithIliasFault"> + + <sxt:trace> + <sxt:log level="info" location="onStart"> + <from>concat('***AddCourse failed with an IliasFault, no valid CourseId returned', ' ')</from> + </sxt:log> + </sxt:trace> + + <copy> + <from>'AddCourse failed, CourseId returned By Ilias was wrong'</from> + <to variable="IliasFault" part="cause"/> + </copy> + <copy> + <from>sxxf:doMarshal($AddCourseIn.course)</from> + <to variable="IliasFault" part="context"/> + </copy> + <copy> + <from>'AddCourse.bpel'</from> + <to variable="IliasFault" part="process"/> + </copy> + + </assign> + <reply name="ReplyWithIliasFault" partnerLink="IliasAdapter" operation="addCourse" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddCourse" portType="tns:AddCoursePortType" faultName="tns:IliasFault" variable="IliasFault"/> + </sequence> + </else> + </if> + </sequence> + </scope> </sequence> </process> Modified: trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddCourse.wsdl =================================================================== --- trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddCourse.wsdl 2009-06-25 13:51:28 UTC (rev 269) +++ trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/AddCourse.wsdl 2009-06-25 13:52:19 UTC (rev 270) @@ -5,7 +5,8 @@ xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddCourse" xmlns:ns="http://cse.campussource.de/schema/DataTypes" - xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"> + xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" xmlns:ns0="http://j2ee.netbeans.org/wsdl/ILIASClientAdapter/faultHandlingMsg"> + <import location="faultHandlingMsg.wsdl" namespace="http://j2ee.netbeans.org/wsdl/ILIASClientAdapter/faultHandlingMsg"/> <types> <xsd:schema targetNamespace="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddCourse"> <xsd:import namespace="http://cse.campussource.de/schema/DataTypes" schemaLocation="Common/CDDM.xsd"/> @@ -22,6 +23,9 @@ <operation name="addCourse"> <input name="input1" message="tns:AddCourseRequest"/> <output name="output1" message="tns:AddCourseResponse"/> + <fault name="SystemFault" message="ns0:systemFaultMessage"/> + <fault name="IliasFault" message="ns0:iliasFaultMessage"/> + <fault name="UnknownFault" message="ns0:unknownFaultMessage"/> </operation> </portType> <plnk:partnerLinkType name="AddCourse"> Modified: trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/DeleteCategory.bpel =================================================================== --- trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/DeleteCategory.bpel 2009-06-25 13:51:28 UTC (rev 269) +++ trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/DeleteCategory.bpel 2009-06-25 13:52:19 UTC (rev 270) @@ -11,11 +11,14 @@ xmlns:tns="http://cse.campussource.de/bpel/ILIASClientAdapter/DeleteCategory" xmlns:ns0="http://docs.oasis-open.org/wsbpel/2.0/process/executable" xmlns:ns1="http://cse.campussource.de/wsdl/ILIASClientAdapter/DeleteCategory" - xmlns:sxxf="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/XPathFunctions"> + xmlns:sxxf="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/XPathFunctions" + xmlns:fltns="http://j2ee.netbeans.org/wsdl/ILIASClientAdapter/faultHandlingMsg" + xmlns:sxed2="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Editor2"> <import namespace="http://cse.campussource.de/wsdl/ILIASClientAdapter/DeleteCategory" location="DeleteCategory.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/> <import namespace="http://enterprise.netbeans.org/bpel/ilias-3.10.5-Wrapper" location="ilias-3.10.5-Wrapper.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/> <import namespace="urn:ilUserAdministration" location="ilias-3.10.5-fixed.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/> + <import namespace="http://j2ee.netbeans.org/wsdl/ILIASClientAdapter/faultHandlingMsg" location="faultHandlingMsg.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/> <partnerLinks> <partnerLink name="ILIAS" xmlns:tns="http://enterprise.netbeans.org/bpel/ilias-3.10.5-Wrapper" partnerLinkType="tns:ILIASSoapWebserviceLinkType" partnerRole="ILIASSoapWebserviceRole"/> @@ -23,19 +26,24 @@ myRole="DeleteCategoryPortTypeRole"/> </partnerLinks> <variables> + <variable name="DeleteObjectOut" xmlns:tns="urn:ilUserAdministration" messageType="tns:deleteObjectResponse"/> <variable name="DeleteObjectIn" xmlns:tns="urn:ilUserAdministration" messageType="tns:deleteObjectRequest"/> <variable name="DeleteCategoryOut" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/DeleteCategory" messageType="tns:deleteCategoryResponse"/> <variable name="DeleteCategoryIn" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/DeleteCategory" messageType="tns:deleteCategoryRequest"/> - <variable name="SystemFault" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/DeleteCategory" messageType="tns:systemFaultMessage" /> - <variable name="UnknownFault" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/DeleteCategory" messageType="tns:unknownFaultMessage" /> - <variable name="IliasFault" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/DeleteCategory" messageType="tns:iliasFaultMessage" /> + + <!--FaultHandling Variables --> + + <variable name="SystemFault" messageType="fltns:systemFaultMessage"/> + <variable name="UnknownFault" messageType="fltns:unknownFaultMessage"/> + <variable name="IliasFault" messageType="fltns:iliasFaultMessage"/> </variables> <sequence> <scope name="DeleteCategoryScope" xmlns:tns="urn:ilUserAdministration"> <faultHandlers> <catch faultName="sxeh:systemFault"> <sequence > + <!-- Set Fault Data--> <assign name="prepareSystemFaultReply"> <sxt:trace> <sxt:log level="info" location="onStart"> @@ -47,41 +55,49 @@ <to variable="DeleteCategoryOut" part="success"/> </copy> <copy> - <from>'System-Fault while calling Ilias-WS!'</from> - <to>$SystemFault.cause</to> + <from>'DeleteCategory failed with a SystemFault.'</from> + <to variable="SystemFault" part="cause"/> </copy> + <copy> + <from>sxxf:doMarshal($DeleteCategoryIn.category)</from> + <to variable="SystemFault" part="context"/> + </copy> + <copy> + <from>'DeleteCategory.bpel'</from> + <to variable="SystemFault" part="process"/> + </copy> </assign> <reply name="replyWithSystemFault" partnerLink="IliasAdapter" operation="deleteCategory" portType="ns1:DeleteCategoryPortType" - faultName="ns1:SystemFault" - variable="SystemFault"/> + faultName="ns1:SystemFault" variable="SystemFault"/> </sequence> </catch> -<!-- + <catchAll> <sequence> <assign name="prepareUnknownFaultReply"> + <!-- Set Fault Data--> <sxt:trace> <sxt:log level="info" location="onStart"> - <from>concat('*** Unknown Fault occured!', ' ')</from> + <from>concat('*** Unknown Fault occured in DeleteCategory!', ' ')</from> </sxt:log> </sxt:trace> <copy> - <from>false()</from> - <to variable="DeleteCategoryOut" part="success"/> + <from>'DeleteCategory failed by Ilias with some unknown Fault'</from> + <to variable="UnknownFault" part="cause"/> </copy> <copy> - <from>'Unknown-Fault while calling Ilias-WS!'</from> - <to>$Fault.cause</to> + <from>sxxf:doMarshal($DeleteCategoryIn.category)</from> + <to variable="UnknownFault" part="context"/> </copy> + <copy> + <from>'DeleteCategory.bpel'</from> + <to variable="UnknownFault" part="process"/> + </copy> </assign> - <reply name="replyWithUnknownFault" partnerLink="IliasAdapter" operation="deleteCategory" - portType="ns1:DeleteCategoryPortType" - faultName="ns1:UnknownFault" - variable="Fault"/> + <reply name="ReplyWithUnknownFault" partnerLink="IliasAdapter" operation="deleteCategory" portType="ns1:DeleteCategoryPortType" faultName="ns1:UnknownFault" variable="UnknownFault"/> </sequence> </catchAll> ---> </faultHandlers> <sequence> @@ -109,7 +125,7 @@ </invoke> <if name="IfDeleteObjectSucceed"> <condition>$DeleteObjectOut.success</condition> - <sequence name="Sequence1"> + <sequence> <assign name="PrepareReply"> <sxt:trace> <sxt:log level="info" location="onStart"> @@ -127,17 +143,30 @@ variable="DeleteCategoryOut"/> </sequence> <else> - <sequence name="Sequence2"> + <sequence> <assign name="prepareIliasFaultReply"> + <!-- Set Fault Data--> + <sxt:trace> + <sxt:log level="info" location="onStart"> + <from>concat('*** Ilias Fault occured in DeleteCategory!', ' ')</from> + </sxt:log> + </sxt:trace> <copy> - <from>'Ilias signaled failure!'</from> - <to>$IliasFault.cause</to> + <from>'Ilias returned failed.'</from> + <to variable="IliasFault" part="cause"/> </copy> + <copy> + <from>sxxf:doMarshal($DeleteCategoryIn.category)</from> + <to variable="IliasFault" part="context"/> + </copy> + <copy> + <from>'DeleteCategory.bpel'</from> + <to variable="IliasFault" part="process"/> + </copy> </assign> - <reply name="replyWithIliaFault" partnerLink="IliasAdapter" operation="deleteCategory" + <reply name="replyWithIliasFault" partnerLink="IliasAdapter" operation="deleteCategory" portType="ns1:DeleteCategoryPortType" - faultName="ns1:IliasFault" - variable="IliasFault"/> + faultName="ns1:IliasFault" variable="IliasFault"/> </sequence> </else> </if> Modified: trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/DeleteCategory.wsdl =================================================================== --- trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/DeleteCategory.wsdl 2009-06-25 13:51:28 UTC (rev 269) +++ trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/DeleteCategory.wsdl 2009-06-25 13:52:19 UTC (rev 270) @@ -5,7 +5,8 @@ xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/DeleteCategory" xmlns:ns="http://cse.campussource.de/schema/DataTypes" - xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"> + xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype" xmlns:ns0="http://j2ee.netbeans.org/wsdl/ILIASClientAdapter/faultHandlingMsg"> + <import location="faultHandlingMsg.wsdl" namespace="http://j2ee.netbeans.org/wsdl/ILIASClientAdapter/faultHandlingMsg"/> <types> <xsd:schema targetNamespace="http://cse.campussource.de/wsdl/ILIASClientAdapter/DeleteCategory"> ... [truncated message content] |