how to output based on the input condition part2



4)If there are no instances with underlyingPolicyCategoryCd = GL AND selectedInd = 'Y' AND deletedInd = 'Y' then Return code = SUCCESS and return reason code NOCHANGE



<policy VERSION_NO="1" MC_ID="56">
<businessGroupCdGvngOrgn>14</businessGroupCdGvngOrgn>
<linesOfInsurance>
<underlyingPolicy ID="8">
<PolicyNo>33</PolicyNo>
<deletedInd>N</deletedInd>
<VersionNbr>2</VersionNbr>
<selectedInd>Y</selectedInd>
<CategoryCd>AL</CategoryCd>
</underlyingPolicy>
<underlyingPolicy ID="7">
<PolicyNo>33</PolicyNo>
<deletedInd>Y</deletedInd>
<VersionNbr>1</VersionNbr>
<selectedInd>N</selectedInd>
<CategoryCd>AL</CategoryCd>
</underlyingPolicy>
<underlyingPolicy>
<PolicyNo>22</PolicyNo>
<deletedInd>Y</deletedInd>
<VersionNbr>2</VersionNbr>
<selectedInd>N</selectedInd>
<CategoryCd>GL</CategoryCd>
</underlyingPolicy>
<underlyingPolicy ID="5">
<PolicyNo>22</PolicyNo>
<deletedInd>Y</deletedInd>
<VersionNbr>1</VersionNbr>
<selectedInd>N</selectedInd>
<CategoryCd>GL</CategoryCd>
</underlyingPolicy>
<underlyingPolicy ID="4">
<PolicyNo>11</PolicyNo>
<deletedInd>N</deletedInd>
<VersionNbr>2</VersionNbr>
<selectedInd>Y</selectedInd>
<CategoryCd>GL</CategoryCd>
</underlyingPolicy>
<underlyingPolicy ID="3">
<PolicyNo>11</PolicyNo>
<deletedInd>Y</deletedInd>
<VersionNbr>1</VersionNbr>
<selectedInd>N</selectedInd>
<CategoryCd>GL</CategoryCd>
</underlyingPolicy>
</linesOfInsurance>
</policy>

Expected O/P:
<AdaptikXML>
<PWResponse>
<ReturnCode>SUCCESS</ReturnCode>
<ReturnReasonCode>NOCHANGE</ReturnReasonCode>
<ReturnMessage/>
<PWData>
<policy VERSION_NO="1" MC_ID="56"/>
</PWData>
</PWResponse>
</AdaptikXML>


Test case 3 - 2 GL policies with 2 quote versions each. Policy 22 version 1 has selectedInd = 'Y' AND deletedInd = 'Y' and policy 11 version 1 has selectedInd = 'Y' AND deletedInd = 'N'. The other 2 versions have selectedInd = 'N' AND deletedInd = 'Y'. End result should be Policy 22 version 1 has selectedInd = 'Y' AND deletedInd = 'N' and policy 11 version 1 has selectedInd = 'N' AND deletedInd = 'Y'.



<policy VERSION_NO="1" MC_ID="66">
<businessGroupCdGvngOrgn>14</businessGroupCdGvngOrgn>
<linesOfInsurance> <underlyingPolicy>
<PolicyNo>22</PolicyNo>
<deletedInd>Y</deletedInd>
<VersionNbr>2</VersionNbr>
<selectedInd>N</selectedInd>
<CategoryCd>GL</CategoryCd>
</underlyingPolicy>
<underlyingPolicy ID="5">
<PolicyNo>22</PolicyNo>
<deletedInd>Y</deletedInd>
<VersionNbr>1</VersionNbr>
<selectedInd>Y</selectedInd>
<CategoryCd>GL</CategoryCd>
</underlyingPolicy>
<underlyingPolicy ID="4">
<PolicyNo>11</PolicyNo>
<deletedInd>Y</deletedInd>
<VersionNbr>2</VersionNbr>
<selectedInd>N</selectedInd>
<CategoryCd>GL</CategoryCd>
</underlyingPolicy>
<underlyingPolicy ID="3">
<PolicyNo>11</PolicyNo>
<deletedInd>N</deletedInd>
<VersionNbr>1</VersionNbr>
<selectedInd>Y</selectedInd>
<CategoryCd>GL</CategoryCd>
</underlyingPolicy>
</linesOfInsurance>
</policy>
Expected O/P:

