Manually kickstarting a deployment
The framework has a table called
BLC_PROCESS_STATUS this table is used to keep track of the workflow of a change set along with the
BLC_SNDBX_WRKFLW_EVENT.SETUP_STATUS column. The ProcessStatus is the process that will follow up and check the
SETUP_STATUS(increments from 100, 200, etc.) to make sure a change set is followed through to completion. However, there are times where this process will end due to an unexpected error on the server. This will leave the entity "stuck" but we can have the framework retry by inserting a new record in this table.
To manually kickstart a deployment you can do the following.
select dep.WORKFLOW_DEPLOYMENT_ID, dep.STATUS, dep.DEPLOY_DATE, ev.ACTION_TYPE, ev.SETUP_STATUS, wrkitem.WRKFLW_SNDBX_ITEM_ID, wrkitem.GRP_DESCRIPTION, wrkitem.SCHEDULED_DATE, wrkitem.ARCHIVED_FLAG, wrkitem.CONTAINER_ID from BLC_SNDBX_WRKFLW_DEPLOY dep inner join BLC_SNDBX_WRKFLW_EVENT ev on ev.WORKFLOW_DEPLOY_ID = dep.WORKFLOW_DEPLOYMENT_ID inner join BLC_SNDBX_WRKFLW_EVENT_ITEM evitem on evitem.EVENT_ID = ev.WORKFLOW_EVENT_ID inner join BLC_SNDBX_WRKFLW_ITEM wrkitem on wrkitem.WRKFLW_SNDBX_ITEM_ID = evitem.ITEM_ID where (dep.STATUS = 'PENDING' or dep.STATUS = 'IN_PROCESS')
Once you have that, you can insert them into the process status table which will allow the system to continue on with them. For example, in this case, if we had 2 deployments in PENDING or IN_PROCESS, we would take the IDs (let's say we got got the 15880 and 15931 for IDs) and insert process status records. We want to check first to make sure they don't already exist (in this case -100 and -101) and if they don't, we insert them.
select * from BLC_PROCESS_STATUS where PROCESS_STATUS_ID in (-100, -101);
Once we verify it we can insert the records the following records:
INSERT INTO blc_process_status (PROCESS_STATUS_ID, DESCRIPTION, EXECUTION_ID, EXECUTION_TYPE, FRIENDLY_NAME, IS_ARCHIVED, IS_PAUSED, LAST_UPDATED, NAME, PERCENT_COMPLETE, PROCESS_ID, VERSION) VALUES (-100, NULL, 15880, 'APPROVAL_PROCESS_TYPE', NULL, NULL, NULL, '2018-08-06 08:40:21:000', 'SCHEDULED_DEPLOY', NULL, -100, 1); INSERT INTO blc_process_status (PROCESS_STATUS_ID, DESCRIPTION, EXECUTION_ID, EXECUTION_TYPE, FRIENDLY_NAME, IS_ARCHIVED, IS_PAUSED, LAST_UPDATED, NAME, PERCENT_COMPLETE, PROCESS_ID, VERSION) VALUES (-101, NULL, 15931, 'APPROVAL_PROCESS_TYPE', NULL, NULL, NULL, '2018-08-06 08:40:21:000', 'SCHEDULED_DEPLOY', NULL, -101, 1);