private static Class loadClass(ClassLoader classLoader, String className) throws ClassNotFoundException { ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration(); boolean useClassForName = processEngineConfiguration == null || processEngineConfiguration.isUseClassForNameClassLoading(); return useClassForName ? Class.forName(className, true, classLoader) : classLoader.loadClass(className); }
private static ClassLoader getCustomClassLoader() { ProcessEngineConfigurationImpl processEngineConfiguration = Context.getProcessEngineConfiguration(); if (processEngineConfiguration != null) { final ClassLoader classLoader = processEngineConfiguration.getClassLoader(); if (classLoader != null) { return classLoader; } } return null; }
public static String prepareRepeat(String dueDate) { if (dueDate.startsWith("R") && dueDate.split("/").length == 2) { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); return dueDate.replace("/", "/" + sdf.format(Context.getProcessEngineConfiguration().getClock().getCurrentTime()) + "/"); } return dueDate; }
public DeploymentBuilderImpl(RepositoryServiceImpl repositoryService) { this(repositoryService, Context.getProcessEngineConfiguration().getDeploymentEntityManager().create(), Context.getProcessEngineConfiguration().getResourceEntityManager()); }
@Override public IntermediateThrowSignalEventActivityBehavior createIntermediateThrowSignalEventActivityBehavior(ThrowEvent throwEvent, SignalEventDefinition signalEventDefinition, Signal signal) { SpringProcessEngineConfiguration springProcessEngineConfiguration = (SpringProcessEngineConfiguration) Context.getProcessEngineConfiguration(); return (IntermediateThrowSignalEventActivityBehavior) springProcessEngineConfiguration.getApplicationContext().getBean(DEFAULT_THROW_SIGNAL_EVENT_BEAN_NAME, springProcessEngineConfiguration.getApplicationContext(), signalEventDefinition, signal); } }
public void performSchemaOperationsProcessEngineClose() { String databaseSchemaUpdate = Context.getProcessEngineConfiguration().getDatabaseSchemaUpdate(); if (org.activiti.engine.ProcessEngineConfiguration.DB_SCHEMA_UPDATE_CREATE_DROP.equals(databaseSchemaUpdate)) { dbSchemaDrop(); } }
protected void ensureVariablesInitialized() { if (!queryVariableValues.isEmpty()) { VariableTypes variableTypes = Context.getProcessEngineConfiguration().getVariableTypes(); for (QueryVariableValue queryVariableValue : queryVariableValues) { queryVariableValue.initialize(variableTypes); } } }
protected ProcessDefinition findProcessDefinition(String processDefinitionKey, String tenantId) { if (tenantId == null || ProcessEngineConfiguration.NO_TENANT_ID.equals(tenantId)) { return Context.getProcessEngineConfiguration().getDeploymentManager().findDeployedLatestProcessDefinitionByKey(processDefinitionKey); } else { return Context.getProcessEngineConfiguration().getDeploymentManager().findDeployedLatestProcessDefinitionByKeyAndTenantId(processDefinitionKey, tenantId); } }
protected void ensureVariablesInitialized() { if (this.queryVariableValue != null) { VariableTypes variableTypes = Context.getProcessEngineConfiguration().getVariableTypes(); queryVariableValue.initialize(variableTypes); } }
public Date resolveDuedate(String duedate) { Date resolvedDuedate = Context.getProcessEngineConfiguration().getClock().getCurrentTime(); String[] tokens = duedate.split(" and "); for (String token : tokens) { resolvedDuedate = addSingleUnitQuantity(resolvedDuedate, token); } return resolvedDuedate; }
protected void sendCancelEvent(DeadLetterJobEntity jobToDelete) { if (Context.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) { Context.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(ActivitiEventBuilder.createEntityEvent(ActivitiEventType.JOB_CANCELED, jobToDelete)); } }
protected void sendCancelEvent(JobEntity jobToDelete) { if (Context.getProcessEngineConfiguration().getEventDispatcher().isEnabled()) { Context.getProcessEngineConfiguration().getEventDispatcher().dispatchEvent(ActivitiEventBuilder.createEntityEvent(ActivitiEventType.JOB_CANCELED, jobToDelete)); } }
protected void ensureVariablesInitialized() { VariableTypes types = Context.getProcessEngineConfiguration().getVariableTypes(); for (QueryVariableValue var : queryVariableValues) { var.initialize(types); } for (HistoricTaskInstanceQueryImpl orQueryObject : orQueryObjects) { orQueryObject.ensureVariablesInitialized(); } }
public void setValue(Object value, VariableScope variableScope) { ELContext elContext = Context.getProcessEngineConfiguration().getExpressionManager().getElContext(variableScope); try { ExpressionSetInvocation invocation = new ExpressionSetInvocation(valueExpression, elContext, value); Context.getProcessEngineConfiguration().getDelegateInterceptor().handleInvocation(invocation); } catch (Exception e) { throw new ActivitiException("Error while evaluating expression: " + expressionText, e); } }
public static BpmnModel getBpmnModelFromCache(String processDefinitionId) { ProcessDefinitionCacheEntry cacheEntry = Context.getProcessEngineConfiguration().getProcessDefinitionCache().get(processDefinitionId); if (cacheEntry != null) { return cacheEntry.getBpmnModel(); } return null; }
protected void ensureVariablesInitialized() { VariableTypes types = Context.getProcessEngineConfiguration().getVariableTypes(); for (QueryVariableValue var : queryVariableValues) { var.initialize(types); } for (TaskQueryImpl orQueryObject : orQueryObjects) { orQueryObject.ensureVariablesInitialized(); } }
public void notify(DelegateExecution execution) { Object delegate = DelegateExpressionUtil.resolveDelegateExpression(expression, execution, fieldDeclarations); if (delegate instanceof ExecutionListener) { Context.getProcessEngineConfiguration().getDelegateInterceptor().handleInvocation(new ExecutionListenerInvocation((ExecutionListener) delegate, execution)); } else if (delegate instanceof JavaDelegate) { Context.getProcessEngineConfiguration().getDelegateInterceptor().handleInvocation(new JavaDelegateInvocation((JavaDelegate) delegate, execution)); } else { throw new ActivitiIllegalArgumentException("Delegate expression " + expression + " did not resolve to an implementation of " + ExecutionListener.class + " nor " + JavaDelegate.class); } }
protected static ObjectNode getProcessDefinitionInfoNode(String processDefinitionId) { Map<String, ObjectNode> bpmnOverrideMap = getBpmnOverrideContext(); if (!bpmnOverrideMap.containsKey(processDefinitionId)) { ProcessDefinitionInfoCacheObject cacheObject = getProcessEngineConfiguration().getDeploymentManager() .getProcessDefinitionInfoCache() .get(processDefinitionId); addBpmnOverrideElement(processDefinitionId, cacheObject.getInfoNode()); } return getBpmnOverrideContext().get(processDefinitionId); }
public void notify(DelegateTask delegateTask) { Object delegate = DelegateExpressionUtil.resolveDelegateExpression(expression, delegateTask, fieldDeclarations); if (delegate instanceof TaskListener) { try { Context.getProcessEngineConfiguration().getDelegateInterceptor().handleInvocation(new TaskListenerInvocation((TaskListener) delegate, delegateTask)); } catch (Exception e) { throw new ActivitiException("Exception while invoking TaskListener: " + e.getMessage(), e); } } else { throw new ActivitiIllegalArgumentException("Delegate expression " + expression + " did not resolve to an implementation of " + TaskListener.class); } }
public void notify(DelegateTask delegateTask) { validateParameters(); ScriptingEngines scriptingEngines = Context.getProcessEngineConfiguration().getScriptingEngines(); Object result = scriptingEngines.evaluate(script.getExpressionText(), language.getExpressionText(), delegateTask, autoStoreVariables); if (resultVariable != null) { delegateTask.setVariable(resultVariable.getExpressionText(), result); } }