create folder to send documents

Certified Associate Developer

Hi All, 

Please advise how do I write a Query rule to fetch case Id and folder id from database ?

Below is the query rule I've written to fetch the case Ids and folder Ids from database. How do I map this to a process Model?


a!queryEntity_22r2(
entity: cons!ABC_CASES,
query: a!query(
pagingInfo: a!pagingInfo(
startIndex: 1,
batchSize: -1,
)
),
selection: a!querySelection(
columns: {
a!queryColumn(field: "caseId"),
a!queryColumn(field: "folderId")
}
),
logicalExpression: a!queryLogicalExpression(
operator: "AND",
filters: {
a!queryFilter(
field: "caseId",
operator: "=",
value: ri!abc_cases.caseId,
applyWhen: not(
rule!APN_isBlank(ri!abc_cases.caseId)
)
),

)
}
)
)
)

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Lead Developer
    in reply to manam

    your output is having folder id and case id both right.You can use index() to extract the folder if and case id. 

    In your main process model call this rule and get the list of cases. then call a sub process (or start process smart service) using MNI. within this sub process you will be having one case and one folder at a time. within this sub process have the sftp smart service to send document for one case. Like wise depending on the number of cases that many sub process instances will trigger and docs will be transferred. 

    In above rule you have paging done as -1. See MNI usage considerations to verify if your output can reach the maximum activity instances limit permitted or else adjust the paging using loops in process model to get cases and folders in batches.