private void addSystemComment(final SFlowNodeInstance flowNodeInstance, final FlowNodeState state) throws SCommentAddException { if (commentService.isCommentEnabled(SystemCommentType.STATE_CHANGE) && state.mustAddSystemComment(flowNodeInstance)) { commentService.addSystemComment(flowNodeInstance.getRootContainerId(), state.getSystemComment(flowNodeInstance)); } }
private void addSystemComment(final SFlowNodeInstance flowNodeInstance, final FlowNodeState state) throws SCommentAddException { if (commentService.isCommentEnabled(SystemCommentType.STATE_CHANGE) && state.mustAddSystemComment(flowNodeInstance)) { commentService.addSystemComment(flowNodeInstance.getRootContainerId(), state.getSystemComment(flowNodeInstance)); } }
protected void addSystemCommentOnProcessInstanceWhenExecutingTaskFor(final SFlowNodeInstance flowNodeInstance, final long executerUserId, final long executerSubstituteUserId) { final TenantServiceAccessor tenantAccessor = getTenantAccessor(); final TechnicalLoggerService logger = tenantAccessor.getTechnicalLoggerService(); final SCommentService commentService = tenantAccessor.getCommentService(); final SessionInfos session = SessionInfos.getSessionInfos(); if (executerUserId != executerSubstituteUserId) { final IdentityService identityService = tenantAccessor.getIdentityService(); try { final SUser executerUser = identityService.getUser(executerUserId); final StringBuilder stb = new StringBuilder(); stb.append("The user " + session.getUsername() + " "); stb.append("acting as delegate of the user " + executerUser.getUserName() + " "); stb.append("has done the task \"" + flowNodeInstance.getDisplayName() + "\"."); commentService.addSystemComment(flowNodeInstance.getParentProcessInstanceId(), stb.toString()); } catch (final SBonitaException e) { logger.log(this.getClass(), TechnicalLogSeverity.ERROR, "Error when adding a comment on the process instance.", e); } } } }
protected void addSystemCommentOnProcessInstanceWhenExecutingTaskFor(final SFlowNodeInstance flowNodeInstance, final long executerUserId, final long executerSubstituteUserId) { final TenantServiceAccessor tenantAccessor = getTenantAccessor(); final TechnicalLoggerService logger = tenantAccessor.getTechnicalLoggerService(); final SCommentService commentService = tenantAccessor.getCommentService(); final SessionInfos session = SessionInfos.getSessionInfos(); if (executerUserId != executerSubstituteUserId) { final IdentityService identityService = tenantAccessor.getIdentityService(); try { final SUser executerUser = identityService.getUser(executerUserId); final StringBuilder stb = new StringBuilder(); stb.append("The user " + session.getUsername() + " "); stb.append("acting as delegate of the user " + executerUser.getUserName() + " "); stb.append("has done the task \"" + flowNodeInstance.getDisplayName() + "\"."); commentService.addSystemComment(flowNodeInstance.getParentProcessInstanceId(), stb.toString()); } catch (final SBonitaException e) { logger.log(this.getClass(), TechnicalLogSeverity.ERROR, "Error when adding a comment on the process instance.", e); } } } }
public void addAssignmentSystemComment(final SFlowNodeInstance flowNodeInstance, final long userId) throws SUserNotFoundException, SCommentAddException { final SUser user = identityService.getUser(userId); if (commentService.isCommentEnabled(SystemCommentType.STATE_CHANGE)) { commentService.addSystemComment(flowNodeInstance.getRootContainerId(), "The task \"" + flowNodeInstance.getDisplayName() + "\" is now assigned to " + user.getUserName()); } }
public void addAssignmentSystemComment(final SFlowNodeInstance flowNodeInstance, final long userId) throws SUserNotFoundException, SCommentAddException { final SUser user = identityService.getUser(userId); if (commentService.isCommentEnabled(SystemCommentType.STATE_CHANGE)) { commentService.addSystemComment(flowNodeInstance.getRootContainerId(), "The task \"" + flowNodeInstance.getDisplayName() + "\" is now assigned to " + user.getUserName()); } }
protected void addSystemCommentOnProcessInstanceWhenStartingProcessFor(final SProcessInstance sProcessInstance, final long starterId, final long starterSubstituteId) { final TenantServiceAccessor tenantAccessor = getTenantAccessor(); final TechnicalLoggerService logger = tenantAccessor.getTechnicalLoggerService(); final SCommentService commentService = tenantAccessor.getCommentService(); if (starterId != starterSubstituteId) { final IdentityService identityService = tenantAccessor.getIdentityService(); try { final SUser starter = identityService.getUser(starterId); commentService.addSystemComment(sProcessInstance.getId(), "The user " + SessionInfos.getUserNameFromSession() + " acting as delegate of the user " + starter.getUserName() + " has started the case."); } catch (final SBonitaException e) { logger.log(this.getClass(), TechnicalLogSeverity.ERROR, "Error when adding a comment on the process instance.", e); } } }
protected void addSystemCommentOnProcessInstanceWhenStartingProcessFor(final SProcessInstance sProcessInstance, final long starterId, final long starterSubstituteId) { final TenantServiceAccessor tenantAccessor = getTenantAccessor(); final TechnicalLoggerService logger = tenantAccessor.getTechnicalLoggerService(); final SCommentService commentService = tenantAccessor.getCommentService(); if (starterId != starterSubstituteId) { final IdentityService identityService = tenantAccessor.getIdentityService(); try { final SUser starter = identityService.getUser(starterId); commentService.addSystemComment(sProcessInstance.getId(), "The user " + SessionInfos.getUserNameFromSession() + " acting as delegate of the user " + starter.getUserName() + " has started the case."); } catch (final SBonitaException e) { logger.log(this.getClass(), TechnicalLogSeverity.ERROR, "Error when adding a comment on the process instance.", e); } } }
String stb = "The user " + session.getUserName() + " " + "acting as delegate of the user " + executorUser.getUserName() + " " + "has done the task \"" + flowNodeInstance.getDisplayName() + "\"."; commentService.addSystemComment(flowNodeInstance.getParentProcessInstanceId(), stb); } catch (final SBonitaException e) { logger.log(this.getClass(), TechnicalLogSeverity.ERROR, "Error when adding a comment on the process instance.", e);
String stb = "The user " + session.getUserName() + " " + "acting as delegate of the user " + executorUser.getUserName() + " " + "has done the task \"" + flowNodeInstance.getDisplayName() + "\"."; commentService.addSystemComment(flowNodeInstance.getParentProcessInstanceId(), stb); } catch (final SBonitaException e) { logger.log(this.getClass(), TechnicalLogSeverity.ERROR, "Error when adding a comment on the process instance.", e);