253 lines
		
	
	
		
			10 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
			
		
		
	
	
			253 lines
		
	
	
		
			10 KiB
		
	
	
	
		
			XML
		
	
	
	
	
	
| <?xml version="1.0" encoding="UTF-8"?>
 | |
| <pd:ProcessDefinition xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pfx="http://www.demo.com/author" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:pd="http://xmlns.tibco.com/bw/process/2003" xmlns:pfx2="http://www.tibco.com/pe/GenerateErrorActivity/InputSchema" xmlns:ns="http://www.tibco.com/namespaces/tnt/plugins/file" xmlns:pfx3="http://xmlns.example.com/1721737885605" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns2="http://xmlns.tibco.com/bw/activity/xml/render/bytesEnvelope/2003/05" xmlns:tib="http://www.tibco.com/bw/xslt/custom-functions" xmlns:ns4="http://www.tibco.com/schemas/httpRequest/Resources/schemas/Schema.xsd2" xmlns:ns3="http://www.tibco.com/namespaces/tnt/plugins/file/v2">
 | |
|     <xsd:import namespace="http://www.demo.com/author" schemaLocation="/Resources/schemas/putRequest.xsd"/>
 | |
|     <wsdl:import namespace="http://xmlns.example.com/1721737885605" location="/Resources/WSDL/WSDL.wsdl"/>
 | |
|     <pd:name>Processes/xml/author/XmlPOST.process</pd:name>
 | |
|     <pd:startName>Start</pd:startName>
 | |
|     <pd:startType>
 | |
|         <xsd:element name="root">
 | |
|             <xsd:complexType>
 | |
|                 <xsd:sequence>
 | |
|                     <xsd:element ref="pfx:author"/>
 | |
|                 </xsd:sequence>
 | |
|             </xsd:complexType>
 | |
|         </xsd:element>
 | |
|     </pd:startType>
 | |
|     <pd:startX>51</pd:startX>
 | |
|     <pd:startY>212</pd:startY>
 | |
|     <pd:returnBindings>
 | |
|         <root>
 | |
|             <status>
 | |
|                 <xsl:value-of select="'author added'"/>
 | |
|             </status>
 | |
|         </root>
 | |
|     </pd:returnBindings>
 | |
|     <pd:endName>End</pd:endName>
 | |
|     <pd:endType>
 | |
|         <xsd:element name="root">
 | |
|             <xsd:complexType>
 | |
|                 <xsd:sequence>
 | |
|                     <xsd:element ref="pfx:author" minOccurs="0"/>
 | |
|                     <xsd:element name="status" type="xsd:string"/>
 | |
|                 </xsd:sequence>
 | |
|             </xsd:complexType>
 | |
|         </xsd:element>
 | |
|     </pd:endType>
 | |
|     <pd:endX>940</pd:endX>
 | |
|     <pd:endY>218</pd:endY>
 | |
|     <pd:errorSchemas>
 | |
|         <PostError wsMsgRef="pfx3:ErrorMessage"/>
 | |
|     </pd:errorSchemas>
 | |
|     <pd:processVariables/>
 | |
|     <pd:targetNamespace>http://xmlns.example.com/1719920186128</pd:targetNamespace>
 | |
|     <pd:activity name="Read File">
 | |
|         <pd:type>com.tibco.plugin.file.FileReadActivity</pd:type>
 | |
|         <pd:resourceType>ae.activities.FileReadActivity</pd:resourceType>
 | |
|         <pd:x>194</pd:x>
 | |
|         <pd:y>212</pd:y>
 | |
|         <config>
 | |
|             <encoding>text</encoding>
 | |
|         </config>
 | |
|         <pd:inputBindings>
 | |
|             <ns3:ReadActivityInputClass>
 | |
|                 <fileName>
 | |
|                     <xsl:value-of select="'/tibco/designer/5.12/projects/tibcoRepository/Resources/databases/databaseXML.xml'"/>
 | |
|                 </fileName>
 | |
|             </ns3:ReadActivityInputClass>
 | |
|         </pd:inputBindings>
 | |
|     </pd:activity>
 | |
|     <pd:activity name="Parse XML">
 | |
|         <pd:type>com.tibco.plugin.xml.XMLParseActivity</pd:type>
 | |
|         <pd:resourceType>ae.activities.XMLParseActivity</pd:resourceType>
 | |
|         <pd:x>340</pd:x>
 | |
|         <pd:y>215</pd:y>
 | |
|         <config>
 | |
|             <inputStyle>text</inputStyle>
 | |
|             <xsdVersion>default</xsdVersion>
 | |
|             <validateOutput>true</validateOutput>
 | |
|             <term ref="pfx:authors"/>
 | |
|         </config>
 | |
|         <pd:inputBindings>
 | |
|             <xmlString>
 | |
|                 <xsl:value-of select="$Read-File/ns:ReadActivityOutputTextClass/fileContent/textContent"/>
 | |
|             </xmlString>
 | |
|         </pd:inputBindings>
 | |
