|
From: <pka...@us...> - 2009-07-07 14:48:30
|
Revision: 322
http://cse-ip.svn.sourceforge.net/cse-ip/?rev=322&view=rev
Author: pkasprzak
Date: 2009-07-07 14:25:10 +0000 (Tue, 07 Jul 2009)
Log Message:
-----------
* Support for add / delete accounts (untested)
Modified Paths:
--------------
trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/OutboundClientAdapter.bpel
Modified: trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/OutboundClientAdapter.bpel
===================================================================
--- trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/OutboundClientAdapter.bpel 2009-07-07 14:22:44 UTC (rev 321)
+++ trunk/sandbox/lsf-adapter-demo/ILIASClientAdapter/src/OutboundClientAdapter.bpel 2009-07-07 14:25:10 UTC (rev 322)
@@ -38,7 +38,8 @@
<import namespace="http://j2ee.netbeans.org/wsdl/ObjectProcessor/ReplyProcessor" location="ObjectProcessor/ReplyProcessor.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/"/>
<import namespace="http://cse.campussource.de/wsdl/ILIASClientAdapter/ResolveEPR" location="ResolveEPR.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
-
+ <import namespace="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddAccount" location="AddAccount.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import namespace="http://cse.campussource.de/wsdl/ILIASClientAdapter/DeleteAccount" location="DeleteAccount.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
<partnerLinks>
<partnerLink name="ResolveEPR" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/ResolveEPR" partnerLinkType="tns:ResolveEPR"
partnerRole="ResolveEPRPortTypeRole"/>
@@ -56,6 +57,8 @@
partnerRole="UpdateCategoryPortTypeRole"/>
<partnerLink name="DeleteCategory" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/DeleteCategory" partnerLinkType="tns:DeleteCategory"
partnerRole="DeleteCategoryPortTypeRole"/>
+ <partnerLink name="AddAccount" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddAccount" partnerLinkType="tns:AddAccount" partnerRole="AddAccountPortTypeRole"/>
+ <partnerLink name="DeleteAccount" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/DeleteAccount" partnerLinkType="tns:DeleteAccount" partnerRole="DeleteAccountPortTypeRole"/>
<partnerLink name="ReplyProcessor" xmlns:tns="http://j2ee.netbeans.org/wsdl/ObjectProcessor/ReplyProcessor" partnerLinkType="tns:ReplyProcessor"
partnerRole="ReplyProcessorPortTypeRole"/>
<partnerLink name="ILIAS" xmlns:tns="http://enterprise.netbeans.org/bpel/ilias-3.10.5-Wrapper" partnerLinkType="tns:ILIASSoapWebserviceLinkType"
@@ -66,6 +69,7 @@
<variables>
<!-- Messages -->
+ <variable name="ProcessAccountIn" xmlns:tns="http://j2ee.netbeans.org/wsdl/ILIASClientAdapter/ILIASClientAdapter" messageType="tns:ProcessAccountOperationRequest"/>
<variable name="ResolveEPROut" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/ResolveEPR" messageType="tns:resolveEPRResponse"/>
<variable name="ResolveEPRIn" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/ResolveEPR" messageType="tns:resolveEPRRequest"/>
<variable name="ProcessReplyIn" xmlns:tns="http://j2ee.netbeans.org/wsdl/ObjectProcessor/ReplyProcessor" messageType="tns:processReplyRequest"/>
@@ -178,6 +182,8 @@
</faultHandlers>
<pick name="processObjects" createInstance="yes" xmlns:tns="http://j2ee.netbeans.org/wsdl/ILIASClientAdapter/ILIASClientAdapter">
+
+ <!-- Process courses -->
<onMessage partnerLink="ILIASAdapter" operation="processCourse" xmlns:tns="http://j2ee.netbeans.org/wsdl/ILIASClientAdapter/ILIASClientAdapter"
portType="tns:ILIASClientAdapterPortType"
variable="ProcessCourseOperationIn">
@@ -402,6 +408,8 @@
</scope>
</onMessage>
+
+ <!-- Process categories -->
<onMessage partnerLink="ILIASAdapter" operation="processCategory" xmlns:tns="http://j2ee.netbeans.org/wsdl/ILIASClientAdapter/ILIASClientAdapter"
portType="tns:ILIASClientAdapterPortType"
variable="ProcessCategoryOperationIn">
@@ -428,7 +436,7 @@
</copy>
</assign>
- <assign name="prepareLoginForCourses">
+ <assign name="prepareLoginForCategories">
<copy>
<from>$ProcessCategoryOperationIn.categoryMessage/dt:target</from>
<to>$LoginIn.system</to>
@@ -622,6 +630,239 @@
</sequence>
</scope>
</onMessage>
+
+ <!-- Process accounts -->
+ <onMessage partnerLink="ILIASAdapter" operation="processAccount" portType="tns:ILIASClientAdapterPortType"
+ variable="ProcessAccountIn">
+
+ <scope name="AccountScope">
+ <variables>
+ <variable name="DeleteAccountOut" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/DeleteAccount" messageType="tns:deleteAccountResponse"/>
+ <variable name="DeleteAccountIn" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/DeleteAccount" messageType="tns:deleteAccountRequest"/>
+ <variable name="AddAccountOut" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddAccount" messageType="tns:AddAccountResponse"/>
+ <variable name="AddAccountIn" xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddAccount" messageType="tns:AddAccountRequest"/>
+ </variables>
+ <sequence>
+ <assign name="setSystem">
+ <copy>
+ <from>$ProcessAccountIn.accountMessage/dt:target</from>
+ <to>$ResolveEPRIn.system</to>
+ </copy>
+ </assign>
+
+ <!-- Determine Ilias Endpoint -->
+ <invoke name="resolveEPR" partnerLink="ResolveEPR" operation="resolveEPR"
+ xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/ResolveEPR"
+ portType="tns:ResolveEPRPortType"
+ inputVariable="ResolveEPRIn"
+ outputVariable="ResolveEPROut"/>
+
+ <assign name="saveIliasEPR">
+ <copy>
+ <from>$ResolveEPROut.EPR</from>
+ <to>$IliasEPR</to>
+ </copy>
+ </assign>
+
+ <assign name="prepareLoginForAccounts">
+ <copy>
+ <from>$ProcessAccountIn.accountMessage/dt:target</from>
+ <to>$LoginIn.system</to>
+ </copy>
+ <copy>
+ <from>$IliasEPR</from>
+ <to>$LoginIn.EPR</to>
+ </copy>
+ </assign>
+
+ <invoke name="loginForAccounts" partnerLink="Login" operation="login"
+ xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/Login"
+ portType="tns:LoginPortType"
+ inputVariable="LoginIn"
+ outputVariable="LoginOut"/>
+ <assign name="initAccountProcessing">
+ <copy>
+ <from variable="LoginOut" part="SID"/>
+ <to variable="SID"/>
+ </copy>
+ <copy>
+ <from>$ProcessAccountIn.accountMessage/dt:account/dt:busId</from>
+ <to>$ObjectBusId</to>
+ </copy>
+ <copy ignoreMissingFromData="yes">
+ <from>$ProcessAccountIn.accountMessage/dt:account/dt:attribute[dt:name = 'clientId']/dt:value</from>
+ <to>$ObjectClientId</to>
+ </copy>
+
+ <!-- Init constants (better alternatives?) -->
+ <copy>
+ <from>'SUCCESS'</from>
+ <to>$STATUS_SUCCESS</to>
+ </copy>
+ <copy>
+ <from>'FAILURE'</from>
+ <to>$STATUS_FAILURE</to>
+ </copy>
+ </assign>
+
+ <!-- Branch on different events -->
+ <if>
+ <sxt:trace>
+ <sxt:log level="info" location="onStart">
+ <from>concat('*** Branching on account-event: ', $ProcessAccountIn.accountMessage/dt:event)</from>
+ </sxt:log>
+ </sxt:trace>
+
+ <!-- Event == "CREATE" -->
+ <condition>$ProcessAccountIn.accountMessage/dt:event = 'CREATE'</condition>
+ <sequence>
+ <assign name="prepareAddAccount">
+ <sxt:trace>
+ <sxt:log level="info" location="onStart">
+ <from>concat('*** addAccount()', '')</from>
+ </sxt:log>
+ </sxt:trace>
+ <copy>
+ <from>$ProcessAccountIn.accountMessage/dt:account</from>
+ <to>$AddAccountIn.account</to>
+ </copy>
+ <copy>
+ <from>$SID</from>
+ <to>$AddAccountIn.SID</to>
+ </copy>
+ <copy>
+ <from>$IliasEPR</from>
+ <to>$AddAccountIn.EPR</to>
+ </copy>
+ </assign>
+ <invoke name="addAccount" partnerLink="AddAccount" operation="addAccount"
+ xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/AddAccount"
+ portType="tns:AddAccountPortType"
+ inputVariable="AddAccountIn"
+ outputVariable="AddAccountOut"/>
+ <assign name="saveAccountId">
+ <copy>
+ <from>string($AddAccountOut.accountId)</from>
+ <to>$ObjectClientId</to>
+ </copy>
+ </assign>
+ <assign name="addAccountSuccess">
+ <copy>
+ <from>$STATUS_SUCCESS</from>
+ <to>$ReplyStatus</to>
+ </copy>
+ </assign>
+ </sequence>
+<!--
+ <elseif>
+-->
+ <!-- Event == "UPDATE" -->
+<!--
+ <condition>$ProcessCategoryOperationIn.categoryMessage/dt:event = 'UPDATE'</condition>
+ <sequence>
+ <assign name="prepareUpdateCategory">
+ <sxt:trace>
+ <sxt:log level="info" location="onStart">
+ <from>concat('*** updateCategory()', '')</from>
+ </sxt:log>
+ </sxt:trace>
+ <copy>
+ <from>$ProcessCategoryOperationIn.categoryMessage/dt:category</from>
+ <to>$UpdateCategoryIn.category</to>
+ </copy>
+ <copy>
+ <from>$SID</from>
+ <to>$UpdateCategoryIn.SID</to>
+ </copy>
+ <copy>
+ <from>$IliasEPR</from>
+ <to>$UpdateCategoryIn.EPR</to>
+ </copy>
+ </assign>
+ <invoke name="updateCategory" partnerLink="UpdateCategory" operation="updateCategory"
+ xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/UpdateCategory"
+ portType="tns:UpdateCategoryPortType"
+ inputVariable="UpdateCategoryIn"
+ outputVariable="UpdateCategoryOut"/>
+ <assign name="updateCategorySuccess">
+ <copy>
+ <from>$STATUS_SUCCESS</from>
+ <to>$ReplyStatus</to>
+ </copy>
+ </assign>
+ </sequence>
+ </elseif>
+-->
+ <elseif>
+ <!-- Event == "DELETE" -->
+ <condition>$ProcessAccountIn.accountMessage/dt:event = 'DELETE'</condition>
+ <sequence>
+ <assign name="prepareDeleteAccount">
+ <sxt:trace>
+ <sxt:log level="info" location="onStart">
+ <from>concat('*** deleteAccount()', '')</from>
+ </sxt:log>
+ </sxt:trace>
+ <copy>
+ <from>$ProcessAccountIn.accountMessage/dt:account</from>
+ <to>$DeleteAccountIn.account</to>
+ </copy>
+ <copy>
+ <from>$SID</from>
+ <to>$DeleteAccountIn.SID</to>
+ </copy>
+ <copy>
+ <from>$IliasEPR</from>
+ <to>$DeleteAccountIn.EPR</to>
+ </copy>
+ </assign>
+ <invoke name="deleteAccount" partnerLink="DeleteAccount" operation="deleteAccount"
+ xmlns:tns="http://cse.campussource.de/wsdl/ILIASClientAdapter/DeleteAccount"
+ portType="tns:DeleteAccountPortType"
+ inputVariable="DeleteAccountIn"
+ outputVariable="DeleteAccountOut"/>
+
+ <assign name="deleteAccountSuccess">
+ <copy>
+ <from>$STATUS_SUCCESS</from>
+ <to>$ReplyStatus</to>
+ </copy>
+ </assign>
+
+ </sequence>
+ </elseif>
+ <else>
+ <!-- Unrecognized Operation: throw fault! -->
+ <sequence >
+ <!--Set Fault Data -->
+ <assign name="PrepareForThrowFaultOperationNotFounded">
+ <sxt:trace>
+ <sxt:log level="info" location="onStart">
+ <from>concat('*** Unknown event!', '')</from>
+ </sxt:log>
+ </sxt:trace>
+ <copy>
+ <from>concat('This Operation is unknown: ', $ProcessAccountIn.accountMessage/dt:event)</from>
+ <to variable="SystemFaultOperationNotFounded" part="cause"/>
+ </copy>
+ <copy>
+ <from>'OutboundClientAdapter.bpel, AccountScope'</from>
+ <to variable="SystemFaultOperationNotFounded" part="process"/>
+ </copy>
+ <copy>
+ <from>sxxf:doMarshal($ProcessAccountIn.accountMessage)</from>
+ <to variable="SystemFaultOperationNotFounded" part="context"/>
+ </copy>
+ </assign>
+ <throw name="ThrowFaultOperationNotFounded" faultVariable="SystemFaultOperationNotFounded"
+ faultName="sxeh:systemFault"/>
+ </sequence>
+ </else>
+ </if>
+ </sequence>
+ </scope>
+
+ </onMessage>
</pick>
</scope>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|