Removed exception handling from invitation patch.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@14809 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Mark Rogers
2009-06-19 14:50:58 +00:00
parent 7b1fdf1d2f
commit ceb954c0f1

View File

@@ -31,6 +31,8 @@ import java.util.Map;
import org.alfresco.i18n.I18NUtil;
import org.alfresco.repo.admin.patch.AbstractPatch;
import org.alfresco.repo.invitation.InvitationServiceImpl;
import org.alfresco.service.cmr.workflow.WorkflowDefinition;
import org.alfresco.repo.invitation.WorkflowModelNominatedInvitation;
import org.alfresco.repo.invitation.site.AcceptInviteAction;
import org.alfresco.repo.security.authentication.AuthenticationUtil;
@@ -114,33 +116,22 @@ public class InvitationMigrationPatch extends AbstractPatch
@Override
protected String applyInternal() throws Exception
{
List<WorkflowInstance> currentInstances = null;
try
WorkflowDefinition def = workflowService.getDefinitionByName(OldInviteModel.WORKFLOW_DEFINITION_NAME);
if(def != null)
{
// Get the process properties.
currentInstances = workflowService.getActiveWorkflows(OldInviteModel.WF_PROCESS_INVITE.toPrefixString());
}
catch (WorkflowException we)
{
logger.debug("no invites to cancel" , we);
String msg = I18NUtil.getMessage(MSG_NO_INVITES);
return msg;
}
List<WorkflowInstance> currentInstances = workflowService.getActiveWorkflows(def.getId());
int count = 0;
for(WorkflowInstance oldInstance : currentInstances)
{
String oldWorkflowId = oldInstance.id;
try
{
convertOldInvite(oldWorkflowId);
}
catch (Exception e)
{
// swallow error - a lost invitation is not a show stopper
logger.error("unable to re-invite oldInstance:" + oldWorkflowId, e);
}
// Cancel the old workflow instance
workflowService.cancelWorkflow(oldWorkflowId);
@@ -152,6 +143,13 @@ public class InvitationMigrationPatch extends AbstractPatch
String msg = I18NUtil.getMessage(MSG_SUCCESS, count);
return msg;
}
else
{
logger.debug("no invites to cancel");
String msg = I18NUtil.getMessage(MSG_NO_INVITES);
return msg;
}
}
public void setWorkflowService(WorkflowService workflowService)
{