This document contains the steps to create new workflow configs specific to WS and SW modules for Bill Amendment.
Steps
Create the new Workflow configs in the same tenant-Id as the one you want to replace in the applications.
New configs for WS and SW bill amendment are as follows:
List all the states from the process instances of the old workflow(business service) config.
select uuid,state from eg_wf_state_v2 where businessserviceid=(select UUID from eg_wf_businessservice_v2 where businessservice='BS.AMENDMENT' and tenantid='pb');
uuid
state
94055bb3-210c-4184-93ac-99e288ab00d9
b0fc6007-8b02-4753-8e50-1fdb29e559da
APPROVALPENDING
b9ea9101-09ff-4a8e-97c1-d43b3311af73
REJECTED
ea5668ee-d8db-4c16-839b-64299e12f8fc
APPROVED
468ce854-e19d-4a0f-97a0-66745f2034af
PENDING_FOR_CITIZEN_ACTION
List the states from the new business service created for replacement using this query
SELECT UUID, state FROM eg_wf_state where businessService='WS.AMENDMENT' AND business='WS' AND tenantid='pb'
SELECT UUID, state FROM eg_wf_state where businessService='SW.AMENDMENT' AND business='SW' AND tenantid='pb'
uuid
state
New uuid
New uuid
APPROVALPENDING
New uuid
REJECTED
New uuid
APPROVED
New uuid
PENDING_FOR_CITIZEN_ACTION
Replace the state-ids of the old workflow in the eg_wf_processinstance table with stateids of the new workflow.
Write an update query (one for each state UUID) to rewrite the process-instance table, as shown above -
update eg_wf_processinstance_v2 set status={new state uuid} AND businessservice={WS.AMENDMENT} and modulename={WS} where businessservice={BS.AMENDMENT} and status={old state uuid} and businessid like '%WS%';
update eg_wf_processinstance_v2 set status={new state uuid} AND businessservice={SW.AMENDMENT} and modulename={SW} where businessservice={BS.AMENDMENT} and status={old state uuid} and businessid like '%SW%';
Note: businessid like '%SW% or businessid like '%WS% will be used depending on the New businessService that you are using. moduleName in the above query would take WS or SW in sync with the new businessService
The status and businessservice columns should be set to the new values from the newly created business-service master create based on the old status and id of the process-Instance.
Rename or delete the old business service (BS.AMENDMENT) to avoid any of the applications using it wrongly in future.
{update eg_wf_businessservice set businessservice='BS.AMENDMENT-deprecated' where businessservice='BS.AMENDMENT'}
UI/BACKEND will have to replace their configs to fetch the workflow configs for WS and SW.
Changes required from UI:
Bill Amendment Workflow _create and _update APIs - replace businessserviceBS.AMENDMENT with WS.AMENDMENT/SW.AMENDMENT and moduleNameBS with WS/SW as per the requirement.
Bill Amendment Inbox - replace businessserviceBS.AMENDMENT with WS.AMENDMENT/SW.AMENDMENT as per the requirement.