Skip to content

Commit

Permalink
Merge pull request #106 from ibissource/rsin-errorhandling
Browse files Browse the repository at this point in the history
Rsin errorhandling
  • Loading branch information
RayetSena authored Jun 8, 2023
2 parents 7f7c5ff + dc3dc34 commit 3beba71
Show file tree
Hide file tree
Showing 8 changed files with 206 additions and 95 deletions.
6 changes: 3 additions & 3 deletions charts/zaakbrug/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
apiVersion: v2
appVersion: 1.12.10
description: Install ZaakBrug (zds-to-zgw) on Haven, powerd by the Frank!Framework
appVersion: 1.12.11
description: Install ZaakBrug (zds-to-zgw) on Haven, powered by the Frank!Framework
name: zaakbrug
type: application
version: 0.7.9
version: 0.7.10

home: https://github.com/ibissource/zaakbrug
icon: "https://raw.githubusercontent.com/ibissource/zaakbrug/master/zaakbrug-icon.png"
Expand Down
16 changes: 16 additions & 0 deletions src/main/configurations/Translate/Common/xsl/BuildError.xsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" version="2.0">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/>
<xsl:param name="code" select="'TechnicalError'" as="xs:string" />
<xsl:param name="reason" select="'Undefined error'" as="xs:string" />
<xsl:param name="details" select="''" as="xs:string" />
<xsl:param name="detailsXml" as="node()?" />

<xsl:template match="/">
<error>
<code><xsl:value-of select="$code" /></code>
<reason><xsl:value-of select="$reason" /></reason>
<details><xsl:value-of select="$details" /></details>
<detailsXml><xsl:copy-of select="$detailsXml"/></detailsXml>
</error>
</xsl:template>
</xsl:stylesheet>
81 changes: 59 additions & 22 deletions src/main/configurations/Translate/Configuration_CreeerZaak_LK01.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

<Pipeline>
<Exits>
<Exit name="EXIT" state="SUCCESS"/>
<Exit name="EXCEPTION" state="ERROR"/>
<Exit name="EXIT" state="SUCCESS" />
<Exit name="EXCEPTION" state="ERROR" />
</Exits>

<SenderPipe
Expand All @@ -26,7 +26,7 @@
<Param name="ZaakTypeCode" xpathExpression="/zakLk01/object/isVan/gerelateerde/code"/>
</IbisLocalSender>
<Forward name="success" path="SetZgwZaakType"/>
<Forward name="exception" path="EXCEPTION" />
<Forward name="exception" path="UncaughtException" />
</SenderPipe>

<XsltPipe
Expand All @@ -41,29 +41,53 @@
xpathExpression="count(/ZgwZaakTypen/ZgwZaakType) = 1"
>
<Forward name="then" path="GetGlobalConfigFromLocalFS"/>
<Forward name="else" path="EXCEPTION"/>
<Forward name="else" path="UncaughtException"/>
</XmlIfPipe>

<SenderPipe name="GetGlobalConfigFromLocalFS">
<SenderPipe
name="GetGlobalConfigFromLocalFS"
storeResultInSessionKey="GlobalConfig"
>
<IbisLocalSender
name="CallImportFromLocalFS"
javaListener="ImportFromLocalFS">
<Param name="FileName" value="${FilePath_1}"/>
javaListener="ImportFromLocalFS"
>
<Param name="FileName" value="${FilePath_1}" />
</IbisLocalSender>
<Forward name="success" path="GetRsin"/>
<Forward name="exception" path="EXCEPTION" />
<Forward name="exception" path="UncaughtException" />
</SenderPipe>

<XsltPipe
<PutInSessionPipe
name="GetRsin"
storeResultInSessionKey="GetRsinResult"
skipEmptyTags="true"
styleSheetName="CreeerZaak_LK01/xsl/GetRsin.xsl"
>
<Param name="GemeenteCode" xpathExpression="$OriginalMessage/zakLk01/stuurgegevens/zender/organisatie">
<Param name="OriginalMessage" sessionKey="originalMessage" type="DOMDOC"/>
<Param name="Rsin" xpathExpression="/root/organizations[gemeenteCode = $GemeenteCode]/RSIN" defaultValue="&lt;RSIN/&gt;" type="XML">
<Param name="GemeenteCode" sessionKey="originalMessage" xpathExpression="/*/stuurgegevens/zender/organisatie" />
</Param>
<Forward name="success" path="CallGetZgwRolType"/>
<Forward name="success" path="Rsin_NotEmpty"/>
<Forward name="exception" path="UncaughtException" />
</PutInSessionPipe>

