sql fix
This commit is contained in:
		
							
								
								
									
										174
									
								
								Processes/sql/SelectDatabase.process
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										174
									
								
								Processes/sql/SelectDatabase.process
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,174 @@ | ||||
| <?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:pd="http://xmlns.tibco.com/bw/process/2003" xmlns:ns="http://www.tibco.com/pe/WriteToLogActivitySchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> | ||||
|     <xsd:import namespace="http://www.demo.com/author" schemaLocation="/Resources/WSDL/WSDL.wsdl"/> | ||||
|     <pd:name>Processes/sql/SelectDatabase.process</pd:name> | ||||
|     <pd:startName>Start</pd:startName> | ||||
|     <pd:startType> | ||||
|         <xsd:element name="root"> | ||||
|             <xsd:complexType> | ||||
|                 <xsd:sequence> | ||||
|                     <xsd:element name="method" type="xsd:string"/> | ||||
|                     <xsd:element name="data" type="xsd:string"/> | ||||
|                 </xsd:sequence> | ||||
|             </xsd:complexType> | ||||
|         </xsd:element> | ||||
|     </pd:startType> | ||||
|     <pd:startX>169</pd:startX> | ||||
|     <pd:startY>180</pd:startY> | ||||
|     <pd:returnBindings> | ||||
|         <root> | ||||
|             <xsl:copy-of select="$SqlGET_DELETE/root/pfx:author"/> | ||||
|             <status> | ||||
|                 <xsl:value-of select="if (boolean($SqlPOST_PUT/root/status)) then $SqlPOST_PUT/root/status else $SqlGET_DELETE/root/status"/> | ||||
|             </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>802</pd:endX> | ||||
|     <pd:endY>184</pd:endY> | ||||
|     <pd:errorSchemas/> | ||||
|     <pd:processVariables/> | ||||
|     <pd:targetNamespace>http://xmlns.example.com/1719567794423</pd:targetNamespace> | ||||
|     <pd:activity name="SqlPOST_PUT"> | ||||
|         <pd:type>com.tibco.pe.core.CallProcessActivity</pd:type> | ||||
|         <pd:resourceType>ae.process.subprocess</pd:resourceType> | ||||
|         <pd:x>603</pd:x> | ||||
|         <pd:y>304</pd:y> | ||||
|         <config> | ||||
|             <processName>/Processes/sql/author/SqlPOST.process</processName> | ||||
|             <processNameXPath>concat('/Processes/sql/author/Sql',$Start/root/method ,'.process')</processNameXPath> | ||||
|         </config> | ||||
|         <pd:inputBindings> | ||||
|             <root> | ||||
|                 <ns1:author xmlns:ns1="http://www.demo.com/author"> | ||||
|                     <xsl:attribute xmlns:xsl="http://www.w3.org/1999/XSL/Transform" name="id"> | ||||
|                         <xsl:value-of select="number($Map-Data/root/id)"/> | ||||
|                     </xsl:attribute> | ||||
|                     <ns1:firstName> | ||||
|                         <xsl:value-of select="$Map-Data/root/firstname"/> | ||||
|                     </ns1:firstName> | ||||
|                     <ns1:lastName> | ||||
|                         <xsl:value-of select="$Map-Data/root/lastname"/> | ||||
|                     </ns1:lastName> | ||||
|                     <ns1:age> | ||||
|                         <xsl:value-of select="number($Map-Data/root/age)"/> | ||||
|                     </ns1:age> | ||||
|                     <ns1:dateOfBirth> | ||||
|                         <xsl:value-of select="$Map-Data/root/date-of-birth"/> | ||||
|                     </ns1:dateOfBirth> | ||||
|                     <ns1:dateOfDeath> | ||||
|                         <xsl:value-of select="$Map-Data/root/date-of-death"/> | ||||
|                     </ns1:dateOfDeath> | ||||
|                 </ns1:author> | ||||
|             </root> | ||||
|         </pd:inputBindings> | ||||
|     </pd:activity> | ||||
|     <pd:activity name="Map Data"> | ||||
|         <pd:type>com.tibco.plugin.mapper.MapperActivity</pd:type> | ||||
|         <pd:resourceType>ae.activities.MapperActivity</pd:resourceType> | ||||
|         <pd:x>388</pd:x> | ||||
|         <pd:y>183</pd:y> | ||||
|         <config> | ||||
|             <element> | ||||
|                 <xs:element xmlns:xs="http://www.w3.org/2001/XMLSchema" name="root"> | ||||
|                     <xs:complexType> | ||||
|                         <xs:sequence> | ||||
|                             <xs:element name="firstname" type="xsd:string"/> | ||||
|                             <xs:element name="lastname" type="xsd:string"/> | ||||
|                             <xs:element name="date-of-birth" type="xsd:string"/> | ||||
|                             <xs:element name="date-of-death" type="xsd:string"/> | ||||
|                             <xs:element name="id" type="xsd:string"/> | ||||
|                             <xs:element name="age" type="xsd:string"/> | ||||
|                         </xs:sequence> | ||||
|                     </xs:complexType> | ||||
|                 </xs:element> | ||||
|             </element> | ||||
|         </config> | ||||
|         <pd:inputBindings> | ||||
|             <root> | ||||
|                 <firstname> | ||||
|                     <xsl:value-of xmlns:xsl="http://www.w3.org/1999/XSL/Transform" select="substring-before(substring-after($Start/root/data, '"firstname":"'), '"')"/> | ||||
|                 </firstname> | ||||
|                 <lastname> | ||||
|                     <xsl:value-of xmlns:xsl="http://www.w3.org/1999/XSL/Transform" select="substring-before(substring-after($Start/root/data, '"lastname":"'), '"')"/> | ||||
|                 </lastname> | ||||
|                 <date-of-birth> | ||||
|                     <xsl:value-of xmlns:xsl="http://www.w3.org/1999/XSL/Transform" select="substring-before(substring-after($Start/root/data, '"day-of-birth":"'), '"')"/> | ||||
|                 </date-of-birth> | ||||
|                 <date-of-death> | ||||
|                     <xsl:value-of xmlns:xsl="http://www.w3.org/1999/XSL/Transform" select="substring-before(substring-after($Start/root/data, '"day-of-death":"'), '"')"/> | ||||
|                 </date-of-death> | ||||
|                 <id> | ||||
|                     <xsl:value-of xmlns:xsl="http://www.w3.org/1999/XSL/Transform" select="if ($Start/root/method = 'POST' or $Start/root/method = 'PUT' ) then substring-before(substring-after($Start/root/data, '"id":"'), '"') else substring-after($Start/root/data, 'id=')"/> | ||||
|                 </id> | ||||
|                 <age> | ||||
|                     <xsl:value-of xmlns:xsl="http://www.w3.org/1999/XSL/Transform" select="number(substring-before(substring-after($Start/root/data, '"age":"'), '"'))"/> | ||||
|                 </age> | ||||
|             </root> | ||||
|         </pd:inputBindings> | ||||
|     </pd:activity> | ||||
|     <pd:activity name="SqlGET_DELETE"> | ||||
|         <pd:type>com.tibco.pe.core.CallProcessActivity</pd:type> | ||||
|         <pd:resourceType>ae.process.subprocess</pd:resourceType> | ||||
|         <pd:x>600</pd:x> | ||||
|         <pd:y>74</pd:y> | ||||
|         <config> | ||||
|             <processName>/Processes/sql/author/SqlGET.process</processName> | ||||
|             <processNameXPath>concat('/Processes/sql/author/Sql',$Start/root/method ,'.process')</processNameXPath> | ||||
|         </config> | ||||
|         <pd:inputBindings> | ||||
|             <root> | ||||
|                 <id> | ||||
|                     <xsl:value-of select="number($Map-Data/root/id)"/> | ||||
|                 </id> | ||||
|             </root> | ||||
|         </pd:inputBindings> | ||||
|     </pd:activity> | ||||
|     <pd:transition> | ||||
|         <pd:from>Start</pd:from> | ||||
|         <pd:to>Map Data</pd:to> | ||||
|         <pd:lineType>Default</pd:lineType> | ||||
|         <pd:lineColor>-16777216</pd:lineColor> | ||||
|         <pd:conditionType>always</pd:conditionType> | ||||
|     </pd:transition> | ||||
|     <pd:transition> | ||||
|         <pd:from>Map Data</pd:from> | ||||
|         <pd:to>SqlGET_DELETE</pd:to> | ||||
|         <pd:lineType>Default</pd:lineType> | ||||
|         <pd:lineColor>-16777216</pd:lineColor> | ||||
|         <pd:conditionType>xpath</pd:conditionType> | ||||
|         <pd:xpath>$Start/root/method = 'DELETE' or $Start/root/method = 'GET'</pd:xpath> | ||||
|     </pd:transition> | ||||
|     <pd:transition> | ||||
|         <pd:from>Map Data</pd:from> | ||||
|         <pd:to>SqlPOST_PUT</pd:to> | ||||
|         <pd:lineType>Default</pd:lineType> | ||||
|         <pd:lineColor>-16777216</pd:lineColor> | ||||
|         <pd:conditionType>xpath</pd:conditionType> | ||||
|         <pd:xpath>$Start/root/method = 'PUT' or $Start/root/method = 'POST'</pd:xpath> | ||||
|     </pd:transition> | ||||
|     <pd:transition> | ||||
|         <pd:from>SqlPOST_PUT</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>SqlGET_DELETE</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:ProcessDefinition> | ||||
		Reference in New Issue
	
	Block a user
	 wojciech
					wojciech