Hi,
I have a problem with a document list that contains document lists in each index. Each document has a value structured like this:
<RandomRec>
<RandomInfo>
<Code></Code>
<IntegrationType></IntegrationType>
<StmtBankCode></StmtBankCode>
<Website></Website>
<Email></Email>
<Phone></Phone>
</RandomInfo>
<RandomName>
<EnShortName></EnShortName>
<ArShortName></ArShortName>
<EnName></EnName>
<ArName></ArName>
</RandomName>
<RandomCategory>
<EnShortName></EnShortName>
<ArShortName></ArShortName>
<EnName></EnName>
<ArName></ArName>
</RandomCategory>
<RandomServices>
<RandomService>
<ServiceInfo>
<Code></Code>
<Type></Type>
<EnShortDesc></EnShortDesc>
<ArShortDesc></ArShortDesc>
<EnDesc></EnDesc>
<ArDesc></ArDesc>
<PaymentType>prepaid</PaymentType>
</ServiceInfo>
<BillingInfo>
<EnShortDesc></EnShortDesc>
<ArShortDesc></ArShortDesc>
<EnDesc></EnDesc>
<ArDesc></ArDesc>
</BillingInfo>
</RandomService>
<RandomService>
<ServiceInfo>
<Code></Code>
<Type></Type>
<EnShortDesc></EnShortDesc>
<ArShortDesc></ArShortDesc>
<EnDesc></EnDesc>
<ArDesc></ArDesc>
<PaymentType>Postpaid</PaymentType>
</ServiceInfo>
<BillingInfo>
<EnShortDesc></EnShortDesc>
<ArShortDesc></ArShortDesc>
<EnDesc></EnDesc>
<ArDesc></ArDesc>
</BillingInfo>
</RandomService>
</RandomServices>
</RandomRec>
In this structure, the RandomRec
is the parent document, and it has children such as RandomInfo
, RandomName
, RandomCategory
, and RandomServices
. Each document has a variable.
You want to divide the list into two categories based on the PaymentType
defined in RandomRec -> RandomServices -> RandomService -> ServiceInfo -> PaymentType
. If the user enters “postpaid,” you need to return the records that contain “postpaid”; otherwise, return the records that contain “prepaid”
please advise me whether the solution java code or flow service .
Thank you .