@Override public boolean equals(Object obj) { if ( this == obj ) return true; if ( obj == null ) return false; if ( !(obj instanceof Comment) ) return false; Comment other = (Comment) obj; if ( addedBy == null ) { if ( other.addedBy != null ) return false; } else if ( !addedBy.equals( other.addedBy ) ) return false; if ( addedAt == null ) { if ( other.addedAt != null ) return false; } else if ( addedAt.getTime() != other.addedAt.getTime() ) return false; if ( text == null ) { if ( other.text != null ) return false; } else if ( !text.equals( other.text ) ) return false; return true; }
@Override public boolean equals(Object obj) { if ( this == obj ) return true; if ( obj == null ) return false; if ( !(obj instanceof Attachment) ) return false; Attachment other = (Attachment) obj; if ( accessType == null ) { if ( other.accessType != null ) return false; } else if ( !accessType.equals( other.accessType ) ) return false; if ( attachedAt == null ) { if ( other.attachedAt != null ) return false; } else if ( attachedAt.getTime() != other.attachedAt.getTime() ) return false; if ( attachedBy == null ) { if ( other.attachedBy != null ) return false; } else if ( !attachedBy.equals( other.attachedBy ) ) return false; if ( size != other.size ) return false; if ( attachmentContentId != other.attachmentContentId ) return false; if ( contentType == null ) { if ( other.contentType != null ) return false; } else if ( !contentType.equals( other.contentType ) ) return false; if ( name == null ) { if ( other.name != null ) return false; } else if ( !name.equals( other.name ) ) return false; return true; }
@Override public boolean equals(Object obj) { if ( this == obj ) return true; if ( obj == null ) return false; if ( !(obj instanceof PeopleAssignments) ) return false; PeopleAssignments other = (PeopleAssignments) obj; if ( taskInitiator == null ) { if ( other.taskInitiator != null ) return false; } else if ( !taskInitiator.equals( other.taskInitiator ) ) return false; return CollectionUtils.equals( businessAdministrators, other.businessAdministrators ) && CollectionUtils.equals( excludedOwners, other.excludedOwners ) && CollectionUtils.equals( potentialOwners, other.potentialOwners ) && CollectionUtils.equals( recipients, other.recipients ) && CollectionUtils.equals( taskStakeholders, other.taskStakeholders ); }
public Void execute(Context cntxt) { TaskContext context = (TaskContext) cntxt; Task task = context.getTaskQueryService().getTaskInstanceById(taskId); User user = context.getTaskIdentityService().getUserById(userId); context.getTaskEvents().select(new AnnotationLiteral<BeforeTaskStoppedEvent>() {}).fire(task); boolean ownerAllowed = (task.getTaskData().getActualOwner() != null && task.getTaskData().getActualOwner().equals(user)); boolean adminAllowed = CommandsUtil.isAllowed(user, getGroupsIds(), task.getPeopleAssignments().getBusinessAdministrators()); if (!ownerAllowed && !adminAllowed) { String errorMessage = "The user" + user + "is not allowed to Start the task "+task.getId(); throw new PermissionDeniedException(errorMessage); } if (task.getTaskData().getStatus().equals(Status.InProgress)) { task.getTaskData().setStatus(Status.Reserved); } context.getTaskEvents().select(new AnnotationLiteral<AfterTaskStoppedEvent>() {}).fire(task); return null; }
public Void execute(Context cntxt) { TaskContext context = (TaskContext) cntxt; Task task = context.getTaskQueryService().getTaskInstanceById(taskId); User user = context.getTaskIdentityService().getUserById(userId); context.getTaskEvents().select(new AnnotationLiteral<BeforeTaskActivatedEvent>() { }).fire(task); boolean adminAllowed = CommandsUtil.isAllowed(user, getGroupsIds(), task.getPeopleAssignments().getBusinessAdministrators()); boolean ownerAllowed = (task.getTaskData().getActualOwner() != null && task.getTaskData().getActualOwner().equals(user)); if (!adminAllowed && !ownerAllowed) { String errorMessage = "The user" + user + "is not allowed to Start the task " + task.getId(); throw new PermissionDeniedException(errorMessage); } if (task.getTaskData().getStatus().equals(Status.Created)) { task.getTaskData().setStatus(Status.Ready); } context.getTaskEvents().select(new AnnotationLiteral<AfterTaskActivatedEvent>() { }).fire(task); return null; } }
}).fire(task); boolean ownerAllowed = (task.getTaskData().getActualOwner() != null && task.getTaskData().getActualOwner().equals(user)); if (!ownerAllowed) { String errorMessage = "The user" + user + "is not allowed to Start the task " + task.getId();
public Void execute(Context cntxt) { TaskContext context = (TaskContext) cntxt; Task task = context.getTaskQueryService().getTaskInstanceById(taskId); User user = context.getTaskIdentityService().getUserById(userId); context.getTaskEvents().select(new AnnotationLiteral<BeforeTaskCompletedEvent>() {}).fire(task); boolean operationAllowed = (task.getTaskData().getActualOwner() != null && task.getTaskData().getActualOwner().equals(user)); if (!operationAllowed) { String errorMessage = "The user" + user + "is not allowed to Start the task " + task.getId(); throw new PermissionDeniedException(errorMessage); } if (task.getTaskData().getStatus().equals(Status.InProgress)) { // CHeck for potential Owner allowed (decorator?) task.getTaskData().setStatus(Status.Completed); } if (data != null) { ContentData result = ContentMarshallerHelper.marshal((Object) data, null); Content content = new Content(); content.setContent(result.getContent()); context.getEm().persist(content); task.getTaskData().setOutput(content.getId(), result); } context.getTaskEvents().select(new AnnotationLiteral<AfterTaskCompletedEvent>() {}).fire(task); return null; } }
public Void execute(Context cntxt) { TaskContext context = (TaskContext) cntxt; Task task = context.getTaskQueryService().getTaskInstanceById(taskId); User user = context.getTaskIdentityService().getUserById(userId); context.getTaskEvents().select(new AnnotationLiteral<BeforeTaskReleasedEvent>() {}).fire(task); // CHeck for potential Owner allowed (decorator?) boolean ownerAllowed = (task.getTaskData().getActualOwner() != null && task.getTaskData().getActualOwner().equals(user)); boolean adminAllowed = isAllowed(user, getGroupsIds(), task.getPeopleAssignments().getBusinessAdministrators()); if (!ownerAllowed && !adminAllowed) { String errorMessage = "The user" + user + "is not allowed to Start the task "+task.getId(); throw new PermissionDeniedException(errorMessage); } if (task.getTaskData().getStatus().equals(Status.Reserved) || task.getTaskData().getStatus().equals(Status.InProgress)) { task.getTaskData().setStatus(Status.Ready); task.getTaskData().setActualOwner(null); } context.getTaskEvents().select(new AnnotationLiteral<AfterTaskReleasedEvent>() {}).fire(task); return null; }
boolean ownerAllowed = (task.getTaskData().getActualOwner() != null && task.getTaskData().getActualOwner().equals(user)); if (!adminAllowed && !potOwnerAllowed && !ownerAllowed) { String errorMessage = "The user" + user + "is not allowed to Start the task " + task.getId();
boolean adminAllowed = CommandsUtil.isAllowed(user, getGroupsIds(), task.getPeopleAssignments().getBusinessAdministrators()); boolean potOwnerAllowed = CommandsUtil.isAllowed(user, getGroupsIds(), task.getPeopleAssignments().getPotentialOwners()); boolean ownerAllowed = (task.getTaskData().getActualOwner() != null && task.getTaskData().getActualOwner().equals(user));
boolean adminAllowed = CommandsUtil.isAllowed(user, getGroupsIds(), task.getPeopleAssignments().getBusinessAdministrators()); boolean initiatorAllowed = (task.getTaskData().getCreatedBy() != null && (task.getTaskData().getCreatedBy().equals(user))); boolean potOwnerAllowed = CommandsUtil.isAllowed(user, getGroupsIds(), task.getPeopleAssignments().getPotentialOwners()); boolean ownerAllowed = (task.getTaskData().getActualOwner() != null && task.getTaskData().getActualOwner().equals(user)); if (!adminAllowed && !potOwnerAllowed && !initiatorAllowed && !ownerAllowed) { String errorMessage = "The user" + user + "is not allowed to Start the task " + task.getId();
boolean ownerAllowed = (task.getTaskData().getActualOwner() != null && task.getTaskData().getActualOwner().equals(user)); if (!adminAllowed && !potOwnerAllowed && !ownerAllowed) { String errorMessage = "The user" + user + "is not allowed to Start the task " + task.getId();
boolean ownerAllowed = (task.getTaskData().getActualOwner() != null && task.getTaskData().getActualOwner().equals(user)); boolean noOp = true; if (!adminAllowed && !potOwnerAllowed && !ownerAllowed) {