226 lines
9.7 KiB
XML
226 lines
9.7 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<pd:ProcessDefinition xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pfx="http://www.tibco.com/namespaces/tnt/plugins/file/v2" xmlns:pd="http://xmlns.tibco.com/bw/process/2003" xmlns:pfx2="http://www.demo.com/author" xmlns:ns="http://www.tibco.com/namespaces/tnt/plugins/file" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tib="http://www.tibco.com/bw/xslt/custom-functions" xmlns:ns2="http://www.tibco.com/pe/GenerateErrorActivity/InputSchema">
|
|
<xsd:import namespace="http://www.demo.com/author" schemaLocation="/Resources/schemas/putRequest.xsd"/>
|
|
<pd:name>Processes/xml/XMLGET.process</pd:name>
|
|
<pd:startName>Start</pd:startName>
|
|
<pd:startType>
|
|
<xsd:element name="root">
|
|
<xsd:complexType>
|
|
<xsd:sequence>
|
|
<xsd:element name="id" type="xsd:int"/>
|
|
</xsd:sequence>
|
|
</xsd:complexType>
|
|
</xsd:element>
|
|
</pd:startType>
|
|
<pd:startX>125</pd:startX>
|
|
<pd:startY>76</pd:startY>
|
|
<pd:returnBindings/>
|
|
<pd:endName>End</pd:endName>
|
|
<pd:endX>1051</pd:endX>
|
|
<pd:endY>75</pd:endY>
|
|
<pd:errorSchemas/>
|
|
<pd:processVariables/>
|
|
<pd:targetNamespace>http://xmlns.example.com/1719920186128</pd:targetNamespace>
|
|
<pd:activity name="Parse XML">
|
|
<pd:type>com.tibco.plugin.xml.XMLParseActivity</pd:type>
|
|
<pd:resourceType>ae.activities.XMLParseActivity</pd:resourceType>
|
|
<pd:x>507</pd:x>
|
|
<pd:y>79</pd:y>
|
|
<config>
|
|
<inputStyle>text</inputStyle>
|
|
<xsdVersion>default</xsdVersion>
|
|
<validateOutput>true</validateOutput>
|
|
<term>
|
|
<xsd:element name="authors">
|
|
<xsd:complexType>
|
|
<xsd:sequence>
|
|
<xsd:element ref="pfx2:author" minOccurs="0" maxOccurs="unbounded"/>
|
|
</xsd:sequence>
|
|
</xsd:complexType>
|
|
</xsd:element>
|
|
</term>
|
|
</config>
|
|
<pd:inputBindings>
|
|
<xmlString>
|
|
<xsl:value-of select="$Read-File/ns:ReadActivityOutputTextClass/fileContent/textContent"/>
|
|
</xmlString>
|
|
</pd:inputBindings>
|
|
</pd:activity>
|
|
<pd:activity name="Read File">
|
|
<pd:type>com.tibco.plugin.file.FileReadActivity</pd:type>
|
|
<pd:resourceType>ae.activities.FileReadActivity</pd:resourceType>
|
|
<pd:x>330</pd:x>
|
|
<pd:y>78</pd:y>
|
|
<config>
|
|
<encoding>text</encoding>
|
|
</config>
|
|
<pd:inputBindings>
|
|
<pfx:ReadActivityInputClass>
|
|
<fileName>
|
|
<xsl:value-of select="'/tibco/designer/5.12/projects/httpRequest/Resources/databases/databaseXML.xml'"/>
|
|
</fileName>
|
|
</pfx:ReadActivityInputClass>
|
|
</pd:inputBindings>
|
|
</pd:activity>
|
|
<pd:activity name="Map-Data-2">
|
|
<pd:type>com.tibco.plugin.mapper.MapperActivity</pd:type>
|
|
<pd:resourceType>ae.activities.MapperActivity</pd:resourceType>
|
|
<pd:x>706</pd:x>
|
|
<pd:y>83</pd:y>
|
|
<config>
|
|
<element>
|
|
<xsd:element name="root">
|
|
<xsd:complexType>
|
|
<xsd:sequence>
|
|
<xsd:element name="author" minOccurs="0" maxOccurs="unbounded">
|
|
<xsd:complexType>
|
|
<xsd:sequence>
|
|
<xsd:element name="firstname" type="xsd:string"/>
|
|
<xsd:element name="lastname" type="xsd:string"/>
|
|
<xsd:element name="date-of-birth" type="xsd:string"/>
|
|
<xsd:element name="date-of-death" type="xsd:string"/>
|
|
<xsd:element name="id" type="xsd:string"/>
|
|
<xsd:element name="age" type="xsd:string"/>
|
|
</xsd:sequence>
|
|
</xsd:complexType>
|
|
</xsd:element>
|
|
</xsd:sequence>
|
|
</xsd:complexType>
|
|
</xsd:element>
|
|
</element>
|
|
</config>
|
|
<pd:inputBindings>
|
|
<root>
|
|
<xsl:for-each select="$Parse-XML/authors/pfx2:author">
|
|
<xsl:if test="@id=$Start/root/id">
|
|
<author>
|
|
<firstname>
|
|
<xsl:value-of select="pfx2:firstName"/>
|
|
</firstname>
|
|
<lastname>
|
|
<xsl:value-of select="pfx2:lastName"/>
|
|
</lastname>
|
|
<date-of-birth>
|
|
<xsl:value-of select="pfx2:dateOfBirth"/>
|
|
</date-of-birth>
|
|
<date-of-death>
|
|
<xsl:value-of select="pfx2:dateOfDeath"/>
|
|
</date-of-death>
|
|
<id>
|
|
<xsl:value-of select="pfx2:age"/>
|
|
</id>
|
|
<age>
|
|
<xsl:value-of select="pfx2:age"/>
|
|
</age>
|
|
</author>
|
|
</xsl:if>
|
|
</xsl:for-each>
|
|
</root>
|
|
</pd:inputBindings>
|
|
</pd:activity>
|
|
<pd:activity name="Notify">
|
|
<pd:type>com.tibco.plugin.waitnotify.NotifyActivity</pd:type>
|
|
<pd:resourceType>ae.activities.notifyActivity</pd:resourceType>
|
|
<pd:x>888</pd:x>
|
|
<pd:y>81</pd:y>
|
|
<config>
|
|
<sharedConfig>/Resources/configurations/Notify Configuration.sharednotify</sharedConfig>
|
|
</config>
|
|
<pd:inputBindings>
|
|
<input>
|
|
<root>
|
|
<xsl:if test="$Map-Data-2/root/author[1]/firstname">
|
|
<firstname>
|
|
<xsl:value-of select="$Map-Data-2/root/author[1]/firstname"/>
|
|
</firstname>
|
|
</xsl:if>
|
|
<xsl:if test="$Map-Data-2/root/author[1]/lastname">
|
|
<lastname>
|
|
<xsl:value-of select="$Map-Data-2/root/author[1]/lastname"/>
|
|
</lastname>
|
|
</xsl:if>
|
|
<xsl:if test="$Map-Data-2/root/author[1]/date-of-birth">
|
|
<date-of-birth>
|
|
<xsl:value-of select="$Map-Data-2/root/author[1]/date-of-birth"/>
|
|
</date-of-birth>
|
|
</xsl:if>
|
|
<xsl:if test="$Map-Data-2/root/author[1]/date-of-death">
|
|
<date-of-death>
|
|
<xsl:value-of select="$Map-Data-2/root/author[1]/date-of-death"/>
|
|
</date-of-death>
|
|
</xsl:if>
|
|
<xsl:if test="$Map-Data-2/root/author[1]/age">
|
|
<age>
|
|
<xsl:value-of select="$Map-Data-2/root/author[1]/age"/>
|
|
</age>
|
|
</xsl:if>
|
|
<status>
|
|
<xsl:value-of select="'jest git'"/>
|
|
</status>
|
|
</root>
|
|
</input>
|
|
</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>705</pd:x>
|
|
<pd:y>277</pd:y>
|
|
<config>
|
|
<faultName/>
|
|
</config>
|
|
<pd:inputBindings>
|
|
<ns2:ActivityInput>
|
|
<message>
|
|
<xsl:value-of select="'dany author nie istnieje'"/>
|
|
</message>
|
|
</ns2:ActivityInput>
|
|
</pd:inputBindings>
|
|
</pd:activity>
|
|
<pd:transition>
|
|
<pd:from>Parse XML</pd:from>
|
|
<pd:to>Map-Data-2</pd:to>
|
|
<pd:lineType>Default</pd:lineType>
|
|
<pd:lineColor>-16777216</pd:lineColor>
|
|
<pd:conditionType>always</pd:conditionType>
|
|
</pd:transition>
|
|
<pd:transition>
|
|
<pd:from>Notify</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>Map-Data-2</pd:from>
|
|
<pd:to>Notify</pd:to>
|
|
<pd:xpathDescription>author exist</pd:xpathDescription>
|
|
<pd:lineType>Default</pd:lineType>
|
|
<pd:lineColor>-16777216</pd:lineColor>
|
|
<pd:conditionType>xpath</pd:conditionType>
|
|
<pd:xpath>boolean($Map-Data-2/root/author)</pd:xpath>
|
|
</pd:transition>
|
|
<pd:transition>
|
|
<pd:from>Read File</pd:from>
|
|
<pd:to>Parse XML</pd:to>
|
|
<pd:lineType>Default</pd:lineType>
|
|
<pd:lineColor>-16777216</pd:lineColor>
|
|
<pd:conditionType>always</pd:conditionType>
|
|
</pd:transition>
|
|
<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>Map-Data-2</pd:from>
|
|
<pd:to>Generate Error</pd:to>
|
|
<pd:xpathDescription>author does not exist</pd:xpathDescription>
|
|
<pd:lineType>Default</pd:lineType>
|
|
<pd:lineColor>-16777216</pd:lineColor>
|
|
<pd:conditionType>xpath</pd:conditionType>
|
|
<pd:xpath>not(boolean($Map-Data-2/root/author))</pd:xpath>
|
|
</pd:transition>
|
|
</pd:ProcessDefinition> |