for ( Map<String, Object> result : results ) {
String oldWorkflowId = (String) result.get( "local_inode" );
String newWorkflowId = (String) result.get( "remote_inode" );
WorkflowCache workflowCache = CacheLocator.getWorkFlowCache();
//Verify if the workflow is the default one
WorkflowScheme defaultScheme = workflowCache.getDefaultScheme();
if ( defaultScheme != null && defaultScheme.getId().equals( oldWorkflowId ) ) {
CacheLocator.getCacheAdministrator().remove( workflowCache.defaultKey, workflowCache.getPrimaryGroup() );
} else {
//Clear the cache
WorkflowScheme scheme = workflowCache.getScheme( oldWorkflowId );
workflowCache.remove( scheme );
}
// THIS IS THE NEW CODE
// 1) Insert dummy temp row on WORKFLOW_SCHEME table