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.

  • 0
    Certified Associate Developer
    in reply to Srinivas M

    Thank you for the response  How can I create a custom name for folder that needs to be created in "SFTP Create Folder" Smart Service? Once I have the pv!folderid, do I need to create another script task and concatenate these both clientname_caseId, and save in a different output? Also, how can I pass this folder name to "SFTP Create Folder" smart service as in which configuration can this value be passed? please advise. 

  • 0
    Certified Senior Developer
    in reply to manam

    Yes, create a Script Task before the SFTP Create Folder node to build pv!sftpFolderName using:
    "clientname_" & pv!caseId
    Then pass pv!sftpFolderName to the remoteDirectoryPath input of the SFTP Create Folder smart service.

Reply Children
No Data