|     </pd:activity>
 | |
|     <pd:activity name="add author">
 | |
|         <pd:type>com.tibco.plugin.mapper.MapperActivity</pd:type>
 | |
|         <pd:resourceType>ae.activities.MapperActivity</pd:resourceType>
 | |
|         <pd:x>509</pd:x>
 | |
|         <pd:y>216</pd:y>
 | |
|         <config>
 | |
|             <element ref="pfx:authors"/>
 | |
|         </config>
 | |
|         <pd:inputBindings>
 | |
|             <pfx:authors>
 | |
|                 <xsl:copy-of select="$Start/root/pfx:author"/>
 | |
|                 <xsl:copy-of select="$Parse-XML/pfx:authors/pfx:author"/>
 | |
|             </pfx:authors>
 | |
|         </pd:inputBindings>
 | |
|     </pd:activity>
 | |
|     <pd:activity name="Render XML">
 | |
|         <pd:type>com.tibco.plugin.xml.XMLRendererActivity</pd:type>
 | |
|         <pd:resourceType>ae.activities.XMLRendererActivity</pd:resourceType>
 | |
|         <pd:x>669</pd:x>
 | |
|         <pd:y>216</pd:y>
 | |
|         <config>
 | |
|             <renderAsText>text</renderAsText>
 | |
|             <validateInput>false</validateInput>
 | |
|             <term ref="pfx:authors"/>
 | |
|         </config>
 | |
|         <pd:inputBindings>
 | |
|             <xsl:copy-of select="$add-author/pfx:authors"/>
 | |
|         </pd:inputBindings>
 | |
|     </pd:activity>
 | |
|     <pd:activity name="Write File">
 | |
|         <pd:type>com.tibco.plugin.file.FileWriteActivity</pd:type>
 | |
|         <pd:resourceType>ae.activities.FileWriteActivity</pd:resourceType>
 | |
|         <pd:x>802</pd:x>
 | |
|         <pd:y>216</pd:y>
 | |
|         <config>
 | |
|             <encoding>text</encoding>
 | |
|             <compressFile>None</compressFile>
 | |
|         </config>
 | |
|         <pd:inputBindings>
 | |
|             <ns:WriteActivityInputTextClass>
 | |
|                 <fileName>
 | |
|                     <xsl:value-of select="'/tibco/designer/5.12/projects/tibcoRepository/Resources/databases/databaseXML.xml'"/>
 | |
|                 </fileName>
 | |
|                 <textContent>
 | |
|                     <xsl:value-of select="$Render-XML/xmlString"/>
 | |
|                 </textContent>
 | |
|             </ns:WriteActivityInputTextClass>
 | |
|         </pd:inputBindings>
 | |
|     </pd:activity>
 | |
|     <pd:activity name="Render-XML-1">
 | |
|         <pd:type>com.tibco.plugin.xml.XMLRendererActivity</pd:type>
 | |
|         <pd:resourceType>ae.activities.XMLRendererActivity</pd:resourceType>
 | |
|         <pd:x>193</pd:x>
 | |
|         <pd:y>339</pd:y>
 | |
|         <config>
 | |
|             <renderAsText>text</renderAsText>
 | |
|             <validateInput>false</validateInput>
 | |
|             <term ref="pfx:authors"/>
 | |
|         </config>
 | |
|         <pd:inputBindings/>
 | |
|     </pd:activity>
 | |
|     <pd:activity name="Write-File-1">
 | |
|         <pd:type>com.tibco.plugin.file.FileWriteActivity</pd:type>
 | |
|         <pd:resourceType>ae.activities.FileWriteActivity</pd:resourceType>
 | |
|         <pd:x>508</pd:x>
 | |
|         <pd:y>341</pd:y>
 | |
|         <config>
 | |
|             <encoding>text</encoding>
 | |
|             <compressFile>None</compressFile>
 | |
|         </config>
 | |
|         <pd:inputBindings>
 | |
|             <ns:WriteActivityInputTextClass>
 | |
|                 <fileName>
 | |
|                     <xsl:value-of select="'/tibco/designer/5.12/projects/tibcoRepository/Resources/databases/databaseXML.xml'"/>
 | |
|                 </fileName>
 | |
|                 <textContent>
 | |
|                     <xsl:value-of select="$Render-XML-1/xmlString"/>
 | |
|                 </textContent>
 | |
|             </ns:WriteActivityInputTextClass>
 | |
|         </pd:inputBindings>
 | |
|     </pd:activity>
 | |
|     <pd:activity name="Generate Error">
 | |
|         <pd:type>com.tibco.pe.core.GenerateErrorActivity</pd:type>
 | |
|         <pd:resourceType>ae.activities.throw</pd:resourceType>
 | |
|         <pd:x>343</pd:x>
 | |
|         <pd:y>59</pd:y>
 | |
|         <config>
 | |
|             <faultName>PostError</faultName>
 | |
|         </config>
 | |
|         <pd:inputBindings>
 | |