<XmlIfPipe
name="Rsin_NotEmpty"
getInputFromSessionKey="Rsin"
xpathExpression="string-length(/RSIN) gt 0"
>
<Forward name="then" path="CallGetZgwRolType"/>
<Forward name="else" path="Rsin_NotEmpty_Exception"/>
<Forward name="exception" path="UncaughtException"/>
</XmlIfPipe>

<XsltPipe
name="Rsin_NotEmpty_Exception"
styleSheetName="Common/xsl/BuildError.xsl">
<Param name="code" value="ConfigurationError" /> <!-- codes: TechnicalError, TranslationError, ConfigurationError-->
<Param name="GemeenteCode" sessionKey="originalMessage" xpathExpression="/*/stuurgegevens/zender/organisatie" />
<Param name="reason" pattern="No organization configured for gemeente code: [{GemeenteCode}]" ignoreUnresolvablePatternElements="true"/>
<!-- <Param name="details" sessionKey="" /> -->
<Param name="detailsXml" sessionKey="GlobalConfig" type="DOMDOC" />
<Forward name="success" path="EXCEPTION" />
<Forward name="exception" path="UncaughtException" />
</XsltPipe>

<SenderPipe
Expand All @@ -77,7 +101,7 @@
</Param>
</IbisLocalSender>
<Forward name="success" path="SetRoles"/>
<Forward name="exception" path="EXCEPTION" />
<Forward name="exception" path="UncaughtException" />
</SenderPipe>

<XsltPipe
Expand All @@ -104,7 +128,7 @@
</Param>
</IbisLocalSender>
<Forward name="success" path="CreateZaakBody"/>
<Forward name="exception" path="EXCEPTION" />
<Forward name="exception" path="UncaughtException" />
</ForEachChildElementPipe>

<XsltPipe
Expand All @@ -116,7 +140,8 @@
styleSheetName="CreeerZaak_LK01/xsl/CreateZaakBody.xsl"
>
<Param name="GetZaakTypeResult" sessionKey="GetZaakTypeResult" type="DOMDOC"/>
<Param name="GetRsinResult" sessionKey="GetRsinResult" type="DOMDOC"/>
<Param name="Bronorganisatie" sessionKey="Rsin" xpathExpression="/RSIN" />
<Param name="VerantwoordelijkeOrganisatie" sessionKey="Rsin" xpathExpression="/RSIN" />
<Forward name="success" path="CallPostZaak"/>
</XsltPipe>

Expand All @@ -128,7 +153,7 @@
javaListener="PostZaakAdapter">
</IbisLocalSender>
<Forward name="success" path="PostRolIterator"/>
<Forward name="exception" path="EXCEPTION" />
<Forward name="exception" path="UncaughtException" />
</SenderPipe>
<!-- Post zaak end -->
<ForEachChildElementPipe name="PostRolIterator"
Expand All @@ -143,7 +168,7 @@
</Param>
</IbisLocalSender>
<Forward name="success" path="CheckForHeeftBetrekkingOpAndere"/>
<Forward name="exception" path="EXCEPTION" />
<Forward name="exception" path="UncaughtException" />
</ForEachChildElementPipe>

<XmlIfPipe name="CheckForHeeftBetrekkingOpAndere"
Expand All @@ -163,7 +188,7 @@
<Param name="PostZgwZaakResult" sessionKey="PostZgwZaakResult" type="DOMDOC"/>
</IbisLocalSender>
<Forward name="success" path="CallSetResultaatAndStatus"/>
<Forward name="exception" path="EXCEPTION" />
<Forward name="exception" path="UncaughtException" />
</ForEachChildElementPipe>

<SenderPipe
Expand All @@ -181,8 +206,20 @@
</Param>
</IbisLocalSender>
<Forward name="success" path="EXIT"/>
<Forward name="exception" path="EXCEPTION" />
<Forward name="exception" path="UncaughtException" />
</SenderPipe>

