Deploy BPMNs with multiple DFSP-IDs

  • The Payment Hub EE business logic is always driven by the BPMN workflows included in the git repositories. It's not only possible but often necessary to customize these flows to meet the business requirements of a specific environment.

  • Deploying the workflows to the K8S cluster is a separate step, which can be done either manually for each business flow, or using a shell script like this (actual example from the project's CI server):

  • In the below example tenants are picked up from the array declared and for N number of tenants the script will run for N number of times and Internal field separator will convert array into string and store in $t.

  • Zeebe command line tools (the zbctl binary) are also required for deploying the BPMN workflows if Zeebe Operations service is not deployed. This is part of the Zeebe releases and can be downloaded from the Zeebe release page at https://github.com/zeebe-io/zeebe/releases .

  • BPMN deployment should be done with corresponding release version which can be obtained from release notes

  • In the below script HOST should be replaced with the zeebe ops(port-forwarded) url from your cluster.

Copy

#!/bin/sh HOST="https://zeebeops.sandbox.fynarfin.io/zeebe/upload" deploy(){ cmd="curl --insecure --location --request POST $HOST \ --header 'Platform-TenantId: $2' \ --form 'file=@\"$PWD/$1\"'" echo $cmd eval $cmd # If curl response is not 200, it should fail the eval cmd } TENANTS="gorilla,lion,rhino" IFS=',' read -ra TENANT_ARRAY <<< "$TENANTS" for t in "${TENANT_ARRAY[@]}"; do LOC="orchestration/feel/*.bpmn" for f in $LOC; do # Check if "DFSPID" is present in the filename if echo "$f" | grep -q "DFSPID"; then # Replace "DFSPID" with the current tenant value in the filename new_file_name=$(echo "$f" | sed "s/DFSPID/$t/") else # If "DFSPID" is not present, use the original name new_file_name="$f" fi deploy "$new_file_name" "$t" done LOC2="orchestration/feel/example/*.bpmn" for f in $LOC2; do # Check if "DFSPID" is present in the filename if echo "$f" | grep -q "DFSPID"; then # Replace "DFSPID" with the current tenant value in the filename new_file_name=$(echo "$f" | sed "s/DFSPID/$t/") else # If "DFSPID" is not present, use the original name new_file_name="$f" fi deploy "$new_file_name" "$t" done done