<AdaptikXML>
<PWResponse>
<ReturnCode>SUCCESS</ReturnCode>
<ReturnReasonCode>CHANGE</ReturnReasonCode>
<ReturnMessage/>
<PWData>
<policy VERSION_NO="1" MC_ID="66" ExtAction="U">
<linesOfInsurance ExtAction="U">
<underlyingPolicy ID="5" ExtAction="U">
<PolicyNo>22</PolicyNo>
<VersionNbr>1</VersionNbr>
<selectedInd>Y</selectedInd>
<deletedInd>N</deletedInd>
</underlyingPolicy>
<underlyingPolicy ID="3" ExtAction="U">
<PolicyNo>11</PolicyNo>
<VersionNbr>1</VersionNbr>
<selectedInd>N</selectedInd>
<deletedInd>Y</deletedInd>
</underlyingPolicy>
</linesOfInsurance>
</policy>
</PWData>
</PWResponse>
</AdaptikXML>
-___________________________________________________________________________________________


Test case 4 - 2 AL policies, 1 with 2 quote versions and 1 with 3. Policy 33 version 1 has selectedInd = 'Y' AND deletedInd = 'Y' and policy 44 version 2 has selectedInd = 'Y' AND deletedInd = 'Y'. End result should be Policy 33 version 1 and Policy 44 version 2 have selectedInd = 'Y' AND deletedInd = 'N'. Policy 33 version 2 and Policy 44 version 1 have selectedInd = 'N' AND deletedInd = 'Y'. Policy 44 version 3 stays unchanged (selectedInd = 'N' AND deletedInd = 'Y')



<policy VERSION_NO="1" MC_ID="55">
<businessGroupCdGvngOrgn>14</businessGroupCdGvngOrgn>
<linesOfInsurance>
<underlyingPolicy ID="7">
<PolicyNo>44</PolicyNo>
<deletedInd>Y</deletedInd>
<VersionNbr>3</VersionNbr>
<selectedInd>N</selectedInd>
<CategoryCd>AL</CategoryCd>
</underlyingPolicy>
<underlyingPolicy>
<PolicyNo>44</PolicyNo>
<deletedInd>Y</deletedInd>
<VersionNbr>2</VersionNbr>
<selectedInd>Y</selectedInd>
<CategoryCd>AL</CategoryCd>
</underlyingPolicy>
<underlyingPolicy ID="5">
<PolicyNo>44</PolicyNo>
<deletedInd>N</deletedInd>
<VersionNbr>1</VersionNbr>
<selectedInd>Y</selectedInd>
<CategoryCd>AL</CategoryCd>
</underlyingPolicy>
<underlyingPolicy ID="4">
<PolicyNo>33</PolicyNo>
<deletedInd>N</deletedInd>
<VersionNbr>2</VersionNbr>
<selectedInd>Y</selectedInd>
<CategoryCd>AL</CategoryCd>
</underlyingPolicy>
<underlyingPolicy ID="3">
<PolicyNo>33</PolicyNo>
<deletedInd>Y</deletedInd>
<VersionNbr>1</VersionNbr>
<selectedInd>Y</selectedInd>
<CategoryCd>AL</CategoryCd>
</underlyingPolicy>
</linesOfInsurance>
</policy>
EXPECTED o/p:

<AdaptikXML>
<PWResponse>
<ReturnCode>SUCCESS</ReturnCode>
<ReturnReasonCode>CHANGE</ReturnReasonCode>
<ReturnMessage/>
<PWData>
<policy VERSION_NO="1" MC_ID="55" ExtAction="U">
<linesOfInsurance ExtAction="U">
<underlyingPolicy ExtAction="U">
<PolicyNo>44</PolicyNo>
<VersionNbr>2</VersionNbr>
<selectedInd>Y</selectedInd>
<deletedInd>N</deletedInd>
</underlyingPolicy>
<underlyingPolicy ID="5" ExtAction="U">
<PolicyNo>44</PolicyNo>
<VersionNbr>1</VersionNbr>
<selectedInd>N</selectedInd>
<deletedInd>Y</deletedInd>
</underlyingPolicy>
<underlyingPolicy ID="4" ExtAction="U">
<PolicyNo>33</PolicyNo>
<VersionNbr>2</VersionNbr>
<selectedInd>N</selectedInd>
<deletedInd>Y</deletedInd>
</underlyingPolicy>
<underlyingPolicy ID="3" ExtAction="U">
<PolicyNo>33</PolicyNo>
<VersionNbr>1</VersionNbr>
<selectedInd>Y</selectedInd>
<deletedInd>N</deletedInd>
</underlyingPolicy>
</linesOfInsurance>
</policy>
</PWData>
</PWResponse>
</AdaptikXML>


Test case 5 - End result should be Policy 22 version 1 has selectedInd = 'Y' AND deletedInd = 'N' and policy 11 version 1 has selectedInd = 'N' AND deletedInd = 'Y'. Policy 33 version 1 and Policy 44 version 2 have selectedInd = 'Y' AND deletedInd = 'N'. Policy 33 version 2 and Policy 44 version 1 have selectedInd = 'N' AND deletedInd = 'Y'.



