Skip to content

Commit

Permalink
feat: insert status into resourceURL field
Browse files Browse the repository at this point in the history
  • Loading branch information
DelanoWAF committed Oct 13, 2023
1 parent ddd1472 commit 0c60140
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,18 @@

<JsonPipe name="statusResponseJsonToXml" storeResultInSessionKey="storeStatusResponse" />

<!-- If Status element in response, add it to the firstInput sessionkey as a resourceURL element
and then call status again. -->
<XmlIfPipe name="lookForStatus" xpathExpression="boolean(//status)">
<Forward name="then" path="replaceResourceURL" />
<Forward name="else" path="Call Open Zaak to get rollen" />
</XmlIfPipe>

<XsltPipe name="replaceResourceURL" styleSheetName="xsl/ReplaceResourceURL.xsl">
<Param name="URL" xpathExpression="//status" />
<Forward name="success" path="Call Open Zaak to get status in zaak" />
</XsltPipe>

<SenderPipe name="Call Open Zaak to get rollen" getInputFromSessionKey="getZaakXml">
<HttpSender name="rollenJson"
headersParams="Accept-Crs,Authorization">
Expand Down
23 changes: 23 additions & 0 deletions src/main/configurations/LopendeZaken/xsl/ReplaceResourceURL.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns="http://www.egem.nl/StUF/sector/zkn/0310"
xmlns:StUF="http://www.egem.nl/StUF/StUF0301"
xmlns:BG="http://www.egem.nl/StUF/sector/bg/0310"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" />

<xsl:param name="URL" />

<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()" />
</xsl:copy>
</xsl:template>

<xsl:template match="//resourceUrl">
<resourceUrl>
<xsl:value-of select="$URL" />
</resourceUrl>
</xsl:template>

</xsl:stylesheet>

0 comments on commit 0c60140

Please sign in to comment.