|             <pfx2:ActivityInput>
 | |
|                 <data>
 | |
|                     <pfx3:ErrorMessage>
 | |
|                         <part1>
 | |
|                             <ns4:error>
 | |
|                                 <xsl:value-of select="'could not add author with given id because this id is already in use'"/>
 | |
|                             </ns4:error>
 | |
|                         </part1>
 | |
|                     </pfx3:ErrorMessage>
 | |
|                 </data>
 | |
|             </pfx2:ActivityInput>
 | |
|         </pd:inputBindings>
 | |
|     </pd:activity>
 | |
|     <pd:transition>
 | |
|         <pd:from>Start</pd:from>
 | |
|         <pd:to>Read File</pd:to>
 | |
|         <pd:lineType>Default</pd:lineType>
 | |
|         <pd:lineColor>-16777216</pd:lineColor>
 | |
|         <pd:conditionType>always</pd:conditionType>
 | |
|     </pd:transition>
 | |
|     <pd:transition>
 | |
|         <pd:from>Read File</pd:from>
 | |
|         <pd:to>Parse XML</pd:to>
 | |
|         <pd:xpathDescription>file not empty</pd:xpathDescription>
 | |
|         <pd:lineType>Default</pd:lineType>
 | |
|         <pd:lineColor>-16777216</pd:lineColor>
 | |
|         <pd:conditionType>xpath</pd:conditionType>
 | |
|         <pd:xpath>string-length($Read-File/ns:ReadActivityOutputTextClass/fileContent/textContent)>0</pd:xpath>
 | |
|     </pd:transition>
 | |
|     <pd:transition>
 | |
|         <pd:from>Parse XML</pd:from>
 | |
|         <pd:to>add author</pd:to>
 | |
|         <pd:lineType>Default</pd:lineType>
 | |
|         <pd:lineColor>-16777216</pd:lineColor>
 | |
|         <pd:conditionType>otherwise</pd:conditionType>
 | |
|     </pd:transition>
 | |
|     <pd:transition>
 | |
|         <pd:from>add author</pd:from>
 | |
|         <pd:to>Render XML</pd:to>
 | |
|         <pd:lineType>Default</pd:lineType>
 | |
|         <pd:lineColor>-16777216</pd:lineColor>
 | |
|         <pd:conditionType>always</pd:conditionType>
 | |
|     </pd:transition>
 | |
|     <pd:transition>
 | |
|         <pd:from>Render XML</pd:from>
 | |
|         <pd:to>Write File</pd:to>
 | |
|         <pd:lineType>Default</pd:lineType>
 | |
|         <pd:lineColor>-16777216</pd:lineColor>
 | |
|         <pd:conditionType>always</pd:conditionType>
 | |
|     </pd:transition>
 | |
|     <pd:transition>
 | |
|         <pd:from>Write File</pd:from>
 | |
|         <pd:to>End</pd:to>
 | |
|         <pd:lineType>Default</pd:lineType>
 | |
|         <pd:lineColor>-16777216</pd:lineColor>
 | |
|         <pd:conditionType>always</pd:conditionType>
 | |
|     </pd:transition>
 | |
|     <pd:transition>
 | |
|         <pd:from>Read File</pd:from>
 | |
|         <pd:to>Render-XML-1</pd:to>
 | |
|         <pd:lineType>Default</pd:lineType>
 | |
|         <pd:lineColor>-16777216</pd:lineColor>
 | |
|         <pd:conditionType>otherwise</pd:conditionType>
 | |
|     </pd:transition>
 | |
|     <pd:transition>
 | |
|         <pd:from>Render-XML-1</pd:from>
 | |
|         <pd:to>Write-File-1</pd:to>
 | |
|         <pd:lineType>Default</pd:lineType>
 | |
|         <pd:lineColor>-16777216</pd:lineColor>
 | |
|         <pd:conditionType>always</pd:conditionType>
 | |
|     </pd:transition>
 | |
|     <pd:transition>
 | |
|         <pd:from>Write-File-1</pd:from>
 | |
|         <pd:to>add author</pd:to>
 | |
|         <pd:lineType>Default</pd:lineType>
 | |
|         <pd:lineColor>-16777216</pd:lineColor>
 | |
|         <pd:conditionType>always</pd:conditionType>
 | |
|     </pd:transition>
 | |
|     <pd:transition>
 | |
|         <pd:from>Parse XML</pd:from>
 | |
|         <pd:to>Generate Error</pd:to>
 | |
|         <pd:xpathDescription>author with given id already exist</pd:xpathDescription>
 | |
|         <pd:lineType>Default</pd:lineType>
 | |
|         <pd:lineColor>-16777216</pd:lineColor>
 | |
|         <pd:conditionType>xpath</pd:conditionType>
 | |
|         <pd:xpath>boolean($Parse-XML/pfx:authors/pfx:author[@id=$Start/root/pfx:author/@id])</pd:xpath>
 | |
|     </pd:transition>
 | |
| </pd:ProcessDefinition> | 