<XsltPipe
name="UncaughtException"
emptyInputReplacement="&lt;EmptyInput/&gt;"
styleSheetName="Common/xsl/BuildError.xsl">
<Param name="code" value="TechnicalError" /> <!-- codes: TechnicalError, TranslationError, ConfigurationError-->
<Param name="reason" pattern="Uncaught exception" />
<!-- <Param name="details" sessionKey="" /> -->
<Param name="detailsXml" type="DOMDOC" />
<Forward name="success" path="EXCEPTION" />
<Forward name="exception" path="EXCEPTION" />
</XsltPipe>
</Pipeline>
</Adapter>
</Module>
78 changes: 57 additions & 21 deletions src/main/configurations/Translate/Configuration_UpdateZaak_LK01.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
<Param name="Identificatie" xpathExpression="/zakLk01/object[1]/identificatie"/>
</IbisLocalSender>
<Forward name="success" path="CheckForGetZgwZaakResult"/>
<Forward name="exception" path="EXCEPTION" />
<Forward name="exception" path="UncaughtException" />
</SenderPipe>

<XmlIfPipe name="CheckForGetZgwZaakResult"
xpathExpression="string-length(ZgwZaken) > 0"
>
<Forward name="then" path="GetSingleZgwZaakFromZgwZakenList"/>
<Forward name="else" path="EXCEPTION"/>
<Forward name="else" path="UncaughtException"/>
</XmlIfPipe>

<XsltPipe
Expand All @@ -43,7 +43,7 @@
storeResultInSessionKey="GetZgwWasZaakResult"
>
<Forward name="success" path="RemoveNullNodes"/>
<Forward name="error" path="EXCEPTION"/>
<Forward name="error" path="UncaughtException"/>
</XsltPipe>

<XsltPipe name="RemoveNullNodes"
Expand Down Expand Up @@ -73,7 +73,7 @@
<Param name="ZaakUrl" xpathExpression="/ZgwZaak/zaaktype" />
</IbisLocalSender>
<Forward name="success" path="CallGetZdsZaakFromZgw"/>
<Forward name="exception" path="EXCEPTION"/>
<Forward name="exception" path="UncaughtException"/>
</SenderPipe>

<SenderPipe
Expand All @@ -86,7 +86,7 @@
<Param name="ZgwZaakType" sessionKey="GetZgwZaaktypeByUrlResult" type="DOMDOC"/>
</IbisLocalSender>
<Forward name="success" path="CheckForInputZaakObjectCount"/>
<Forward name="exception" path="EXCEPTION" />
<Forward name="exception" path="UncaughtException" />
</SenderPipe>

<XmlIfPipe name="CheckForInputZaakObjectCount"
Expand Down Expand Up @@ -121,7 +121,7 @@
>
<Param name="ZdsWordtZaak" sessionKey="ZdsWordtZaak" type="DOMDOC"/>
<Forward name="success" path="CheckForDetectZdsZaakChangesResult"/>
<Forward name="error" path="EXCEPTION"/>
<Forward name="error" path="UncaughtException"/>
</XsltPipe>

<XmlIfPipe name="CheckForDetectZdsZaakChangesResult"
Expand All @@ -131,27 +131,50 @@
<Forward name="else" path="GetGlobalConfigFromLocalFS"/>
</XmlIfPipe>

<SenderPipe name="GetGlobalConfigFromLocalFS"
storeResultInSessionKey="GetGlobalConfigResult">
<SenderPipe
name="GetGlobalConfigFromLocalFS"
storeResultInSessionKey="GlobalConfig"
>
<IbisLocalSender
name="CallImportFromLocalFS"
javaListener="ImportFromLocalFS">
<Param name="FileName" value="${FilePath_1}"/>
javaListener="ImportFromLocalFS"
>
<Param name="FileName" value="${FilePath_1}" />
</IbisLocalSender>
<Forward name="success" path="GetRsin"/>
<Forward name="exception" path="EXCEPTION" />
<Forward name="exception" path="UncaughtException" />
</SenderPipe>