<policy VERSION_NO="1" MC_ID="89">
<businessGroupCdGvngOrgn>14</businessGroupCdGvngOrgn>
<linesOfInsurance>
<underlyingPolicy ID="10">
<PolicyNo>44</PolicyNo>
<deletedInd>Y</deletedInd>
<VersionNbr>2</VersionNbr>
<selectedInd>Y</selectedInd>
<CategoryCd>AL</CategoryCd>
</underlyingPolicy>
<underlyingPolicy ID="9">
<PolicyNo>44</PolicyNo>
<deletedInd>N</deletedInd>
<VersionNbr>1</VersionNbr>
<selectedInd>Y</selectedInd>
<CategoryCd>AL</CategoryCd>
</underlyingPolicy>
<underlyingPolicy ID="8">
<PolicyNo>33</PolicyNo>
<deletedInd>N</deletedInd>
<VersionNbr>2</VersionNbr>
<selectedInd>Y</selectedInd>
<CategoryCd>AL</CategoryCd>
</underlyingPolicy>
<underlyingPolicy ID="7">
<PolicyNo>33</PolicyNo>
<deletedInd>Y</deletedInd>
<VersionNbr>1</VersionNbr>
<selectedInd>Y</selectedInd>
<CategoryCd>AL</CategoryCd>
</underlyingPolicy>
<underlyingPolicy>
<PolicyNo>22</PolicyNo>
<deletedInd>Y</deletedInd>
<VersionNbr>2</VersionNbr>
<selectedInd>N</selectedInd>
<CategoryCd>GL</CategoryCd>
</underlyingPolicy>
<underlyingPolicy ID="5">
<PolicyNo>22</PolicyNo>
<deletedInd>Y</deletedInd>
<VersionNbr>1</VersionNbr>
<selectedInd>Y</selectedInd>
<CategoryCd>GL</CategoryCd>
</underlyingPolicy>
<underlyingPolicy ID="4">
<PolicyNo>11</PolicyNo>
<deletedInd>Y</deletedInd>
<VersionNbr>2</VersionNbr>
<selectedInd>N</selectedInd>
<CategoryCd>GL</CategoryCd>
</underlyingPolicy>
<underlyingPolicy ID="3">
<PolicyNo>11</PolicyNo>
<deletedInd>N</deletedInd>
<VersionNbr>1</VersionNbr>
<selectedInd>Y</selectedInd>
<CategoryCd>GL</CategoryCd>
</underlyingPolicy>
</linesOfInsurance>
</policy>


EXPECTED O/P:



<AdaptikXML>
<PWResponse>
<ReturnCode>SUCCESS</ReturnCode>
<ReturnReasonCode>CHANGE</ReturnReasonCode>
<ReturnMessage/>
<PWData>
<policy VERSION_NO="1" MC_ID="89" ExtAction="U">
<linesOfInsurance ExtAction="U">
<underlyingPolicy ID="5" ExtAction="U">
<PolicyNo>22</PolicyNo>
<VersionNbr>1</VersionNbr>
<selectedInd>Y</selectedInd>
<deletedInd>N</deletedInd>
</underlyingPolicy>
<underlyingPolicy ID="3" ExtAction="U">
<PolicyNo>11</PolicyNo>
<VersionNbr>1</VersionNbr>
<selectedInd>N</selectedInd>
<deletedInd>Y</deletedInd>
</underlyingPolicy>
<underlyingPolicy ID="10" ExtAction="U">
<PolicyNo>44</PolicyNo>
<VersionNbr>2</VersionNbr>
<selectedInd>Y</selectedInd>
<deletedInd>N</deletedInd>
</underlyingPolicy>
<underlyingPolicy ID="9" ExtAction="U">
<PolicyNo>44</PolicyNo>
<VersionNbr>1</VersionNbr>
<selectedInd>N</selectedInd>
<deletedInd>Y</deletedInd>
</underlyingPolicy>
<underlyingPolicy ID="8" ExtAction="U">
<PolicyNo>33</PolicyNo>
<VersionNbr>2</VersionNbr>
<selectedInd>N</selectedInd>
<deletedInd>Y</deletedInd>
</underlyingPolicy>
<underlyingPolicy ID="7" ExtAction="U">
<PolicyNo>33</PolicyNo>
<VersionNbr>1</VersionNbr>
<selectedInd>Y</selectedInd>
<deletedInd>N</deletedInd>
</underlyingPolicy>
</policy>
</PWData>
</PWResponse>
</AdaptikXML>

No comments:

Post a Comment