430 lines
17 KiB
XML
430 lines
17 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<pd:ProcessDefinition xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 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:ns2="http://www.demo.com/author" xmlns:ns1="http://www.tibco.com/schemas/httpRequest/Resources/schemas/ErrorSchema.xsd2" xmlns:ns4="http://www.tibco.com/pe/GenerateErrorActivity/InputSchema" xmlns:ns3="http://xmlns.example.com/1721737885605">
|
|
<xsd:import namespace="http://www.demo.com/author" schemaLocation="/Resources/WSDL/WSDL.wsdl"/>
|
|
<pd:name>Processes/xml/Xml.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>86</pd:startX>
|
|
<pd:startY>180</pd:startY>
|
|
<pd:returnBindings>
|
|
<root>
|
|
<xsl:copy-of select="$XmlGet/root/ns2:author"/>
|
|
<xsl:choose>
|
|
<xsl:when test="boolean($XmlPut/root/status)">
|
|
<status>
|
|
<xsl:value-of select="$XmlPut/root/status"/>
|
|
</status>
|
|
</xsl:when>
|
|
<xsl:when test="boolean($XmlPost/root/status)">
|
|
<status>
|
|
<xsl:value-of select="$XmlPost/root/status"/>
|
|
</status>
|
|
</xsl:when>
|
|
<xsl:when test="boolean($XmlGet/root/status)">
|
|
<status>
|
|
<xsl:value-of select="$XmlGet/root/status"/>
|
|
</status>
|
|
</xsl:when>
|
|
<xsl:when test="boolean($XmlDelete/root/status)">
|
|
<status>
|
|
<xsl:value-of select="$XmlDelete/root/status"/>
|
|
</status>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<status>
|
|
<xsl:value-of select=""something went wrong""/>
|
|
</status>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</root>
|
|
</pd:returnBindings>
|
|
<pd:endName>End</pd:endName>
|
|
<pd:endType>
|
|
<xsd:element name="root">
|
|
<xsd:complexType>
|
|
<xsd:sequence>
|
|
<xsd:element ref="ns2:author" minOccurs="0"/>
|
|
<xsd:element name="status" type="xsd:string"/>
|
|
</xsd:sequence>
|
|
</xsd:complexType>
|
|
</xsd:element>
|
|
</pd:endType>
|
|
<pd:endX>823</pd:endX>
|
|
<pd:endY>177</pd:endY>
|
|
<pd:errorSchemas>
|
|
<XMLError>
|
|
<xsd:element name="XMLError">
|
|
<xsd:complexType>
|
|
<xsd:sequence>
|
|
<xsd:element name="message" type="xsd:string"/>
|
|
</xsd:sequence>
|
|
</xsd:complexType>
|
|
</xsd:element>
|
|
</XMLError>
|
|
</pd:errorSchemas>
|
|
<pd:processVariables/>
|
|
<pd:targetNamespace>http://xmlns.example.com/1719484154608</pd:targetNamespace>
|
|
<pd:activity name="CatchPutError">
|
|
<pd:type>com.tibco.pe.core.CatchActivity</pd:type>
|
|
<pd:resourceType>ae.activities.catch</pd:resourceType>
|
|
<pd:x>406</pd:x>
|
|
<pd:y>478</pd:y>
|
|
<pd:handler>true</pd:handler>
|
|
<config>
|
|
<fault>localname=XMLPutError</fault>
|
|
</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>583</pd:x>
|
|
<pd:y>694</pd:y>
|
|
<config>
|
|
<faultName>XMLError</faultName>
|
|
</config>
|
|
<pd:inputBindings>
|
|
<ns4:ActivityInput>
|
|
<data>
|
|
<XMLError>
|
|
<xsl:choose>
|
|
<xsl:when test="boolean($CatchPutError/XMLPutError/message)">
|
|
<message>
|
|
<xsl:value-of select="$CatchPutError/XMLPutError/message"/>
|
|
</message>
|
|
</xsl:when>
|
|
<xsl:when test="boolean($CatchPostError/xmlPostError/message)">
|
|
<message>
|
|
<xsl:value-of select="$CatchPostError/xmlPostError/message"/>
|
|
</message>
|
|
</xsl:when>
|
|
<xsl:when test="boolean($CatchDeleteError/xmlDeleteError/message)">
|
|
<message>
|
|
<xsl:value-of select="$CatchDeleteError/xmlDeleteError/message"/>
|
|
</message>
|
|
</xsl:when>
|
|
<xsl:when test="boolean($CatchGetError/xmlGetError/message)">
|
|
<message>
|
|
<xsl:value-of select="$CatchGetError/xmlGetError/message"/>
|
|
</message>
|
|
</xsl:when>
|
|
<xsl:otherwise>
|
|
<message>
|
|
<xsl:value-of select=""something went wrong""/>
|
|
</message>
|
|
</xsl:otherwise>
|
|
</xsl:choose>
|
|
</XMLError>
|
|
</data>
|
|
</ns4:ActivityInput>
|
|
</pd:inputBindings>
|
|
</pd:activity>
|
|
<pd:activity name="Log">
|
|
<pd:type>com.tibco.pe.core.WriteToLogActivity</pd:type>
|
|
<pd:resourceType>ae.activities.log</pd:resourceType>
|
|
<pd:x>178</pd:x>
|
|
<pd:y>180</pd:y>
|
|
<config>
|
|
<role>User</role>
|
|
</config>
|
|
<pd:inputBindings>
|
|
<ns:ActivityInput>
|
|
<message>
|
|
<xsl:value-of select="$Start/root/data"/>
|
|
</message>
|
|
</ns:ActivityInput>
|
|
</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>318</pd:x>
|
|
<pd:y>180</pd:y>
|
|
<config>
|
|
<element>
|
|
<xsd:element name="root">
|
|
<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>
|
|
</element>
|
|
</config>
|
|
<pd:inputBindings>
|
|
<root>
|
|
<firstname>
|
|
<xsl:value-of select="substring-before(substring-after($Start/root/data, '"firstName":"'), '"')"/>
|
|
</firstname>
|
|
<lastname>
|
|
<xsl:value-of select="substring-before(substring-after($Start/root/data, '"lastName":"'), '"')"/>
|
|
</lastname>
|
|
<date-of-birth>
|
|
<xsl:value-of select="substring-before(substring-after($Start/root/data, '"dateOfBirth":"'), '"')"/>
|
|
</date-of-birth>
|
|
<date-of-death>
|
|
<xsl:value-of select="substring-before(substring-after($Start/root/data, '"dateOfDeath":"'), '"')"/>
|
|
</date-of-death>
|
|
<id>
|
|
<xsl:value-of 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 select="number(substring-before(substring-after($Start/root/data, '"age":"'), '"'))"/>
|
|
</age>
|
|
</root>
|
|
</pd:inputBindings>
|
|
</pd:activity>
|
|
<pd:activity name="XmlDelete">
|
|
<pd:type>com.tibco.pe.core.CallProcessActivity</pd:type>
|
|
<pd:resourceType>ae.process.subprocess</pd:resourceType>
|
|
<pd:x>569</pd:x>
|
|
<pd:y>145</pd:y>
|
|
<config>
|
|
<processName>/Processes/xml/author/XmlDELETE.process</processName>
|
|
</config>
|
|
<pd:inputBindings>
|
|
<root>
|
|
<id>
|
|
<xsl:value-of select="number($Map-Data/root/id)"/>
|
|
</id>
|
|
</root>
|
|
</pd:inputBindings>
|
|
</pd:activity>
|
|
<pd:activity name="XmlGet">
|
|
<pd:type>com.tibco.pe.core.CallProcessActivity</pd:type>
|
|
<pd:resourceType>ae.process.subprocess</pd:resourceType>
|
|
<pd:x>569</pd:x>
|
|
<pd:y>402</pd:y>
|
|
<config>
|
|
<processName>/Processes/xml/author/XmlGET.process</processName>
|
|
<processNameXPath/>
|
|
</config>
|
|
<pd:inputBindings>
|
|
<root>
|
|
<id>
|
|
<xsl:value-of select="number($Map-Data/root/id)"/>
|
|
</id>
|
|
</root>
|
|
</pd:inputBindings>
|
|
</pd:activity>
|
|
<pd:activity name="XmlPost">
|
|
<pd:type>com.tibco.pe.core.CallProcessActivity</pd:type>
|
|
<pd:resourceType>ae.process.subprocess</pd:resourceType>
|
|
<pd:x>569</pd:x>
|
|
<pd:y>34</pd:y>
|
|
<config>
|
|
<processName>/Processes/xml/author/XmlPOST.process</processName>
|
|
<processNameXPath/>
|
|
</config>
|
|
<pd:inputBindings>
|
|
<root>
|
|
<ns2:author>
|
|
<xsl:attribute name="id">
|
|
<xsl:value-of select="number($Map-Data/root/id)"/>
|
|
</xsl:attribute>
|
|
<ns2:firstName>
|
|
<xsl:value-of select="$Map-Data/root/firstname"/>
|
|
</ns2:firstName>
|
|
<ns2:lastName>
|
|
<xsl:value-of select="$Map-Data/root/lastname"/>
|
|
</ns2:lastName>
|
|
<ns2:age>
|
|
<xsl:value-of select="number($Map-Data/root/age)"/>
|
|
</ns2:age>
|
|
<ns2:dateOfBirth>
|
|
<xsl:value-of select="$Map-Data/root/date-of-birth"/>
|
|
</ns2:dateOfBirth>
|
|
<ns2:dateOfDeath>
|
|
<xsl:value-of select="$Map-Data/root/date-of-death"/>
|
|
</ns2:dateOfDeath>
|
|
</ns2:author>
|
|
</root>
|
|
</pd:inputBindings>
|
|
</pd:activity>
|
|
<pd:activity name="XmlPut">
|
|
<pd:type>com.tibco.pe.core.CallProcessActivity</pd:type>
|
|
<pd:resourceType>ae.process.subprocess</pd:resourceType>
|
|
<pd:x>569</pd:x>
|
|
<pd:y>284</pd:y>
|
|
<config>
|
|
<processName>/Processes/xml/author/XmlPUT.process</processName>
|
|
</config>
|
|
<pd:inputBindings>
|
|
<root>
|
|
<ns2:author>
|
|
<xsl:attribute name="id">
|
|
<xsl:value-of select="number($Map-Data/root/id)"/>
|
|
</xsl:attribute>
|
|
<ns2:firstName>
|
|
<xsl:value-of select="$Map-Data/root/firstname"/>
|
|
</ns2:firstName>
|
|
<ns2:lastName>
|
|
<xsl:value-of select="$Map-Data/root/lastname"/>
|
|
</ns2:lastName>
|
|
<ns2:age>
|
|
<xsl:value-of select="number($Map-Data/root/age)"/>
|
|
</ns2:age>
|
|
<ns2:dateOfBirth>
|
|
<xsl:value-of select="$Map-Data/root/date-of-birth"/>
|
|
</ns2:dateOfBirth>
|
|
<ns2:dateOfDeath>
|
|
<xsl:value-of select="$Map-Data/root/date-of-death"/>
|
|
</ns2:dateOfDeath>
|
|
</ns2:author>
|
|
</root>
|
|
</pd:inputBindings>
|
|
</pd:activity>
|
|
<pd:activity name="CatchPostError">
|
|
<pd:type>com.tibco.pe.core.CatchActivity</pd:type>
|
|
<pd:resourceType>ae.activities.catch</pd:resourceType>
|
|
<pd:x>321</pd:x>
|
|
<pd:y>562</pd:y>
|
|
<pd:handler>true</pd:handler>
|
|
<config>
|
|
<fault>localname=xmlPostError</fault>
|
|
</config>
|
|
<pd:inputBindings/>
|
|
</pd:activity>
|
|
<pd:activity name="CatchDeleteError">
|
|
<pd:type>com.tibco.pe.core.CatchActivity</pd:type>
|
|
<pd:resourceType>ae.activities.catch</pd:resourceType>
|
|
<pd:x>295</pd:x>
|
|
<pd:y>684</pd:y>
|
|
<pd:handler>true</pd:handler>
|
|
<config>
|
|
<fault>localname=xmlDeleteError</fault>
|
|
</config>
|
|
<pd:inputBindings/>
|
|
</pd:activity>
|
|
<pd:activity name="CatchGetError">
|
|
<pd:type>com.tibco.pe.core.CatchActivity</pd:type>
|
|
<pd:resourceType>ae.activities.catch</pd:resourceType>
|
|
<pd:x>327</pd:x>
|
|
<pd:y>812</pd:y>
|
|
<pd:handler>true</pd:handler>
|
|
<config>
|
|
<fault>localname=xmlGetError</fault>
|
|
</config>
|
|
<pd:inputBindings/>
|
|
</pd:activity>
|
|
<pd:transition>
|
|
<pd:from>XmlPost</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</pd:from>
|
|
<pd:to>XmlPost</pd:to>
|
|
<pd:xpathDescription>Post</pd:xpathDescription>
|
|
<pd:lineType>Default</pd:lineType>
|
|
<pd:lineColor>-16777216</pd:lineColor>
|
|
<pd:conditionType>xpath</pd:conditionType>
|
|
<pd:xpath>$Start/root/method = 'POST'</pd:xpath>
|
|
</pd:transition>
|
|
<pd:transition>
|
|
<pd:from>Start</pd:from>
|
|
<pd:to>Log</pd:to>
|
|
<pd:lineType>Default</pd:lineType>
|
|
<pd:lineColor>-16777216</pd:lineColor>
|
|
<pd:conditionType>always</pd:conditionType>
|
|
</pd:transition>
|
|
<pd:transition>
|
|
<pd:from>Log</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>XmlGet</pd:to>
|
|
<pd:xpathDescription>Get</pd:xpathDescription>
|
|
<pd:lineType>Default</pd:lineType>
|
|
<pd:lineColor>-16777216</pd:lineColor>
|
|
<pd:conditionType>xpath</pd:conditionType>
|
|
<pd:xpath>$Start/root/method = 'GET'</pd:xpath>
|
|
</pd:transition>
|
|
<pd:transition>
|
|
<pd:from>XmlGet</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</pd:from>
|
|
<pd:to>XmlDelete</pd:to>
|
|
<pd:xpathDescription>Delete</pd:xpathDescription>
|
|
<pd:lineType>Default</pd:lineType>
|
|
<pd:lineColor>-16777216</pd:lineColor>
|
|
<pd:conditionType>xpath</pd:conditionType>
|
|
<pd:xpath>$Start/root/method = 'DELETE'</pd:xpath>
|
|
</pd:transition>
|
|
<pd:transition>
|
|
<pd:from>Map Data</pd:from>
|
|
<pd:to>XmlPut</pd:to>
|
|
<pd:xpathDescription>Put</pd:xpathDescription>
|
|
<pd:lineType>Default</pd:lineType>
|
|
<pd:lineColor>-16777216</pd:lineColor>
|
|
<pd:conditionType>xpath</pd:conditionType>
|
|
<pd:xpath>$Start/root/method = 'PUT'</pd:xpath>
|
|
</pd:transition>
|
|
<pd:transition>
|
|
<pd:from>XmlPut</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>XmlDelete</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>CatchPutError</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>CatchPostError</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>CatchDeleteError</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>CatchGetError</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:ProcessDefinition> |