|
From: <pka...@us...> - 2009-07-31 21:53:40
|
Revision: 414
http://cse-ip.svn.sourceforge.net/cse-ip/?rev=414&view=rev
Author: pkasprzak
Date: 2009-07-31 21:53:30 +0000 (Fri, 31 Jul 2009)
Log Message:
-----------
*AddCategory
Added Paths:
-----------
trunk/sandbox/lsf-adapter-demo/ObjectProcessor/src/AddCategory.bpel
trunk/sandbox/lsf-adapter-demo/ObjectProcessor/src/AddCategory.wsdl
Added: trunk/sandbox/lsf-adapter-demo/ObjectProcessor/src/AddCategory.bpel
===================================================================
--- trunk/sandbox/lsf-adapter-demo/ObjectProcessor/src/AddCategory.bpel (rev 0)
+++ trunk/sandbox/lsf-adapter-demo/ObjectProcessor/src/AddCategory.bpel 2009-07-31 21:53:30 UTC (rev 414)
@@ -0,0 +1,424 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<process name="AddCategory"
+ targetNamespace="http://cse.campussource.de/bpel/ObjectProcessor/AddCategory"
+ 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:x="http://docs.oasis-open.org/wsbpel/2.0/process/executable"
+ xmlns:dt="http://cse.campussource.de/schema/DataTypes"
+ xmlns:tns="http://cse.campussource.de/bpel/ObjectProcessor/AddCategory"
+ xmlns:ns0="http://cse.campussource.de/ejb/DependencyManager"
+ xmlns:sxed2="http://www.sun.com/wsbpel/2.0/process/executable/SUNExtension/Editor2">
+
+ <import namespace="http://cse.campussource.de/wsdl/ObjectProcessor/AddCategory" location="AddCategory.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import namespace="http://cse.campussource.de/ejb/EntityManager" location="Common/EntityManager.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import namespace="http://cse.campussource.de/ejb/RelationManager" location="Common/RelationManager.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import namespace="http://cse.campussource.de/ejb/IdentityManager" location="Common/IdentityManager.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import namespace="http://cse.campussource.de/ejb/DependencyManager" location="Common/DependencyManager.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import namespace="http://cse.campussource.de/ejb/SystemManager" location="Common/SystemManager.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
+ <import namespace="http://cse.campussource.de/ejb/LoggingManager" location="Common/LoggingManager.wsdl" importType="http://schemas.xmlsoap.org/wsdl/"/>
+
+ <partnerLinks>
+ <partnerLink name="LoggingManager" xmlns:tns="http://cse.campussource.de/ejb/LoggingManager" partnerLinkType="tns:LoggingManagerLinkType"
+ partnerRole="LoggingManagerRole"/>
+
+ <partnerLink name="EntityManager" xmlns:tns="http://cse.campussource.de/ejb/EntityManager" partnerLinkType="tns:EntityManagerLinkType"
+ partnerRole="EntityManagerRole"/>
+
+ <partnerLink name="RelationManager" xmlns:tns="http://cse.campussource.de/ejb/RelationManager" partnerLinkType="tns:RelationManagerLinkType"
+ partnerRole="RelationManagerRole"/>
+
+ <partnerLink name="IdentityManager" xmlns:tns="http://cse.campussource.de/ejb/IdentityManager" partnerLinkType="tns:IdentityManagerLinkType"
+ partnerRole="IdentityManagerRole"/>
+
+ <partnerLink name="DependencyManager" xmlns:tns="http://cse.campussource.de/ejb/DependencyManager" partnerLinkType="tns:DependencyManagerLinkType"
+ myRole="DependencyManager_Requestor"
+ partnerRole="DependencyManager_Provider"/>
+
+ <partnerLink name="SystemManager" xmlns:tns="http://cse.campussource.de/ejb/SystemManager" partnerLinkType="tns:SystemManagerLinkType"
+ partnerRole="SystemManagerRole"/>
+
+ <partnerLink name="ClientAdapter" xmlns:tns="http://cse.campussource.de/wsdl/ObjectProcessor/AddCategory" partnerLinkType="tns:AddCategory"
+ myRole="AddCategoryPortTypeRole"/>
+ </partnerLinks>
+
+ <variables>
+ <variable name="GetOutboundSystemsOut" xmlns:tns="http://cse.campussource.de/ejb/SystemManager" messageType="tns:getOutboundSystemsResponse"/>
+ <variable name="GetOutboundSystemsIn" xmlns:tns="http://cse.campussource.de/ejb/SystemManager" messageType="tns:getOutboundSystems"/>
+ <variable name="WaitForDependenciesIn" xmlns:tns="http://cse.campussource.de/ejb/DependencyManager" messageType="tns:waitForDependencies"/>
+ <variable name="ProcessCategoryRelationsOut" xmlns:tns="http://cse.campussource.de/ejb/RelationManager" messageType="tns:processCategoryRelationsResponse"/>
+ <variable name="ProcessCategoryRelationsIn" xmlns:tns="http://cse.campussource.de/ejb/RelationManager" messageType="tns:processCategoryRelations"/>
+ <variable name="UpdateAttributesOut" xmlns:tns="http://cse.campussource.de/ejb/EntityManager" messageType="tns:updateAttributesResponse"/>
+ <variable name="UpdateAttributesIn" xmlns:tns="http://cse.campussource.de/ejb/EntityManager" messageType="tns:updateAttributes"/>
+ <variable name="CreateMappingIn" xmlns:tns="http://cse.campussource.de/ejb/IdentityManager" messageType="tns:createMapping"/>
+ <variable name="PersistCategoryOut" xmlns:tns="http://cse.campussource.de/ejb/EntityManager" messageType="tns:persistCategoryResponse"/>
+ <variable name="PersistCategoryIn" xmlns:tns="http://cse.campussource.de/ejb/EntityManager" messageType="tns:persistCategory"/>
+ <variable name="ExistsOut" xmlns:tns="http://cse.campussource.de/ejb/EntityManager" messageType="tns:existsResponse"/>
+ <variable name="ExistsIn" xmlns:tns="http://cse.campussource.de/ejb/EntityManager" messageType="tns:exists"/>
+ <variable name="ProcessCategoryIn" xmlns:tns="http://cse.campussource.de/wsdl/ObjectProcessor/AddCategory" messageType="tns:processCategoryRequest"/>
+
+ <!-- Logging -->
+ <variable name="DebugIn" xmlns:tns="http://cse.campussource.de/ejb/LoggingManager" messageType="tns:debug"/>
+
+ <!-- CSE-id of the category -->
+ <variable name="EntityId" type="xsd:integer"/>
+ <variable name="Event" type="xsd:string"/>
+
+ </variables>
+
+ <correlationSets>
+ <correlationSet name="DependencyManager" properties="ns0:EntityId"/>
+ </correlationSets>
+
+ <sequence>
+ <receive name="start" createInstance="yes" partnerLink="ClientAdapter" operation="processCategory"
+ xmlns:tns="http://cse.campussource.de/wsdl/ObjectProcessor/AddCategory"
+ portType="tns:AddCategoryPortType"
+ variable="ProcessCategoryIn"/>
+ <assign name="init">
+ <!-- Init logging -->
+ <copy>
+ <from>'ObjectProcessor:AddCategory'</from>
+ <to>$DebugIn.parameters/process</to>
+ </copy>
+ </assign>
+
+ <assign name="prepareCheckIfAlreadyExists">
+ <!-- Set system -->
+ <copy>
+ <from>$ProcessCategoryIn.categoryMessage/dt:source</from>
+ <to>$ExistsIn.parameters/system</to>
+ </copy>
+ <!-- Set systemId -->
+ <copy>
+ <from>$ProcessCategoryIn.categoryMessage/dt:category/dt:attribute[dt:name = 'clientId']/dt:value</from>
+ <to>$ExistsIn.parameters/systemId</to>
+ </copy>
+ </assign>
+
+ <invoke name="checkIfCategoryExists" partnerLink="EntityManager" operation="exists"
+ xmlns:tns="http://cse.campussource.de/ejb/EntityManager"
+ portType="tns:EntityManager"
+ inputVariable="ExistsIn"
+ outputVariable="ExistsOut"/>
+
+ <assign name="saveExistingEntityId">
+ <copy>
+ <from>$ExistsOut.parameters/return</from>
+ <to>$EntityId</to>
+ </copy>
+ </assign>
+
+ <if>
+ <condition>$EntityId = 0</condition>
+
+ <!-- Object new => persist it, etc. -->
+ <sequence name="CategoryIsNew">
+
+ <assign name="initCategoryNew">
+ <copy>
+ <from>'CREATE'</from>
+ <to>$Event</to>
+ </copy>
+ </assign>
+
+ <assign>
+ <copy>
+ <from>concat('Category [', $ProcessCategoryIn.categoryMessage/dt:category/dt:attribute[dt:name = 'clientId']/dt:value, '] is new => CREATE')</from>
+ <to>$DebugIn.parameters/message</to>
+ </copy>
+ </assign>
+ <invoke partnerLink="LoggingManager" operation="debug"
+ xmlns:tns="http://cse.campussource.de/ejb/LoggingManager"
+ portType="tns:LoggingManager"
+ inputVariable="DebugIn"/>
+
+ <assign name="preparePersistCategory">
+ <copy>
+ <from>$ProcessCategoryIn.categoryMessage/dt:category</from>
+ <to>$PersistCategoryIn.parameters/category</to>
+ </copy>
+ </assign>
+
+ <invoke name="persistCategory" partnerLink="EntityManager" operation="persistCategory"
+ xmlns:tns="http://cse.campussource.de/ejb/EntityManager"
+ portType="tns:EntityManager"
+ inputVariable="PersistCategoryIn"
+ outputVariable="PersistCategoryOut"/>
+
+ <assign name="saveCreatedEntityId">
+ <copy>
+ <from>$PersistCategoryOut.parameters/return</from>
+ <to>$EntityId</to>
+ </copy>
+ </assign>
+
+ <assign name="prepareCreateMapping">
+ <!-- Set cse-id -->
+ <copy>
+ <from variable="EntityId"/>
+ <to>$CreateMappingIn.parameters/cseId/text()</to>
+ </copy>
+ <!-- Set system -->
+ <copy>
+ <from>$ProcessCategoryIn.categoryMessage/dt:source</from>
+ <to>$CreateMappingIn.parameters/system</to>
+ </copy>
+ <!-- Set id of the object in the system -->
+ <copy>
+ <from>$ProcessCategoryIn.categoryMessage/dt:category/dt:attribute[dt:name = 'clientId']/dt:value</from>
+ <to>$CreateMappingIn.parameters/systemId</to>
+ </copy>
+ </assign>
+
+ <invoke name="createMapping" partnerLink="IdentityManager" operation="createMapping"
+ xmlns:tns="http://cse.campussource.de/ejb/IdentityManager"
+ portType="tns:IdentityManager"
+ inputVariable="CreateMappingIn"/>
+
+
+ </sequence>
+
+ <else>
+ <sequence name="CategoryAlreadyExists">
+
+ <assign name="initCategoryExists">
+ <copy>
+ <from>'NONE'</from>
+ <to>$Event</to>
+ </copy>
+ </assign>
+
+ <assign>
+ <copy>
+ <from>concat('Category [', $ProcessCategoryIn.categoryMessage/dt:category/dt:attribute[dt:name = 'clientId']/dt:value, '] already exists => UPDATE')</from>
+ <to>$DebugIn.parameters/message</to>
+ </copy>
+ </assign>
+ <invoke partnerLink="LoggingManager" operation="debug"
+ xmlns:tns="http://cse.campussource.de/ejb/LoggingManager"
+ portType="tns:LoggingManager"
+ inputVariable="DebugIn"/>
+
+ <assign name="setEntityId">
+ <copy>
+ <from variable="EntityId"/>
+ <to>$ProcessCategoryIn.categoryMessage/dt:category/dt:busId</to>
+ </copy>
+ </assign>
+
+ <empty name="peristUpdatedAttributes"></empty>
+
+
+ <assign name="prepareUpdateAttributes">
+ <copy>
+ <from>x:doXslTransform('urn:stylesheets:prepareUpdateAttributesCall.xsl', $ProcessCategoryIn.categoryMessage/dt:category)</from>
+ <to>$UpdateAttributesIn.parameters</to>
+ </copy>
+ </assign>
+
+ <invoke name="updateAttributes" partnerLink="EntityManager" operation="updateAttributes"
+ xmlns:tns="http://cse.campussource.de/ejb/EntityManager"
+ portType="tns:EntityManager"
+ inputVariable="UpdateAttributesIn"
+ outputVariable="UpdateAttributesOut"/>
+
+ <!-- Check, if attributes have changed -->
+ <if>
+ <condition>$UpdateAttributesOut.parameters/return</condition>
+
+ <!-- Change in attributes => set event to UPDATE -->
+ <assign name="setEventToUpdate">
+ <copy>
+ <from>'UPDATE'</from>
+ <to>$Event</to>
+ </copy>
+ </assign>
+ </if>
+
+ </sequence>
+ </else>
+
+ </if>
+
+ <assign name="prepareProcessRelations">
+ <copy>
+ <from variable="EntityId"/>
+ <to>$ProcessCategoryRelationsIn.parameters/cseId</to>
+ </copy>
+ <copy>
+ <from>$ProcessCategoryIn.categoryMessage/dt:category</from>
+ <to>$ProcessCategoryRelationsIn.parameters/category</to>
+ </copy>
+ <copy>
+ <from>$ProcessCategoryIn.categoryMessage/dt:source</from>
+ <to>$ProcessCategoryRelationsIn.parameters/system</to>
+ </copy>
+ </assign>
+
+ <invoke name="processRelations" partnerLink="RelationManager" operation="processCategoryRelations"
+ xmlns:tns="http://cse.campussource.de/ejb/RelationManager"
+ portType="tns:RelationManager"
+ inputVariable="ProcessCategoryRelationsIn"
+ outputVariable="ProcessCategoryRelationsOut"/>
+
+ <!-- Check, if relations have changed -->
+ <if>
+ <condition>not($ProcessCategoryRelationsOut.parameters/return) and $Event = 'NONE'</condition>
+
+ <!-- Entity already exists, attributes have not changed, relations also have not changed => nothing to do, exit process -->
+ <exit name="exitProcess"/>
+ </if>
+
+ <assign name="prepareWaitForDependencies">
+ <copy>
+ <from variable="EntityId"/>
+ <to>$WaitForDependenciesIn.parameters/entityId</to>
+ </copy>
+ </assign>
+
+ <invoke name="waitForDependencies" partnerLink="DependencyManager" operation="waitForDependencies"
+ xmlns:tns="http://cse.campussource.de/ejb/DependencyManager"
+ portType="tns:DependencyManager"
+ inputVariable="WaitForDependenciesIn">
+ <correlations>
+ <correlation set="DependencyManager" initiate="yes"/>
+ </correlations>
+ </invoke>
+
+ <!-- Nothing to do! -->
+ <assign name="prepareGetOutboundSystems">
+ <copy>
+ <from>
+ <literal>
+ <getOutboundSystems/>
+ </literal>
+ </from>
+ <to>$GetOutboundSystemsIn.parameters</to>
+ </copy>
+ </assign>
+
+ <invoke name="getOutboundSystems" partnerLink="SystemManager" operation="getOutboundSystems"
+ xmlns:tns="http://cse.campussource.de/ejb/SystemManager"
+ portType="tns:SystemManager"
+ inputVariable="GetOutboundSystemsIn"
+ outputVariable="GetOutboundSystemsOut"/>
+
+ <assign>
+ <copy>
+ <from>concat('Outbound-systems: ', sxxf:doMarshal($GetOutboundSystemsOut.parameters))</from>
+ <to>$DebugIn.parameters/message</to>
+ </copy>
+ </assign>
+
+ <invoke partnerLink="LoggingManager" operation="debug"
+ xmlns:tns="http://cse.campussource.de/ejb/LoggingManager"
+ portType="tns:LoggingManager"
+ inputVariable="DebugIn"/>
+
+ <forEach name="Distribute" parallel="no" counterName="SystemCounter">
+
+ <startCounterValue>1</startCounterValue>
+ <finalCounterValue>count($GetOutboundSystemsOut.parameters/*)</finalCounterValue>
+
+ <scope name="SystemScope">
+
+ <variables>
+ <variable name="GetCategoryContextOut" xmlns:tns="http://cse.campussource.de/ejb/EntityManager" messageType="tns:getCategoryContextResponse"/>
+ <variable name="GetCategoryContextIn" xmlns:tns="http://cse.campussource.de/ejb/EntityManager" messageType="tns:getCategoryContext"/>
+ <variable name="NotifyIn" messageType="ns0:notifyRequest"/>
+
+ <variable name="System" type="xsd:string"/>
+ <variable name="EntityId" type="xsd:int"/>
+ </variables>
+
+ <sequence>
+
+ <assign>
+ <copy>
+ <from>'Waiting for notification...'</from>
+ <to>$DebugIn.parameters/message</to>
+ </copy>
+ </assign>
+
+ <invoke partnerLink="LoggingManager" operation="debug"
+ xmlns:tns="http://cse.campussource.de/ejb/LoggingManager"
+ portType="tns:LoggingManager"
+ inputVariable="DebugIn"/>
+
+ <receive name="receiveNotification" createInstance="no" partnerLink="DependencyManager"
+ operation="notify"
+ portType="ns0:DependencyManagerNotification"
+ variable="NotifyIn">
+ <correlations>
+ <correlation set="DependencyManager" initiate="no"/>
+ </correlations>
+ </receive>
+
+ <assign name="setSystem">
+ <copy>
+ <from>$NotifyIn.system</from>
+ <to>$System</to>
+ </copy>
+ <copy>
+ <from>$NotifyIn.entityId</from>
+ <to>$EntityId</to>
+ </copy>
+ </assign>
+
+ <assign>
+ <copy>
+ <from>concat('Received notification: (', $System, ',', $EntityId, ')')</from>
+ <to>$DebugIn.parameters/message</to>
+ </copy>
+ </assign>
+
+ <invoke partnerLink="LoggingManager" operation="debug"
+ xmlns:tns="http://cse.campussource.de/ejb/LoggingManager"
+ portType="tns:LoggingManager"
+ inputVariable="DebugIn"/>
+
+ <assign name="prepareGetCategoryContext">
+ <copy>
+ <from variable="System"/>
+ <to>$GetCategoryContextIn.parameters/system</to>
+ </copy>
+ <copy>
+ <from variable="EntityId"/>
+ <to>$GetCategoryContextIn.parameters/entityId</to>
+ </copy>
+ </assign>
+
+ <invoke name="getCategoryContext" partnerLink="EntityManager"
+ operation="getCategoryContext"
+ xmlns:tns="http://cse.campussource.de/ejb/EntityManager"
+ portType="tns:EntityManager"
+ inputVariable="GetCategoryContextIn"
+ outputVariable="GetCategoryContextOut"/>
+
+ <empty name="distributeMessages">
+ <documentation>Send categoryMessage + context to outboundadapter (synchronisouly)</documentation>
+ </empty>
+
+ </sequence>
+ </scope>
+ </forEach>
+
+ <assign>
+ <copy>
+ <from>concat('Process finished (', $EntityId, ')')</from>
+ <to>$DebugIn.parameters/message</to>
+ </copy>
+ </assign>
+
+ <invoke partnerLink="LoggingManager" operation="debug"
+ xmlns:tns="http://cse.campussource.de/ejb/LoggingManager"
+ portType="tns:LoggingManager"
+ inputVariable="DebugIn"/>
+
+ </sequence>
+</process>
Added: trunk/sandbox/lsf-adapter-demo/ObjectProcessor/src/AddCategory.wsdl
===================================================================
--- trunk/sandbox/lsf-adapter-demo/ObjectProcessor/src/AddCategory.wsdl (rev 0)
+++ trunk/sandbox/lsf-adapter-demo/ObjectProcessor/src/AddCategory.wsdl 2009-07-31 21:53:30 UTC (rev 414)
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<definitions name="AddCategory"
+ targetNamespace="http://cse.campussource.de/wsdl/ObjectProcessor/AddCategory"
+ xmlns="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
+ xmlns:xsd="http://www.w3.org/2001/XMLSchema"
+ xmlns:tns="http://cse.campussource.de/wsdl/ObjectProcessor/AddCategory"
+ xmlns:ns="http://cse.campussource.de/schema/DataTypes"
+ xmlns:plnk="http://docs.oasis-open.org/wsbpel/2.0/plnktype"
+ xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/">
+ <types>
+ <xsd:schema targetNamespace="http://cse.campussource.de/wsdl/ObjectProcessor/AddCategory">
+ <xsd:import namespace="http://cse.campussource.de/schema/DataTypes" schemaLocation="Common/CDDM.xsd"/>
+ </xsd:schema>
+ </types>
+ <message name="processCategoryRequest">
+ <part name="categoryMessage" element="ns:categoryMessage"/>
+ </message>
+ <portType name="AddCategoryPortType">
+ <operation name="processCategory">
+ <input name="input1" message="tns:processCategoryRequest"/>
+ </operation>
+ </portType>
+ <binding name="AddCategoryBinding" type="tns:AddCategoryPortType">
+ <soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
+ <operation name="processCategory">
+ <soap:operation/>
+ <input name="input1">
+ <soap:body use="literal"/>
+ </input>
+ </operation>
+ </binding>
+ <service name="AddCategoryService">
+ <port name="AddCategoryPort" binding="tns:AddCategoryBinding">
+ <soap:address location="http://localhost:${HttpDefaultPort}/AddCategoryService/AddCategoryPort"/>
+ </port>
+ </service>
+ <plnk:partnerLinkType name="AddCategory">
+ <plnk:role name="AddCategoryPortTypeRole" portType="tns:AddCategoryPortType"/>
+ </plnk:partnerLinkType>
+</definitions>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|