protected Long getExecuteByUserId(final Map<String, Serializable> parameters) { Serializable executeByUserId = parameters.get(USER_ID_KEY); // executeByUserId is not defined when the use is doing the task by himself if (executeByUserId == null) { return SessionInfos.getSessionInfos().getUserId(); } return (Long) executeByUserId; }
protected Long getExecuteByUserId(final Map<String, Serializable> parameters) { Serializable executeByUserId = parameters.get(USER_ID_KEY); // executeByUserId is not defined when the use is doing the task by himself if (executeByUserId == null) { return SessionInfos.getSessionInfos().getUserId(); } return (Long) executeByUserId; }
protected void executeActivity(final SFlowNodeInstance flowNodeInstance, long executerUserId) throws SFlowNodeReadException, SFlowNodeExecutionException { final TenantServiceAccessor tenantAccessor = TenantServiceSingleton.getInstance(getTenantId()); final ProcessExecutor processExecutor = tenantAccessor.getProcessExecutor(); final TechnicalLoggerService logger = tenantAccessor.getTechnicalLoggerService(); final SessionInfos sessionInfos = SessionInfos.getSessionInfos(); final long executerSubstituteId = sessionInfos.getUserId(); // no need to handle failed state, all is in the same tx, if the node fail we just have an exception on client side + rollback processExecutor.executeFlowNode(flowNodeInstance.getId(), executerUserId, executerSubstituteId); if (logger.isLoggable(getClass(), TechnicalLogSeverity.INFO) && flowNodeInstance.getStateId() != 0 /* don't log when create subtask */) { final String message = LogMessageBuilder.buildExecuteTaskContextMessage(flowNodeInstance, sessionInfos.getUsername(), executerUserId, executerSubstituteId, null); // no inputs taken in this LEGACY command for old-version web form execution logger.log(getClass(), TechnicalLogSeverity.INFO, message); } addSystemCommentOnProcessInstanceWhenExecutingTaskFor(flowNodeInstance, executerUserId, executerSubstituteId); }
protected void executeActivity(final SFlowNodeInstance flowNodeInstance, long executerUserId) throws SFlowNodeReadException, SFlowNodeExecutionException { final TenantServiceAccessor tenantAccessor = TenantServiceSingleton.getInstance(getTenantId()); final ProcessExecutor processExecutor = tenantAccessor.getProcessExecutor(); final TechnicalLoggerService logger = tenantAccessor.getTechnicalLoggerService(); final SessionInfos sessionInfos = SessionInfos.getSessionInfos(); final long executerSubstituteId = sessionInfos.getUserId(); // no need to handle failed state, all is in the same tx, if the node fail we just have an exception on client side + rollback processExecutor.executeFlowNode(flowNodeInstance.getId(), executerUserId, executerSubstituteId); if (logger.isLoggable(getClass(), TechnicalLogSeverity.INFO) && flowNodeInstance.getStateId() != 0 /* don't log when create subtask */) { final String message = LogMessageBuilder.buildExecuteTaskContextMessage(flowNodeInstance, sessionInfos.getUsername(), executerUserId, executerSubstituteId, null); // no inputs taken in this LEGACY command for old-version web form execution logger.log(getClass(), TechnicalLogSeverity.INFO, message); } addSystemCommentOnProcessInstanceWhenExecutingTaskFor(flowNodeInstance, executerUserId, executerSubstituteId); }