protected Permission getDefaultUserPermissionForTask() { return Context .getProcessEngineConfiguration() .getDefaultUserPermissionForTask(); }
protected boolean isAutoStoreScriptVariablesEnabled() { ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration(); if(processEngineConfiguration != null) { return processEngineConfiguration.isAutoStoreScriptVariables(); } return false; }
public ProcessEngineServices getProcessEngineServices() { return Context .getProcessEngineConfiguration() .getProcessEngine(); }
protected DefaultProcessApplicationRegistration createProcessApplicationRegistration(Set<String> deploymentsToRegister, ProcessApplicationReference reference) { final String processEngineName = Context.getProcessEngineConfiguration().getProcessEngineName(); DefaultProcessApplicationRegistration registration = new DefaultProcessApplicationRegistration(reference, deploymentsToRegister, processEngineName); // add to registration map for (String deploymentId : deploymentsToRegister) { registrationsByDeploymentId.put(deploymentId, registration); } return registration; }
public static ProcessApplicationReference getTargetProcessApplication(String deploymentId) { ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration(); ProcessApplicationManager processApplicationManager = processEngineConfiguration.getProcessApplicationManager(); ProcessApplicationReference processApplicationForDeployment = processApplicationManager.getProcessApplicationForDeployment(deploymentId); return processApplicationForDeployment; }
@Override public void validate(T query) { if (!Context.getProcessEngineConfiguration().isEnableExpressionsInAdhocQueries() && !query.getExpressions().isEmpty()) { throw new BadUserRequestException("Expressions are forbidden in adhoc queries. This behavior can be toggled" + " in the process engine configuration"); } }
@Override public void validate(T query) { if (!Context.getProcessEngineConfiguration().isEnableExpressionsInStoredQueries() && !query.getExpressions().isEmpty()) { throw new BadUserRequestException("Expressions are forbidden in stored queries. This behavior can be toggled" + " in the process engine configuration"); } }
protected boolean shouldWriteHistoricDetail(HistoricVariableUpdateEventEntity historyEvent) { return Context.getProcessEngineConfiguration().getHistoryLevel() .isHistoryEventProduced(HistoryEventTypes.VARIABLE_INSTANCE_UPDATE_DETAIL, historyEvent) && !historyEvent.isEventOfType(HistoryEventTypes.VARIABLE_INSTANCE_MIGRATE); }
public void createHistoricBatch(final BatchEntity batch) { ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration(); HistoryLevel historyLevel = configuration.getHistoryLevel(); if(historyLevel.isHistoryEventProduced(HistoryEventTypes.BATCH_START, batch)) { HistoryEventProcessor.processHistoryEvents(new HistoryEventProcessor.HistoryEventCreator() { @Override public HistoryEvent createHistoryEvent(HistoryEventProducer producer) { return producer.createBatchStartEvent(batch); } }); } }
public void notify(DmnDecisionEvaluationEvent evaluationEvent) { HistoryEvent historyEvent = createHistoryEvent(evaluationEvent); if(historyEvent != null) { Context.getProcessEngineConfiguration() .getHistoryEventHandler() .handleEvent(historyEvent); } }
protected void processEventSync(Object payload, Object payloadLocal, String businessKey) { EventHandler eventHandler = Context.getProcessEngineConfiguration().getEventHandler(eventType); ensureNotNull("Could not find eventhandler for event of type '" + eventType + "'", "eventHandler", eventHandler); eventHandler.handleEvent(this, payload, payloadLocal, businessKey, Context.getCommandContext()); }
protected void notifyAcquisition(CommandContext commandContext) { JobExecutor jobExecutor = Context.getProcessEngineConfiguration().getJobExecutor(); MessageAddedNotification messageAddedNotification = new MessageAddedNotification(jobExecutor); TransactionContext transactionContext = commandContext.getTransactionContext(); transactionContext.addTransactionListener(TransactionState.COMMITTED, messageAddedNotification); } }
public String execute(CommandContext commandContext) { commandContext.getAuthorizationManager().checkCamundaAdmin(); ProcessApplicationReference reference = Context.getProcessEngineConfiguration() .getProcessApplicationManager() .getProcessApplicationForDeployment(deploymentId); if(reference != null) { return reference.getName(); } else { return null; } }
protected boolean matchPassword(String password, UserEntity user) { String saltedPassword = saltPassword(password, user.getSalt()); return Context.getProcessEngineConfiguration() .getPasswordManager() .check(saltedPassword, user.getPassword()); }
public void fireHistoricCaseActivityInstanceUpdate() { ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration(); HistoryLevel historyLevel = configuration.getHistoryLevel(); if (historyLevel.isHistoryEventProduced(HistoryEventTypes.CASE_ACTIVITY_INSTANCE_UPDATE, this)) { CmmnHistoryEventProducer eventProducer = configuration.getCmmnHistoryEventProducer(); HistoryEventHandler eventHandler = configuration.getHistoryEventHandler(); HistoryEvent event = eventProducer.createCaseActivityInstanceUpdateEvt(this); eventHandler.handleEvent(event); } }
public DecisionRequirementsDefinition execute(CommandContext commandContext) { ensureNotNull("decisionRequirementsDefinitionId", decisionRequirementsDefinitionId); DeploymentCache deploymentCache = Context.getProcessEngineConfiguration().getDeploymentCache(); DecisionRequirementsDefinitionEntity decisionRequirementsDefinition = deploymentCache.findDeployedDecisionRequirementsDefinitionById(decisionRequirementsDefinitionId); for(CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) { checker.checkReadDecisionRequirementsDefinition(decisionRequirementsDefinition); } return decisionRequirementsDefinition; }
public AuthorizationEntity[] newDeployment(Deployment deployment) { ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration(); IdentityService identityService = processEngineConfiguration.getIdentityService(); Authentication currentAuthentication = identityService.getCurrentAuthentication(); if (currentAuthentication != null && currentAuthentication.getUserId() != null) { String userId = currentAuthentication.getUserId(); String deploymentId = deployment.getId(); AuthorizationEntity authorization = createGrantAuthorization(userId, null, DEPLOYMENT, deploymentId, READ, DELETE); return new AuthorizationEntity[]{ authorization }; } return null; }
public DecisionDefinition execute(CommandContext commandContext) { ensureNotNull("decisionDefinitionId", decisionDefinitionId); DeploymentCache deploymentCache = Context.getProcessEngineConfiguration().getDeploymentCache(); DecisionDefinitionEntity decisionDefinition = deploymentCache.findDeployedDecisionDefinitionById(decisionDefinitionId); for(CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) { checker.checkReadDecisionDefinition(decisionDefinition); } return decisionDefinition; }
public Void execute(CommandContext commandContext) { ProcessEngineConfigurationImpl engineConfiguration = Context.getProcessEngineConfiguration(); if (!engineConfiguration.isMetricsEnabled()) { throw new ProcessEngineException("Metrics reporting is disabled"); } if (!engineConfiguration.isDbMetricsReporterActivate()) { throw new ProcessEngineException("Metrics reporting to database is disabled"); } DbMetricsReporter dbMetricsReporter = engineConfiguration.getDbMetricsReporter(); dbMetricsReporter.reportNow(); return null; }
public BpmnModelInstance execute(CommandContext commandContext) { ProcessEngineConfigurationImpl configuration = Context.getProcessEngineConfiguration(); final DeploymentCache deploymentCache = configuration.getDeploymentCache(); ProcessDefinitionEntity processDefinition = deploymentCache.findDeployedProcessDefinitionById(processDefinitionId); for(CommandChecker checker : commandContext.getProcessEngineConfiguration().getCommandCheckers()) { checker.checkReadProcessDefinition(processDefinition); } BpmnModelInstance modelInstance = deploymentCache.findBpmnModelInstanceForProcessDefinition(processDefinitionId); ensureNotNull("no BPMN model instance found for process definition id " + processDefinitionId, "modelInstance", modelInstance); return modelInstance; } }