<XsltPipe
<PutInSessionPipe
name="GetRsin"
storeResultInSessionKey="GetRsinResult"
skipEmptyTags="true"
styleSheetName="CreeerZaak_LK01/xsl/GetRsin.xsl"
>
<Param name="GemeenteCode" xpathExpression="$OriginalMessage/zakLk01/stuurgegevens/zender/organisatie">
<Param name="OriginalMessage" sessionKey="originalMessage" type="DOMDOC"/>
<Param name="Rsin" xpathExpression="/root/organizations[gemeenteCode = $GemeenteCode]/RSIN" defaultValue="&lt;RSIN/&gt;" type="XML">
<Param name="GemeenteCode" sessionKey="originalMessage" xpathExpression="/*/stuurgegevens/zender/organisatie" />
</Param>
<Forward name="success" path="CreateUpdateZaakBody"/>
<Forward name="success" path="Rsin_NotEmpty"/>
<Forward name="exception" path="UncaughtException" />
</PutInSessionPipe>

<XmlIfPipe
name="Rsin_NotEmpty"
getInputFromSessionKey="Rsin"
xpathExpression="string-length(/RSIN) gt 0"
>
<Forward name="then" path="CreateUpdateZaakBody"/>
<Forward name="else" path="Rsin_NotEmpty_Exception"/>
<Forward name="exception" path="UncaughtException"/>
</XmlIfPipe>

<XsltPipe
name="Rsin_NotEmpty_Exception"
styleSheetName="Common/xsl/BuildError.xsl">
<Param name="code" value="ConfigurationError" /> <!-- codes: TechnicalError, TranslationError, ConfigurationError-->
<Param name="GemeenteCode" sessionKey="originalMessage" xpathExpression="/*/stuurgegevens/zender/organisatie" />
<Param name="reason" pattern="No organization configured for gemeente code: [{GemeenteCode}]" ignoreUnresolvablePatternElements="true"/>
<!-- <Param name="details" sessionKey="" /> -->
<Param name="detailsXml" sessionKey="GlobalConfig" type="DOMDOC" />
<Forward name="success" path="EXCEPTION" />
<Forward name="exception" path="UncaughtException" />
</XsltPipe>

<XsltPipe
Expand All @@ -161,7 +184,8 @@
storeResultInSessionKey="UpdateZaakBody"
>
<Param name="ZgwZaak" sessionKey="GetZgwWasZaakResult" type="DOMDOC"/>
<Param name="Rsin" sessionKey="GetRsinResult" type="DOMDOC"/>
<Param name="Bronorganisatie" sessionKey="Rsin" xpathExpression="/RSIN"/>
<Param name="VerantwoordelijkeOrganisatie" sessionKey="Rsin" xpathExpression="/RSIN"/>
<Forward name="success" path="UpdateZgwZaak"/>
<Forward name="error" path="EXCEPTION"/>
</XsltPipe>
Expand All @@ -185,7 +209,7 @@
skipEmptyTags="true"
styleSheetName="UpdateZaak_LK01/xsl/SetRoles.xslt"
>
<Param name="RolMapping" sessionKey="GetGlobalConfigResult" type="DOMDOC"/>
<Param name="RolMapping" sessionKey="GlobalConfig" type="DOMDOC"/>
<Forward name="success" path="SetRolesForZdsWordtZaak"/>
</XsltPipe>

Expand All @@ -197,7 +221,7 @@
skipEmptyTags="true"
styleSheetName="UpdateZaak_LK01/xsl/SetRoles.xslt"
>
<Param name="RolMapping" sessionKey="GetGlobalConfigResult" type="DOMDOC"/>
<Param name="RolMapping" sessionKey="GlobalConfig" type="DOMDOC"/>
<Forward name="success" path="CallDetectRolChanges"/>
</XsltPipe>

Expand Down Expand Up @@ -240,6 +264,18 @@
<Forward name="success" path="EXIT"/>
<Forward name="exception" path="EXCEPTION" />
</SenderPipe>

<XsltPipe
name="UncaughtException"
emptyInputReplacement="&lt;EmptyInput/&gt;"
styleSheetName="Common/xsl/BuildError.xsl">
<Param name="code" value="TechnicalError" /> <!-- codes: TechnicalError, TranslationError, ConfigurationError-->
<Param name="reason" pattern="Uncaught exception" />
<!-- <Param name="details" sessionKey="" /> -->
<Param name="detailsXml" type="DOMDOC" />
<Forward name="success" path="EXCEPTION" />
<Forward name="exception" path="EXCEPTION" />
</XsltPipe>
</Pipeline>
</Adapter>
</Module>
Loading

0 comments on commit 3beba71

Please sign in to comment.