Skip to content

Commit

Permalink
fix: missing configuration for the organization in global config does…
Browse files Browse the repository at this point in the history
… not throw error
  • Loading branch information
MLenterman committed Jun 7, 2023
1 parent 280fdb3 commit cf3a7c9
Show file tree
Hide file tree
Showing 6 changed files with 120 additions and 60 deletions.
49 changes: 37 additions & 12 deletions src/main/configurations/Translate/Configuration_CreeerZaak_LK01.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,50 @@
<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 Down Expand Up @@ -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 Down
54 changes: 39 additions & 15 deletions src/main/configurations/Translate/Configuration_UpdateZaak_LK01.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -88,25 +88,50 @@
<Forward name="error" path="UncaughtException"/>
</XsltPipe>

<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="Rsin"
styleSheetName="CreeerZaak_LK01/xsl/GetRsin.xsl"
>
<Param name="GemeenteCode" xpathExpression="$OriginalMessage/edcLk01/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="StoreTaal"/>
<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="StoreTaal"/>
<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>

<PutInSessionPipe
Expand Down Expand Up @@ -148,9 +173,7 @@
>
<Param name="ZdsZaakDocumentInhoud" sessionKey="ZdsZaakDocumentInhoudDataRef" type="DOMDOC"/>
<Param name="ZgwInformatieObjectType" sessionKey="ZgwInformatieObjectType" type="DOMDOC"/>
<Param name="Bronorganisatie" xpathExpression="$Rsin/rsin">
<Param name="Rsin" sessionKey="Rsin" type="DOMDOC"/>
</Param>
<Param name="Bronorganisatie" sessionKey="Rsin" xpathExpression="/RSIN" />
<Param name="IndicatieGebruiksrecht" value="false" />
<Param name="Taal" sessionKey="Taal" />
<Forward name="success" path="PostZgwEnkelvoudigInformatieObjectSender"/>
Expand Down Expand Up @@ -191,7 +214,7 @@
<Param name="Zaak" sessionKey="ZgwZaak" type="DOMDOC"/>
</Param>
<Forward name="success" path="PostZgwZaakInformatieObjectSender"/>
<Forward name="error" path="EXCEPTION"/>
<Forward name="error" path="UncaughtException"/>
</XsltPipe>

<SenderPipe
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:math="http://www.w3.org/2005/xpath-functions/math" xmlns:array="http://www.w3.org/2005/xpath-functions/array" xmlns:map="http://www.w3.org/2005/xpath-functions/map" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:err="http://www.w3.org/2005/xqt-errors" xmlns:zgw="http://google.com/zgw" exclude-result-prefixes="array fn map math xhtml xs err zgw" version="2.0">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:param name="GetRsinResult"/>
<xsl:param name="Bronorganisatie" select="''" as="xs:string" />
<xsl:param name="VerantwoordelijkeOrganisatie" select="''" as="xs:string" />
<xsl:param name="GetZaakTypeResult"/>
<xsl:param name="communicatiekanaal" select="''" as="xs:string"/>
<xsl:param name="productenOfDiensten" select="''" as="xs:string"/>
Expand All @@ -17,14 +18,14 @@
<xsl:template match="zakLk01/object[@entiteittype='ZAK']">
<ZgwZaak>
<identificatie><xsl:value-of select="identificatie"/></identificatie>
<bronorganisatie><xsl:value-of select="$GetRsinResult/rsin"/></bronorganisatie>
<bronorganisatie><xsl:value-of select="$Bronorganisatie"/></bronorganisatie>
<omschrijving><xsl:value-of select="omschrijving"/></omschrijving>
<toelichting><xsl:value-of select="toelichting"/></toelichting>
<zaaktype><xsl:value-of select="$GetZaakTypeResult/ZgwZaakTypen/ZgwZaakType/url"/></zaaktype>
<xsl:if test="string-length(registratiedatum) > 0">
<registratiedatum><xsl:value-of select="zgw:convertZdsDateToZgwDate(registratiedatum)"/></registratiedatum>
</xsl:if>
<verantwoordelijkeOrganisatie><xsl:value-of select="$GetRsinResult/rsin"/></verantwoordelijkeOrganisatie>
<verantwoordelijkeOrganisatie><xsl:value-of select="$VerantwoordelijkeOrganisatie"/></verantwoordelijkeOrganisatie>
<xsl:if test="string-length(startdatum) > 0">
<startdatum><xsl:value-of select="zgw:convertZdsDateToZgwDate(startdatum)"/></startdatum>
</xsl:if>
Expand Down
14 changes: 0 additions & 14 deletions src/main/configurations/Translate/CreeerZaak_LK01/xsl/GetRsin.xsl

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
<xsl:include href="../../Zgw/ZgwFunctionsBase.xslt" />

<xsl:param name="ZgwZaak"/>
<xsl:param name="Rsin"/>
<xsl:param name="Bronorganisatie" select="''" as="xs:string" />
<xsl:param name="VerantwoordelijkeOrganisatie" select="''" as="xs:string" />

<xsl:function name="zgw:convertZdsArchiefNominatieToZgwArchiefNominatie" as="xs:string">
<xsl:param name="zgwArchiefNominatie" as="xs:string"/>
Expand All @@ -28,7 +29,7 @@
<xsl:when test="string-length(object/identificatie) > 0"><identificatie><xsl:value-of select="object/identificatie"/></identificatie></xsl:when>
<xsl:when test="string-length($ZgwZaak/ZgwZaak/identificatie) > 0"><identificatie><xsl:value-of select="$ZgwZaak/ZgwZaak/identificatie"/></identificatie></xsl:when>
</xsl:choose>
<bronorganisatie><xsl:value-of select="$Rsin/rsin"/></bronorganisatie>
<bronorganisatie><xsl:value-of select="$Bronorganisatie"/></bronorganisatie>
<omschrijving><xsl:value-of select="object/omschrijving"/></omschrijving>
<xsl:choose>
<xsl:when test="string-length(object/toelichting) > 0"><toelichting><xsl:value-of select="object/toelichting"/></toelichting></xsl:when>
Expand Down

0 comments on commit cf3a7c9

Please sign in to comment.