This commit is contained in:
wojciech
2024-08-09 11:08:04 +02:00
parent 5ae29966cd
commit 88f64189a2
19 changed files with 435 additions and 294 deletions

View File

@@ -1,6 +1,7 @@
<?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" xmlns:ns1="http://www.tibco.com/pe/GenerateErrorActivity/InputSchema">
<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:pfx2="http://www.tibco.com/schemas/httpRequest/Resources/schemas/Schema.xsd2" xmlns:ns="http://www.tibco.com/pe/WriteToLogActivitySchema" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:ns1="http://www.tibco.com/pe/GenerateErrorActivity/InputSchema">
<xsd:import namespace="http://www.demo.com/author" schemaLocation="/Resources/schemas/author.xsd"/>
<xsd:import namespace="http://www.tibco.com/schemas/httpRequest/Resources/schemas/Schema.xsd2" schemaLocation="/Resources/schemas/errorSchema.xsd"/>
<pd:name>Processes/sql/author/SqlGET.process</pd:name>
<pd:startName>Start</pd:startName>
<pd:startType>
@@ -17,25 +18,25 @@
<pd:returnBindings>
<root>
<pfx:author>
<xsl:if test="$GetAuthor/resultSet/Record[1]/id">
<xsl:if test="$Get-Author/resultSet/Record[1]/id">
<xsl:attribute name="id">
<xsl:value-of select="$GetAuthor/resultSet/Record[1]/id"/>
<xsl:value-of select="$Get-Author/resultSet/Record[1]/id"/>
</xsl:attribute>
</xsl:if>
<pfx:firstName>
<xsl:value-of select="$GetAuthor/resultSet/Record[1]/firstname"/>
<xsl:value-of select="$Get-Author/resultSet/Record[1]/firstname"/>
</pfx:firstName>
<pfx:lastName>
<xsl:value-of select="$GetAuthor/resultSet/Record[1]/lastname"/>
<xsl:value-of select="$Get-Author/resultSet/Record[1]/lastname"/>
</pfx:lastName>
<pfx:age>
<xsl:value-of select="$GetAuthor/resultSet/Record[1]/age"/>
<xsl:value-of select="$Get-Author/resultSet/Record[1]/age"/>
</pfx:age>
<pfx:dateOfBirth>
<xsl:value-of select="substring-before($GetAuthor/resultSet/Record[1]/date_of_birth,&quot;T&quot;)"/>
<xsl:value-of select="substring-before($Get-Author/resultSet/Record[1]/date_of_birth,&quot;T&quot;)"/>
</pfx:dateOfBirth>
<pfx:dateOfDeath>
<xsl:value-of select="substring-before($GetAuthor/resultSet/Record[1]/date_of_death,&quot;T&quot;)"/>
<xsl:value-of select="substring-before($Get-Author/resultSet/Record[1]/date_of_death,&quot;T&quot;)"/>
</pfx:dateOfDeath>
</pfx:author>
<status>
@@ -54,22 +55,14 @@
</xsd:complexType>
</xsd:element>
</pd:endType>
<pd:endX>726</pd:endX>
<pd:endY>108</pd:endY>
<pd:endX>730</pd:endX>
<pd:endY>105</pd:endY>
<pd:errorSchemas>
<AuthorNotFound>
<xsd:element name="root">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="AuthorID" type="xsd:int"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</AuthorNotFound>
<GetError ref="pfx2:root"/>
</pd:errorSchemas>
<pd:processVariables/>
<pd:targetNamespace>http://xmlns.example.com/1719579163583</pd:targetNamespace>
<pd:activity name="GetAuthor">
<pd:activity name="Get Author">
<pd:type>com.tibco.plugin.jdbc.JDBCQueryActivity</pd:type>
<pd:resourceType>ae.activities.JDBCQueryActivity</pd:resourceType>
<pd:x>463</pd:x>
@@ -122,7 +115,7 @@
</jdbcQueryActivityInput>
</pd:inputBindings>
</pd:activity>
<pd:activity name="LogInputData">
<pd:activity name="Log Input Data">
<pd:type>com.tibco.pe.core.WriteToLogActivity</pd:type>
<pd:resourceType>ae.activities.log</pd:resourceType>
<pd:x>285</pd:x>
@@ -141,8 +134,8 @@
<pd:activity name="Catch">
<pd:type>com.tibco.pe.core.CatchActivity</pd:type>
<pd:resourceType>ae.activities.catch</pd:resourceType>
<pd:x>257</pd:x>
<pd:y>246</pd:y>
<pd:x>259</pd:x>
<pd:y>407</pd:y>
<pd:handler>true</pd:handler>
<config>
<catchAll>true</catchAll>
@@ -152,65 +145,53 @@
<pd:activity name="Generate Error">
<pd:type>com.tibco.pe.core.GenerateErrorActivity</pd:type>
<pd:resourceType>ae.activities.throw</pd:resourceType>
<pd:x>427</pd:x>
<pd:y>248</pd:y>
<pd:x>429</pd:x>
<pd:y>409</pd:y>
<config>
<faultName/>
<faultName>GetError</faultName>
</config>
<pd:inputBindings>
<ns1:ActivityInput>
<message>
<xsl:value-of select="string($Catch/exceptiondata)"/>
</message>
<data>
<pfx2:root>
<pfx2:error>
<xsl:value-of select="'could not get the author with given id, because it does not exist'"/>
</pfx2:error>
</pfx2:root>
</data>
</ns1:ActivityInput>
</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>599</pd:x>
<pd:y>111</pd:y>
<pd:activity name="Author Does Not Exist">
<pd:type>com.tibco.pe.core.GenerateErrorActivity</pd:type>
<pd:resourceType>ae.activities.throw</pd:resourceType>
<pd:x>465</pd:x>
<pd:y>244</pd:y>
<config>
<renderAsText>text</renderAsText>
<validateInput>true</validateInput>
<renderDefaultPrefix>true</renderDefaultPrefix>
<term ref="pfx:author"/>
<faultName>GetError</faultName>
</config>
<pd:inputBindings>
<pfx:author>
<xsl:if test="$GetAuthor/resultSet/Record[1]/id">
<xsl:attribute name="id">
<xsl:value-of select="$GetAuthor/resultSet/Record[1]/id"/>
</xsl:attribute>
</xsl:if>
<pfx:firstName>
<xsl:value-of select="$GetAuthor/resultSet/Record[1]/firstname"/>
</pfx:firstName>
<pfx:lastName>
<xsl:value-of select="$GetAuthor/resultSet/Record[1]/lastname"/>
</pfx:lastName>
<pfx:age>
<xsl:value-of select="$GetAuthor/resultSet/Record[1]/age"/>
</pfx:age>
<pfx:dateOfBirth>
<xsl:value-of select="substring-before($GetAuthor/resultSet/Record[1]/date_of_birth, 'T')"/>
</pfx:dateOfBirth>
<pfx:dateOfDeath>
<xsl:value-of select="substring-before($GetAuthor/resultSet/Record[1]/date_of_death, 'T')"/>
</pfx:dateOfDeath>
</pfx:author>
<ns1:ActivityInput>
<data>
<pfx2:root>
<pfx2:error>
<xsl:value-of select="'empty'"/>
</pfx2:error>
</pfx2:root>
</data>
</ns1:ActivityInput>
</pd:inputBindings>
</pd:activity>
<pd:transition>
<pd:from>Start</pd:from>
<pd:to>LogInputData</pd:to>
<pd:to>Log Input Data</pd:to>
<pd:lineType>Default</pd:lineType>
<pd:lineColor>-16777216</pd:lineColor>
<pd:conditionType>always</pd:conditionType>
</pd:transition>
<pd:transition>
<pd:from>LogInputData</pd:from>
<pd:to>GetAuthor</pd:to>
<pd:from>Log Input Data</pd:from>
<pd:to>Get Author</pd:to>
<pd:lineType>Default</pd:lineType>
<pd:lineColor>-16777216</pd:lineColor>
<pd:conditionType>always</pd:conditionType>
@@ -223,17 +204,19 @@
<pd:conditionType>always</pd:conditionType>
</pd:transition>
<pd:transition>
<pd:from>GetAuthor</pd:from>
<pd:to>Render XML</pd:to>
<pd:from>Get Author</pd:from>
<pd:to>End</pd:to>
<pd:xpathDescription>authorExist</pd:xpathDescription>
<pd:lineType>Default</pd:lineType>
<pd:lineColor>-16777216</pd:lineColor>
<pd:conditionType>always</pd:conditionType>
<pd:conditionType>xpath</pd:conditionType>
<pd:xpath>boolean($Get-Author/resultSet/Record[1]/id)</pd:xpath>
</pd:transition>
<pd:transition>
<pd:from>Render XML</pd:from>
<pd:to>End</pd:to>
<pd:from>Get Author</pd:from>
<pd:to>Author Does Not Exist</pd:to>
<pd:lineType>Default</pd:lineType>
<pd:lineColor>-16777216</pd:lineColor>
<pd:conditionType>always</pd:conditionType>
<pd:conditionType>otherwise</pd:conditionType>
</pd:transition>
</pd:ProcessDefinition>