Skip to content

Commit

Permalink
refactor: verwerkingssoort 'I' on case roles are processed as 'T' if …
Browse files Browse the repository at this point in the history
…the role is not present on the case (#285)

* fix: add organisatorischeEenheid translation

* test: add OEH test

* refacter: delete now finds by identification and deletes all that match

* Add: Zaak not found error detection

* refactor: ZdsZaak's existence can now be checked

* refactor: RolCheck goes one way not both

* Fix: added Check Test and commented out some soap elements

* Fix: extra empty check

* Refactor: add authentiek to zaak

* Fix: check was wrong on authentiek and

* Add: check tests (verwerkingsoort="I")

* save with correct soapui settings

* test: add two object updateZaak testcases for role delete, add and delete+add

* additional role testcases

* refactor: merge oud en nieuw and changed logic to pass extra testcases

* test: fix "'VI''TT'" test and add 'WI' test

* refactor: delete now throws eror if mutiple rolls are found to delete

* fix: change object count check

* refactor: cover more edgecases when merging

* refactor: group rollen at merge

* resolve regression test failures

---------

Co-authored-by: MLenterman <[email protected]>
  • Loading branch information
MikeErkemey and MLenterman authored Jun 21, 2024
1 parent 4bb2da2 commit 1ec7016
Show file tree
Hide file tree
Showing 19 changed files with 5,704 additions and 671 deletions.
5,846 changes: 5,283 additions & 563 deletions e2e/SoapUI/zaakbrug-e2e-soapui-project.xml

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions src/main/configurations/Translate/Configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<!ENTITY AndereZaak SYSTEM "./Configuration_AndereZaak.xml">
<!ENTITY CancelCheckOutZaakDocument_Di02 SYSTEM "./Configuration_CancelCheckOutZaakDocument_Di02.xml">
<!ENTITY CheckOutZaakDocument SYSTEM "./Configuration_CheckOutZaakDocument.xml">
<!ENTITY CheckZgwRol SYSTEM "./Configuration_CheckZgwRol.xml">
<!ENTITY ConvertISO639Taal SYSTEM "./Configuration_ConvertISO639Taal.xml">
<!ENTITY CreeerZaak_Lk01 SYSTEM "./Configuration_CreeerZaak_LK01.xml">
<!ENTITY DeleteRolFromZgw SYSTEM "./Configuration_DeleteRolFromZgw.xml">
Expand Down Expand Up @@ -79,6 +80,7 @@
&AndereZaak;
&CancelCheckOutZaakDocument_Di02;
&CheckOutZaakDocument;
&CheckZgwRol;
&ConvertISO639Taal;
&CreeerZaak_Lk01;
&DeleteRolFromZgw;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

<XmlIfPipe
name="CheckForZdsGerelateerde"
xpathExpression="string-length(role/gerelateerde)>0"
xpathExpression="count(role/gerelateerde) > 0"
>
<Forward name="then" path="CreateZgwBetrokkeneIdentificatie"/>
<Forward name="else" path="EXIT"/>
Expand Down
34 changes: 34 additions & 0 deletions src/main/configurations/Translate/Configuration_CheckZgwRol.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<Module xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../ibisdoc.xsd">
<Adapter name="CheckZgwRol"
active="${CheckZgwRol.Active}"
description="">

<Receiver name="CheckZgwRol">
<JavaListener name="CheckZgwRol"/>
</Receiver>

<Pipeline>
<Exits>
<Exit name="exists" state="SUCCESS"/>
<Exit name="NOTFOUND" state="SUCCESS" code="404" />
<Exit name="EXCEPTION" state="ERROR"/>
</Exits>

<XsltPipe name="CheckRol"
styleSheetName="UpdateZaak_LK01/xsl/CheckZgwRol.xslt"
getInputFromSessionKey="originalMessage">
<Param name="role" sessionKey="originalMessage" type="DOMDOC"/>
<Param name="roles" sessionKey="ZdsWasZaakRol" type="DOMDOC"/>
<Forward name="success" path="CheckForTrue" />
<Forward name="error" path="EXCEPTION" />
</XsltPipe>

<XmlIfPipe name="CheckForTrue"
xpathExpression="/Check/true"
>
<Forward name="then" path="exists"/>
<Forward name="else" path="NOTFOUND"/>
</XmlIfPipe>
</Pipeline>
</Adapter>
</Module>
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

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

Expand Down Expand Up @@ -67,11 +68,12 @@
xpathExpression="string-length(/ZgwRolType) > 0"
>
<Forward name="then" path="CallGetRolByZaakUrlAndRolTypeUrl"/>
<Forward name="else" path="EXIT"/>
<Forward name="else" path="EXCEPTION"/>
</XmlIfPipe>

<SenderPipe
name="CallGetRolByZaakUrlAndRolTypeUrl">
name="CallGetRolByZaakUrlAndRolTypeUrl"
getInputFromSessionKey="originalMessage">
<IbisLocalSender
name="GetRolByZaakUrlAndRolTypeUrlSender"
javaListener="GetRolByZaakUrlAndRolTypeUrl"
Expand All @@ -80,35 +82,53 @@
<Param name="RolTypeUrl" xpathExpression="$ZgwRolType/ZgwRolType/url">
<Param name="ZgwRolType" sessionKey="ZgwRolType" type="DOMDOC"/>
</Param>
<Param name="inpBsn" xpathExpression="role/gerelateerde/natuurlijkPersoon/inp.bsn"/>
<Param name="anpIdentificatie" xpathExpression="role/gerelateerde/natuurlijkPersoon/anp.Identificatie"/>
<Param name="inpA_nummer" xpathExpression="role/gerelateerde/natuurlijkPersoon/inpA_nummer"/>
<Param name="innNnpId" xpathExpression="role/gerelateerde/nietNatuurlijkPersoon/inn.nnpId"/>
<Param name="annIdentificatie" xpathExpression="role/gerelateerde/nietNatuurlijkPersoon/ann.identificatie"/>
<Param name="vestigingsNummer" xpathExpression="role/gerelateerde/vestiging/vestigingsNummer"/>
<Param name="OEHidentificatie" xpathExpression="role/gerelateerde/organisatorischeEenheid/identificatie"/>
<Param name="MDWidentificatie" xpathExpression="role/gerelateerde/medewerker/identificatie"/>
</IbisLocalSender>
<Forward name="success" path="CheckForGetRolResult"/>
<Forward name="exception" path="EXCEPTION" />
</SenderPipe>

<XmlIfPipe
name="CheckForGetRolResult"
xpathExpression="string-length(/Rol) > 0"
name="CheckForGetRolResult1"
xpathExpression="count(/Rollen/Rol) = 0"
>
<Forward name="then" path="DeleteRol"/>
<Forward name="else" path="EXIT"/>
<Forward name="then" path="NOTFOUND"/>
<Forward name="else" path="CheckForGetRolResult2"/>
</XmlIfPipe>

<SenderPipe
name="DeleteRol">
<HttpSender
name="DeleteRolSender"
methodType="DELETE"
headersParams="Authorization,Accept-Crs"
timeout="${zaakbrug.zgw.zaken-api.timeout}"
/>
<Param name="url" xpathExpression="/Rol/url"/>
<Param name="Accept-Crs" value="EPSG:4326"/>
<Param name="Authorization" sessionKey="originalMessage" xpathExpression="concat('Bearer ', $myToken)">
<Param name="myToken" sessionKey="myToken" defaultValue="@@zaken-api.jwt@@"/>
</Param>
<XmlIfPipe
name="CheckForGetRolResult2"
xpathExpression="count(/Rollen/Rol) >= 2"
>
<Forward name="then" path="EXCEPTION"/>
<Forward name="else" path="DeleteRol"/>
</XmlIfPipe>

<senderPipe
name="DeleteRol"
>
<HttpSender
name="DeleteRolSender"
methodType="DELETE"
headersParams="Authorization,Accept-Crs"
timeout="${zaakbrug.zgw.zaken-api.timeout}"
>
<Param name="url" xpathExpression="Rollen/Rol/url"/>
<Param name="Accept-Crs" value="EPSG:4326"/>
<Param name="Authorization" sessionKey="originalMessage" xpathExpression="concat('Bearer ', $myToken)">
<Param name="myToken" sessionKey="myToken" defaultValue="@@zaken-api.jwt@@"/>
</Param>
</HttpSender>

<Forward name="success" path="EXIT"/>
<Forward name="exception" path="ErrorJsonToXml" />
</SenderPipe>
</senderPipe>

<JsonPipe name="ErrorJsonToXml">
<Forward name="success" path="buildErrorMsg" />
</JsonPipe>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,53 @@

<XmlSwitchPipe
name="DetectRolChanges"
getInputFromSessionKey="ZdsWasZaakRol"
getInputFromSessionKey="originalMessage"
styleSheetName="UpdateZaak_LK01/xsl/DetectRolChanges.xslt"
>
<Param name="ZdsWordtZaakRol" sessionKey="originalMessage" type="DOMDOC"/>
<Forward name="New" path="CallGetZgwRolType"/>
<Forward name="New" path="CheckZgwRolNew"/>
<Forward name="Delete" path="CallDeleteRolFromZgw"/>
<Forward name="Changed" path="DeleteRolBeforeUpdate"/>
<Forward name="Exit" path="EXIT"/>
<Forward name="Check" path="CheckZgwRol"/>
<Forward name="Exit" path="EXCEPTION"/>
</XmlSwitchPipe>

<SenderPipe name="CheckZgwRolNew"
getInputFromSessionKey="originalMessage"
storeResultInSessionKey="CheckCheck">
<IbisLocalSender
name="CallCheckZgwRolSender"
javaListener="CheckZgwRol">
<Param name="ZdsWasZaakRol" sessionKey="ZdsWasZaakRol"/>
</IbisLocalSender>
<Forward name="success" path="LogWarningNew"/>
<Forward name="404" path="CallGetZgwRolType"/> <!-- Rol should not be found -->
<Forward name="exception" path="EXCEPTION"/>
</SenderPipe>

<SenderPipe name="LogWarningNew">
<LogSender name="LogWarningSender"/>
<Forward name="success" path="EXIT"/>
</SenderPipe>

<SenderPipe name="CheckZgwRol"
getInputFromSessionKey="originalMessage"
storeResultInSessionKey="CheckCheck">
<IbisLocalSender
name="CallCheckZgwRolSender"
javaListener="CheckZgwRol">

<Param name="ZdsWasZaakRol" sessionKey="ZdsWasZaakRol"/>
</IbisLocalSender>
<Forward name="success" path="EXIT"/> <!-- Rol should be found -->
<Forward name="404" path="LogWarningCheck"/>
<Forward name="exception" path="EXCEPTION"/>
</SenderPipe>

<SenderPipe name="LogWarningCheck">
<LogSender name="LogWarningSender">
</LogSender>
<Forward name="success" path="CallGetZgwRolType"/>
</SenderPipe>

<SenderPipe name="DeleteRolBeforeUpdate"
getInputFromSessionKey="originalMessage"
Expand All @@ -35,7 +73,8 @@
<Param name="ZgwZaakUrl" sessionKey="ZgwZaakUrl"/>
<Param name="ZaakTypeUrl" sessionKey="ZaakTypeUrl"/>
</IbisLocalSender>
<Forward name="success" path="CallGetZgwRolType"/>
<Forward name="success" path="CheckZgwRolNew"/> <!-- Rol should be found -->
<Forward name="404" path="LogWarningDelete"/>
<Forward name="exception" path="EXCEPTION" />
</SenderPipe>

Expand All @@ -62,10 +101,19 @@
<Param name="ZgwRolTypen" sessionKey="ZgwRolTypen" type="DOMDOC"/>
<Param name="ZaakTypeUrl" sessionKey="ZaakTypeUrl"/>
</IbisLocalSender>
<Forward name="success" path="CallPostRol"/>
<Forward name="success" path="CheckForRol"/>
<Forward name="exception" path="EXCEPTION" />
</SenderPipe>

<XmlIfPipe
name="CheckForRol"
xpathExpression="boolean(zgwRol/*)"
>
<Forward name="then" path="CallPostRol"/>
<Forward name="else" path="EXIT"/>
<Forward name="exception" path="EXCEPTION"/> <!-- Temporary solution for lack of adres processing -->
</XmlIfPipe>

<SenderPipe name="CallPostRol">
<IbisLocalSender
name="CallPostRolSender"
Expand All @@ -87,9 +135,16 @@
<Param name="ZgwZaakUrl" sessionKey="ZgwZaakUrl"/>
<Param name="ZaakTypeUrl" sessionKey="ZaakTypeUrl"/>
</IbisLocalSender>
<Forward name="success" path="EXIT"/>
<Forward name="exception" path="EXCEPTION" />
<Forward name="success" path="EXIT"/> <!-- Rol should be found -->
<Forward name="404" path="LogWarningDelete"/>
<Forward name="exception" path="EXCEPTION"/>
</SenderPipe>

<SenderPipe name="LogWarningDelete">
<LogSender name="LogWarningSender"/>
<Forward name="success" path="CallGetZgwRolType"/>
</SenderPipe>

</Pipeline>
</Adapter>
</Module>
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@
<Param name="url" value="${zaakbrug.zgw.zaken-api.root-url}rollen"/>
<Param name="zaak" sessionKey="ZaakUrl"/>
<Param name="roltype" sessionKey="RolTypeUrl"/>
<Param name="betrokkeneIdentificatie__natuurlijkPersoon__inpBsn" sessionKey="inpBsn"/>
<Param name="betrokkeneIdentificatie__natuurlijkPersoon__anpIdentificatie" sessionKey="anpIdentificatie"/>
<Param name="betrokkeneIdentificatie__nietNatuurlijkPersoon__innNnpId" sessionKey="innNnpId"/>
<Param name="betrokkeneIdentificatie__nietNatuurlijkPersoon__annIdentificatie" sessionKey="annIdentificatie"/>
<Param name="betrokkeneIdentificatie__vestiging__vestigingsNummer" sessionKey="vestigingsNummer"/>
<Param name="betrokkeneIdentificatie__organisatorischeEenheid__identificatie" sessionKey="OEHidentificatie"/>
<Param name="betrokkeneIdentificatie__medewerker__identificatie" sessionKey="MDWidentificatie"/>
<Param name="Accept-Crs" value="EPSG:4326"/>
<Param name="Authorization" sessionKey="originalMessage" xpathExpression="concat('Bearer ', $myToken)">
<Param name="myToken" sessionKey="myToken" defaultValue="@@zaken-api.jwt@@"/>
Expand All @@ -65,17 +72,10 @@
>
<Param name="List" value="Rollen"/>
<Param name="Type" value="Rol"/>
<Forward name="success" path="GetSingleZgwRolFromList"/>
<Forward name="error" path="EXCEPTION"/>
</XsltPipe>

<XsltPipe
name="GetSingleZgwRolFromList"
styleSheetName="Common/xsl/GetSingleElementFromList.xslt"
>
<Forward name="success" path="EXIT"/>
<Forward name="error" path="EXCEPTION"/>
</XsltPipe>

</Pipeline>
</Adapter>
</Module>
32 changes: 12 additions & 20 deletions src/main/configurations/Translate/Configuration_UpdateZaak_LK01.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,27 +90,21 @@

<XmlIfPipe name="CheckForInputZaakObjectCount"
getInputFromSessionKey="originalMessage"
xpathExpression="count(/zakLk01/object) = 2"
xpathExpression="count(/zakLk01/object) = 2 or count(/zakLk01/object) = 1"
>
<Forward name="then" path="StoreZdsWordtZaak_1"/>
<Forward name="else" path="StoreZdsWordtZaak_2"/>
<Forward name="then" path="MergeWordtZaakRollen"/>
<Forward name="else" path="EXCEPTION"/>
</XmlIfPipe>

<PutInSessionPipe
name="StoreZdsWordtZaak_1">
<Param name="ZdsWordtZaak" xpathExpression="$originalMessage/zakLk01/object[2]" type="DOMDOC">
<Param name="originalMessage" sessionKey="originalMessage" type="DOMDOC"/>
</Param>
<Forward name="success" path="DetectZdsZaakChanges" />
</PutInSessionPipe>

<PutInSessionPipe
name="StoreZdsWordtZaak_2">
<Param name="ZdsWordtZaak" xpathExpression="$originalMessage/zakLk01/object[1]" type="DOMDOC">
<Param name="originalMessage" sessionKey="originalMessage" type="DOMDOC"/>
</Param>
<Forward name="success" path="DetectZdsZaakChanges" />
</PutInSessionPipe>
<XsltPipe
name="MergeWordtZaakRollen"
styleSheetName="UpdateZaak_LK01/xsl/MergeWordtZaakRollen.xslt"
getInputFromSessionKey="originalMessage"
storeResultInSessionKey="ZdsWordtZaak"
>
<Forward name="success" path="DetectZdsZaakChanges"/>
<Forward name="error" path="EXCEPTION"/>
</XsltPipe>

<XsltPipe
name="DetectZdsZaakChanges"
Expand Down Expand Up @@ -187,7 +181,6 @@
getInputFromSessionKey="GetZdsZaakFromZgwResult"
storeResultInSessionKey="ZdsWasZaakRol"
removeNamespaces="true"
skipEmptyTags="true"
styleSheetName="UpdateZaak_LK01/xsl/SetRoles.xslt"
>
<Param name="RolMapping" sessionKey="GlobalConfig" type="DOMDOC"/>
Expand All @@ -199,7 +192,6 @@
getInputFromSessionKey="ZdsWordtZaak"
storeResultInSessionKey="ZdsWordtZaakRol"
removeNamespaces="true"
skipEmptyTags="true"
styleSheetName="UpdateZaak_LK01/xsl/SetRoles.xslt"
>
<Param name="RolMapping" sessionKey="GlobalConfig" type="DOMDOC"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
<xs:complexType name="zgwVerblijfsAdres">
<xs:sequence>
<xs:element name="aoaIdentificatie" type="zgwAN100"/>
<xs:element name="authentiek" type="authentiek" minOccurs="0"/>
<xs:element name="wplWoonplaatsNaam" type="zgwAN80"/>
<xs:element name="gorOpenbareRuimteNaam" type="zgwAN80"/>
<xs:element name="aoaPostcode" type="zgwAN7" minOccurs="0"/>
Expand All @@ -45,6 +46,12 @@
<xs:element name="inpLocatiebeschrijving" type="zgwAN1000" minOccurs="0"/>
</xs:sequence>
</xs:complexType>
<xs:simpleType name="authentiek">
<xs:restriction base="xs:string">
<xs:enumeration value="J"/>
<xs:enumeration value="N"/>
</xs:restriction>
</xs:simpleType>
<xs:simpleType name="zgwAN1">
<xs:restriction base="xs:string">
<xs:minLength value="1"/>
Expand Down
Loading

0 comments on commit 1ec7016

Please sign in to comment.