Skip to content

Commit

Permalink
feat: two-way communication workflow can be configured to send a nore…
Browse files Browse the repository at this point in the history
…ply email when target case is already closed
  • Loading branch information
MLenterman committed Aug 23, 2024
1 parent 9c368c0 commit bb86500
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 1 deletion.
1 change: 1 addition & 0 deletions docker-compose.zaakbrug.dev.utrecht.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ services:
- TZ=Europe/Amsterdam
- openforms2bpel.workflows.tweewegcommunicatie.on-case-not-found.mail-template=unable-to-add-document-to-case-default
- openforms2bpel.workflows.tweewegcommunicatie.on-subject-not-equals-case-subject.mail-template=unable-to-add-document-to-case-default
- openforms2bpel.workflows.tweewegcommunicatie.on-case-closed.mail-template=unable-to-add-document-to-case-default
- openforms2bpel.workflows.formdata-collector-stylesheet-file=bpel/Common/xsl/FormDataCollector_ObjectsApi_Custom.xslt
- openforms2bpel.workflows.formdata-transform-stylesheet-file=bpel/Common/xsl/FormDataTransform_Custom.xslt
volumes:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<Forward name="success" path="UwGegevensMissing_Condition" />
</PutInSessionPipe>

<!-- UwGegevensMissing - Start -->
<XmlIfPipe
name="UwGegevensMissing_Condition"
xpathExpression="string-length(//*[starts-with(name(), 'uw-gegevens')]) = 0"
Expand All @@ -49,6 +50,7 @@
</XmlIfPipe>

<ExceptionPipe name="UwGegevensMissing_Exception" />
<!-- UwGegevensMissing - End-->

<XsltPipe
name="FilterUwGegevensSection"
Expand All @@ -58,6 +60,7 @@
<Forward name="success" path="UwGegevensSubjectUnauthenticated_Condition" />
</XsltPipe>

<!-- UwGegevensSubjectUnauthenticated - Start -->
<XmlIfPipe
name="UwGegevensSubjectUnauthenticated_Condition"
xpathExpression="not(//*[starts-with(name(), 'uw-gegevens')]/*/*[ends-with(name(), 'MD')] or //*[starts-with(name(), 'uw-gegevens')]/*/*[ends-with(name(), 'MEH')])"
Expand All @@ -67,6 +70,7 @@
</XmlIfPipe>

<ExceptionPipe name="UwGegevensSubjectUnauthenticated_Exception" />
<!-- UwGegevensSubjectUnauthenticated - End -->

<XsltPipe
name="CreateLookUpCaseIdsRequestMessage"
Expand All @@ -91,6 +95,7 @@
<Forward name="success" path="CaseNotFound_Condition" />
</SenderPipe>

<!-- CaseNotFound - Start -->
<XmlIfPipe
name="CaseNotFound_Condition"
xpathExpression="string-length(//*:lookUpCaseIdsResponse/*:caseIdMessage/*:cases/*:case) gt 0"
Expand Down Expand Up @@ -135,6 +140,7 @@
</SenderPipe>

<ExceptionPipe name="CaseNotFound_Exception" />
<!-- CaseNotFound - End -->

<XsltPipe
name="CreateReadCasesRequestMessage"
Expand All @@ -159,6 +165,7 @@
<Forward name="success" path="CheckForUwGegevensIsPerson" />
</SenderPipe>

<!-- SubjectNotEqualsCaseSubject - Start -->
<XmlIfPipe
name="CheckForUwGegevensIsPerson"
getInputFromSessionKey="UwGegevens"
Expand Down Expand Up @@ -201,7 +208,7 @@
>
<Param name="UwGegevensSubject" sessionKey="UwGegevensSubject" />
<Param name="CaseInitiatingSubject" sessionKey="CaseInitiatingSubject" />
<Forward name="then" path="CreateAddDocumentsToCaseCommand" />
<Forward name="then" path="CaseClosed_Condition" />
<Forward name="else" path="SubjectNotEqualsCaseSubject_MailCondition" />
</XmlIfPipe>

Expand Down Expand Up @@ -241,6 +248,55 @@
</SenderPipe>

<ExceptionPipe name="SubjectNotEqualsCaseSubject_Exception" />
<!-- SubjectNotEqualsCaseSubject - End -->

<!-- CaseClosed - Start -->
<XmlIfPipe
name="CaseClosed_Condition"
getInputFromSessionKey="ReadCasesResponseMessage"
xpathExpression="//*:readCasesResponse/*:caseDetailsMessage/*:cases/*:case/*:endDate != ''"
>
<Forward name="then" path="CaseClosed_MailCondition" />
<Forward name="else" path="CreateAddDocumentsToCaseCommand" />
</XmlIfPipe>

<XmlIfPipe
name="CaseClosed_MailCondition"
xpathExpression="string-length('${openforms2bpel.workflows.tweewegcommunicatie.on-case-closed.mail-template}') gt 0"
>
<Forward name="then" path="CaseClosed_StoreMailTemplateName" />
<Forward name="else" path="CaseClosed_Exception" />
</XmlIfPipe>

<PutInSessionPipe
name="CaseClosed_StoreMailTemplateName"
>
<Param name="TemplateName" value="${openforms2bpel.workflows.tweewegcommunicatie.on-case-closed.mail-template}" />
<Forward name="success" path="CaseClosed_SendNoReplyUserEmailCommand" />
</PutInSessionPipe>

<SenderPipe
name="CaseClosed_SendNoReplyUserEmailCommand"
getInputFromSessionKey="UwGegevens"
transactionAttribute="Required"
>
<MessageStoreSender
name="CaseClosed_SendNoReplyUserEmailCommandMessageStoreSender"
slotId="${instance.name}/SendNoReplyUserEmailCommand"
sessionKeys="TemplateName"
onlyStoreWhenMessageIdUnique="true"
transacted="true"
>
<Param name="messageId" xpathExpression="concat($CaseReferenceNumber, '-', $TargetCaseReferenceNumber)">
<Param name="TargetCaseReferenceNumber" sessionKey="CaseReferenceNumber" />
<Param name="CaseReferenceNumber" sessionKey="originalMessage" xpathExpression="/ZgwObject/public_reference" />
</Param>
</MessageStoreSender>
<Forward name="success" path="EXIT" />
</SenderPipe>

<ExceptionPipe name="CaseClosed_Exception" />
<!-- CaseClosed - End -->

<XsltPipe
name="CreateAddDocumentsToCaseCommand"
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/DeploymentSpecifics.properties
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ openforms2bpel.noreply-smtp.mail-templates-file=MailTemplates.xml

openforms2bpel.workflows.tweewegcommunicatie.on-case-not-found.mail-template=
openforms2bpel.workflows.tweewegcommunicatie.on-subject-not-equals-case-subject.mail-template=
openforms2bpel.workflows.tweewegcommunicatie.on-case-closed.mail-template=

openforms2bpel.workflows.auto-retry.cron-expression=0 0/30 * * * ?
openforms2bpel.workflows.auto-retry.max-retries=5
Expand Down

0 comments on commit bb86500

Please sign in to comment.