This commit is contained in:
N Smith
2011-09-06 15:05:59 +00:00
parent ee3c402701
commit 6fccccb72a
12 changed files with 611 additions and 585 deletions

View File

@@ -273,12 +273,12 @@ public class InvitationServiceImpl implements InvitationService, NodeServicePoli
{
WorkflowTask startTask = getStartTask(invitationId);
NominatedInvitation invitation = getNominatedInvitation(startTask);
if (invitation == null)
if(invitation == null)
{
throw new InvitationException("State error, accept may only be called on a nominated invitation.");
}
// Check invitationId and ticket match
if (invitation.getTicket().equals(ticket)==false)
if(invitation.getTicket().equals(ticket)==false)
{
//TODO localise msg
String msg = "Response to invite has supplied an invalid ticket. The response to the invitation could thus not be processed";
@@ -293,12 +293,12 @@ public class InvitationServiceImpl implements InvitationService, NodeServicePoli
private void endInvitation(WorkflowTask startTask, String transition, Map<QName, Serializable> properties, QName... taskTypes )
{
List<WorkflowTask> tasks = workflowService.getTasksForWorkflowPath(startTask.getPath().getId());
if (tasks.size()==1)
if(tasks.size()==1)
{
WorkflowTask task = tasks.get(0);
if (taskTypeMatches(task, taskTypes))
if(taskTypeMatches(task, taskTypes))
{
if (properties != null)
if(properties != null)
{
workflowService.updateTask(task.getId(), properties, null, null);
}
@@ -321,7 +321,7 @@ public class InvitationServiceImpl implements InvitationService, NodeServicePoli
{
WorkflowTask startTask = getStartTask(invitationId);
ModeratedInvitation invitation = getModeratedInvitation(startTask);
if (invitation == null)
if(invitation == null)
{
String msg = "State error, can only call approve on a Moderated invitation.";
throw new InvitationException(msg);
@@ -349,7 +349,7 @@ public class InvitationServiceImpl implements InvitationService, NodeServicePoli
public Invitation reject(String invitationId, String reason)
{
WorkflowTask startTask = getStartTask(invitationId);
if (taskTypeMatches(startTask, WorkflowModelModeratedInvitation.WF_START_TASK))
if(taskTypeMatches(startTask, WorkflowModelModeratedInvitation.WF_START_TASK))
{
return rejectModeratedInvitation(startTask, reason);
}
@@ -392,7 +392,7 @@ public class InvitationServiceImpl implements InvitationService, NodeServicePoli
public Invitation cancel(String invitationId)
{
WorkflowTask startTask = getStartTask(invitationId);
if (taskTypeMatches(startTask, WorkflowModelModeratedInvitation.WF_START_TASK))
if(taskTypeMatches(startTask, WorkflowModelModeratedInvitation.WF_START_TASK))
{
return cancelModeratedInvitation(startTask);
}
@@ -445,7 +445,7 @@ public class InvitationServiceImpl implements InvitationService, NodeServicePoli
private Invitation getInvitation(WorkflowTask startTask)
{
Invitation invitation = getNominatedInvitation(startTask);
if (invitation == null)
if(invitation == null)
{
invitation = getModeratedInvitation(startTask);
}
@@ -576,12 +576,12 @@ public class InvitationServiceImpl implements InvitationService, NodeServicePoli
return false;
}
String inviter = criteria.getInviter();
if (inviter!= null)
if(inviter!= null)
{
if (invitation instanceof NominatedInvitation)
{
NominatedInvitation modInvite = (NominatedInvitation) invitation;
if(inviter.equals(modInvite.getInviterUserName()))
if(false == inviter.equals(modInvite.getInviterUserName()))
{
return false;
}
@@ -627,20 +627,20 @@ public class InvitationServiceImpl implements InvitationService, NodeServicePoli
// query for invite workflow tasks
List<WorkflowTask> results = new ArrayList<WorkflowTask>();
if (workflowAdminService.isEngineEnabled(JBPMEngine.ENGINE_ID))
if(workflowAdminService.isEngineEnabled(JBPMEngine.ENGINE_ID))
{
query.setTaskName(WorkflowModelModeratedInvitation.WF_REVIEW_TASK);
List<WorkflowTask> jbpmTasks = this.workflowService.queryTasks(query);
if (jbpmTasks != null)
if(jbpmTasks !=null)
{
results.addAll(jbpmTasks);
}
}
if (workflowAdminService.isEngineEnabled(ActivitiConstants.ENGINE_ID))
if(workflowAdminService.isEngineEnabled(ActivitiConstants.ENGINE_ID))
{
query.setTaskName(WorkflowModelModeratedInvitation.WF_ACTIVITI_REVIEW_TASK);
List<WorkflowTask> jbpmTasks = this.workflowService.queryTasks(query);
if (jbpmTasks != null)
if(jbpmTasks !=null)
{
results.addAll(jbpmTasks);
}
@@ -654,7 +654,7 @@ public class InvitationServiceImpl implements InvitationService, NodeServicePoli
query.setTaskState(WorkflowTaskState.IN_PROGRESS);
String invitee = criteria.getInvitee();
if (invitee != null)
if(invitee != null)
{
query.setActorId(invitee);
}
@@ -682,20 +682,20 @@ public class InvitationServiceImpl implements InvitationService, NodeServicePoli
query.setProcessCustomProps(queryProps);
List<WorkflowTask> results = new ArrayList<WorkflowTask>();
if (workflowAdminService.isEngineEnabled(JBPMEngine.ENGINE_ID))
if(workflowAdminService.isEngineEnabled(JBPMEngine.ENGINE_ID))
{
query.setTaskName(WorkflowModelNominatedInvitation.WF_TASK_INVITE_PENDING);
List<WorkflowTask> jbpmTasks = this.workflowService.queryTasks(query);
if (jbpmTasks != null)
if(jbpmTasks !=null)
{
results.addAll(jbpmTasks);
}
}
if (workflowAdminService.isEngineEnabled(ActivitiConstants.ENGINE_ID))
if(workflowAdminService.isEngineEnabled(ActivitiConstants.ENGINE_ID))
{
query.setTaskName(WorkflowModelNominatedInvitation.WF_TASK_ACTIVIT_INVITE_PENDING);
List<WorkflowTask> jbpmTasks = this.workflowService.queryTasks(query);
if (jbpmTasks != null)
if(jbpmTasks !=null)
{
results.addAll(jbpmTasks);
}
@@ -1180,29 +1180,27 @@ public class InvitationServiceImpl implements InvitationService, NodeServicePoli
private String getNominatedDefinitionName()
{
if (workflowAdminService.isEngineEnabled(ActivitiConstants.ENGINE_ID))
if(workflowAdminService.isEngineEnabled(ActivitiConstants.ENGINE_ID))
{
return WorkflowModelNominatedInvitation.WORKFLOW_DEFINITION_NAME_ACTIVITI;
}
else if (workflowAdminService.isEngineEnabled(JBPMEngine.ENGINE_ID))
else if(workflowAdminService.isEngineEnabled(JBPMEngine.ENGINE_ID))
{
return WorkflowModelNominatedInvitation.WORKFLOW_DEFINITION_NAME;
}
throw new IllegalStateException("None of the Workflow engines supported by teh InvitationService are currently enabled!");
}
private String getModeratedDefinitionName()
{
if (workflowAdminService.isEngineEnabled(ActivitiConstants.ENGINE_ID))
if(workflowAdminService.isEngineEnabled(ActivitiConstants.ENGINE_ID))
{
return WorkflowModelModeratedInvitation.WORKFLOW_DEFINITION_NAME_ACTIVITI;
}
else if (workflowAdminService.isEngineEnabled(JBPMEngine.ENGINE_ID))
else if(workflowAdminService.isEngineEnabled(JBPMEngine.ENGINE_ID))
{
return WorkflowModelModeratedInvitation.WORKFLOW_DEFINITION_NAME;
}
throw new IllegalStateException("None of the Workflow engines supported by teh InvitationService are currently enabled!");
}