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
  • 0
    Certified Senior Developer

    Hi ,

    Create a query rule with doc_sent <> 1 and call it in a Script Task to store results in pv!caseList (List of CDT with caseId and folderId). Use a sub-process with MNI to handle one case at a time. Inside the sub-process, extract caseId and folderId, create an SFTP folder named clientname_caseId, fetch documents using folder(pv!folderId, "documentChildren"), and upload them using SFTP Send File. After successful upload, update doc_sent = 1 in the database. If the list is large, avoid hitting MNI limits by using paging or batching.

Reply
  • 0
    Certified Senior Developer

    Hi ,

    Create a query rule with doc_sent <> 1 and call it in a Script Task to store results in pv!caseList (List of CDT with caseId and folderId). Use a sub-process with MNI to handle one case at a time. Inside the sub-process, extract caseId and folderId, create an SFTP folder named clientname_caseId, fetch documents using folder(pv!folderId, "documentChildren"), and upload them using SFTP Send File. After successful upload, update doc_sent = 1 in the database. If the list is large, avoid hitting MNI limits by using paging or batching.

Children