Files
tibcoRepository/Processes/sql/author/SqlPUT.process
2024-08-09 16:50:18 +02:00

232 lines
9.5 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: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" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsd:import namespace="http://www.demo.com/author" schemaLocation="/Resources/WSDL/WSDL.wsdl"/>
<xsd:import namespace="http://www.tibco.com/schemas/httpRequest/Resources/schemas/Schema.xsd2" schemaLocation="/Resources/schemas/errorSchema.xsd"/>
<pd:name>Processes/sql/author/SqlPUT.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>145</pd:startX>
<pd:startY>64</pd:startY>
<pd:returnBindings>
<root>
<status>
<xsl:value-of select="concat(&quot;update succes, authors affected: &quot;,$Update-Author/jdbcUpdateActivityOutput/noOfUpdates)"/>
</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>644</pd:endX>
<pd:endY>66</pd:endY>
<pd:errorSchemas>
<PutError ref="pfx2:root"/>
</pd:errorSchemas>
<pd:processVariables/>
<pd:targetNamespace>http://xmlns.example.com/1719579163583</pd:targetNamespace>
<pd:activity name="Update Author">
<pd:type>com.tibco.plugin.jdbc.JDBCUpdateActivity</pd:type>
<pd:resourceType>ae.activities.JDBCUpdateActivity</pd:resourceType>
<pd:x>387</pd:x>
<pd:y>65</pd:y>
<config>
<timeout>10</timeout>
<commit>false</commit>
<emptyStrAsNil>false</emptyStrAsNil>
<jdbcSharedConfig>/Resources/configurations/JDBC Connection.sharedjdbc</jdbcSharedConfig>
<statement>UPDATE author
SET firstname = ?, lastname = ?, date_of_birth = ?, date_of_death = ?, age = ?
WHERE id = ?;
</statement>
<Prepared_Param_DataType>
<parameter>
<parameterName>param_firstname</parameterName>
<dataType>VARCHAR</dataType>
</parameter>
<parameter>
<parameterName>param_lastname</parameterName>
<dataType>VARCHAR</dataType>
</parameter>
<parameter>
<parameterName>param_date-of_birth</parameterName>
<dataType>DATE</dataType>
</parameter>
<parameter>
<parameterName>param_date-of_death</parameterName>
<dataType>DATE</dataType>
</parameter>
<parameter>
<parameterName>param_age</parameterName>
<dataType>INTEGER</dataType>
</parameter>
<parameter>
<parameterName>param_id</parameterName>
<dataType>INTEGER</dataType>
</parameter>
</Prepared_Param_DataType>
</config>
<pd:inputBindings>
<jdbcUpdateActivityInput>
<param_firstname>
<xsl:value-of select="$Start/root/pfx:author/pfx:firstName"/>
</param_firstname>
<param_lastname>
<xsl:value-of select="$Start/root/pfx:author/pfx:lastName"/>
</param_lastname>
<param_date-of_birth>
<xsl:value-of select="$Start/root/pfx:author/pfx:dateOfBirth"/>
</param_date-of_birth>
<param_date-of_death>
<xsl:choose>
<xsl:when test="exists($Start/root/pfx:author/pfx:dateOfDeath)">
<xsl:value-of select="$Start/root/pfx:author/pfx:dateOfDeath"/>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="xsi:nil">true</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</param_date-of_death>
<param_age>
<xsl:choose>
<xsl:when test="exists(number($Start/root/pfx:author/pfx:age))">
<xsl:value-of select="number($Start/root/pfx:author/pfx:age)"/>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="xsi:nil">true</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</param_age>
<param_id>
<xsl:choose>
<xsl:when test="exists(number($Start/root/pfx:author/@id))">
<xsl:value-of select="number($Start/root/pfx:author/@id)"/>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="xsi:nil">true</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
</param_id>
</jdbcUpdateActivityInput>
</pd:inputBindings>
</pd:activity>
<pd:activity name="Log Input Data">
<pd:type>com.tibco.pe.core.WriteToLogActivity</pd:type>
<pd:resourceType>ae.activities.log</pd:resourceType>
<pd:x>255</pd:x>
<pd:y>63</pd:y>
<config>
<role>User</role>
</config>
<pd:inputBindings>
<ns:ActivityInput>
<message>
<xsl:value-of select="concat('input data',string($Start/root))"/>
</message>
</ns:ActivityInput>
</pd:inputBindings>
</pd:activity>
<pd:activity name="Catch">
<pd:type>com.tibco.pe.core.CatchActivity</pd:type>
<pd:resourceType>ae.activities.catch</pd:resourceType>
<pd:x>313</pd:x>
<pd:y>327</pd:y>
<pd:handler>true</pd:handler>
<config>
<catchAll>true</catchAll>
</config>
<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>451</pd:x>
<pd:y>325</pd:y>
<config>
<faultName>PutError</faultName>
</config>
<pd:inputBindings>
<ns1:ActivityInput>
<data>
<pfx2:root>
<pfx2:error>
<xsl:value-of select="'could not update author with given id, because it does not exist'"/>
</pfx2:error>
</pfx2:root>
</data>
</ns1:ActivityInput>
</pd:inputBindings>
</pd:activity>
<pd:activity name="UpdateError">
<pd:type>com.tibco.pe.core.GenerateErrorActivity</pd:type>
<pd:resourceType>ae.activities.throw</pd:resourceType>
<pd:x>390</pd:x>
<pd:y>208</pd:y>
<config>
<faultName>PutError</faultName>
</config>
<pd:inputBindings>
<ns1:ActivityInput>
<data>
<pfx2:root>
<pfx2:error>
<xsl:value-of select="'fail'"/>
</pfx2:error>
</pfx2:root>
</data>
</ns1:ActivityInput>
</pd:inputBindings>
</pd:activity>
<pd:transition>
<pd:from>Update 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>xpath</pd:conditionType>
<pd:xpath>$Update-Author/jdbcUpdateActivityOutput/noOfUpdates = 1</pd:xpath>
</pd:transition>
<pd:transition>
<pd:from>Start</pd:from>
<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>Log Input Data</pd:from>
<pd:to>Update Author</pd:to>
<pd:lineType>Default</pd:lineType>
<pd:lineColor>-16777216</pd:lineColor>
<pd:conditionType>always</pd:conditionType>
</pd:transition>
<pd:transition>
<pd:from>Catch</pd:from>
<pd:to>Generate Error</pd:to>
<pd:lineType>Default</pd:lineType>
<pd:lineColor>-16777216</pd:lineColor>
<pd:conditionType>always</pd:conditionType>
</pd:transition>
<pd:transition>
<pd:from>Update Author</pd:from>
<pd:to>UpdateError</pd:to>
<pd:lineType>Default</pd:lineType>
<pd:lineColor>-16777216</pd:lineColor>
<pd:conditionType>otherwise</pd:conditionType>
</pd:transition>
</pd:ProcessDefinition>