code
stringlengths
25
201k
docstring
stringlengths
19
96.2k
func_name
stringlengths
0
235
language
stringclasses
1 value
repo
stringlengths
8
51
path
stringlengths
11
314
url
stringlengths
62
377
license
stringclasses
7 values
@AroundInvoke public Object invoke(InvocationContext ctx) throws Exception { try { Object result = ctx.proceed(); CompleteTask completeTaskAnnotation = ctx.getMethod().getAnnotation(CompleteTask.class); boolean endConversation = completeTaskAnnotation.endConversation(); businessProcess.completeTask(endConversation); return result; } catch (InvocationTargetException e) { throw new ProcessEngineCdiException("Error while completing task: "+e.getCause().getMessage(), e.getCause()); } }
{@link Interceptor} for handling the {@link CompleteTask}-Annotation @author Daniel Meyer
invoke
java
camunda/camunda-bpm-platform
engine-cdi/core/src/main/java/org/camunda/bpm/engine/cdi/impl/annotation/CompleteTaskInterceptor.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-cdi/core/src/main/java/org/camunda/bpm/engine/cdi/impl/annotation/CompleteTaskInterceptor.java
Apache-2.0
protected Class< ? extends ScopedAssociation> getBroadestActiveContext() { for (Class< ? extends ScopedAssociation> scopeType : getAvailableScopedAssociationClasses()) { Annotation scopeAnnotation = scopeType.getAnnotations().length > 0 ? scopeType.getAnnotations()[0] : null; if (scopeAnnotation == null || !beanManager.isScope(scopeAnnotation.annotationType())) { throw new ProcessEngineException("ScopedAssociation must carry exactly one annotation and it must be a @Scope annotation"); } try { beanManager.getContext(scopeAnnotation.annotationType()); return scopeType; } catch (ContextNotActiveException e) { log.finest("Context " + scopeAnnotation.annotationType() + " not active."); } } throw new ProcessEngineException("Could not determine an active context to associate the current process instance / task instance with."); }
Default implementation of the business process association manager. Uses a fallback-strategy to associate the process instance with the "broadest" active scope, starting with the conversation. <p /> Subclass in order to implement custom association schemes and association with custom scopes. @author Daniel Meyer
getBroadestActiveContext
java
camunda/camunda-bpm-platform
engine-cdi/core/src/main/java/org/camunda/bpm/engine/cdi/impl/context/DefaultContextAssociationManager.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-cdi/core/src/main/java/org/camunda/bpm/engine/cdi/impl/context/DefaultContextAssociationManager.java
Apache-2.0
public static <T> T lookup(Class<T> clazz) { return lookup(clazz, true); }
@return a ContextualInstance of the given type @throws javax.enterprise.inject.AmbiguousResolutionException if the given type is satisfied by more than one Bean @see #lookup(Class, boolean)
lookup
java
camunda/camunda-bpm-platform
engine-cdi/core/src/main/java/org/camunda/bpm/engine/cdi/impl/util/ProgrammaticBeanLookup.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-cdi/core/src/main/java/org/camunda/bpm/engine/cdi/impl/util/ProgrammaticBeanLookup.java
Apache-2.0
@Deprecated public void startTask(String taskId, String callbackUrl) { if (taskId==null || callbackUrl == null) { if (FacesContext.getCurrentInstance().isPostback()) { // if this is an AJAX request ignore it, since we will receive multiple calls to this bean if it is added // as preRenderView event // see http://stackoverflow.com/questions/2830834/jsf-fevent-prerenderview-is-triggered-by-fajax-calls-and-partial-renders-some return; } // return it anyway but log an info message log.log(Level.INFO, "Called startTask method without proper parameter (taskId='"+taskId+"'; callbackUrl='"+callbackUrl+"') even if it seems we are not called by an AJAX Postback. Are you using the camundaTaskForm bean correctly?"); return; } // Note that we always run in a conversation this.url = callbackUrl; businessProcess.startTask(taskId, true); }
@deprecated use {@link startTaskForm()} instead @param taskId @param callbackUrl
startTask
java
camunda/camunda-bpm-platform
engine-cdi/core/src/main/java/org/camunda/bpm/engine/cdi/jsf/TaskForm.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-cdi/core/src/main/java/org/camunda/bpm/engine/cdi/jsf/TaskForm.java
Apache-2.0
@Deprecated public void startProcessInstanceByIdForm(String processDefinitionId, String callbackUrl) { this.url = callbackUrl; this.processDefinitionId = processDefinitionId; beginConversation(); }
@deprecated use {@link startProcessInstanceByIdForm()} instead @param processDefinitionId @param callbackUrl
startProcessInstanceByIdForm
java
camunda/camunda-bpm-platform
engine-cdi/core/src/main/java/org/camunda/bpm/engine/cdi/jsf/TaskForm.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-cdi/core/src/main/java/org/camunda/bpm/engine/cdi/jsf/TaskForm.java
Apache-2.0
public void startProcessInstanceByIdForm() { if (FacesContext.getCurrentInstance().isPostback()) { // if this is an AJAX request ignore it, since we will receive multiple calls to this bean if it is added // as preRenderView event // see http://stackoverflow.com/questions/2830834/jsf-fevent-prerenderview-is-triggered-by-fajax-calls-and-partial-renders-some return; } Map<String, String> requestParameterMap = FacesContext.getCurrentInstance().getExternalContext().getRequestParameterMap(); String processDefinitionId = requestParameterMap.get("processDefinitionId"); String callbackUrl = requestParameterMap.get("callbackUrl"); this.url = callbackUrl; this.processDefinitionId = processDefinitionId; beginConversation(); }
Get processDefinitionId and callbackUrl from request and start a conversation to start the form
startProcessInstanceByIdForm
java
camunda/camunda-bpm-platform
engine-cdi/core/src/main/java/org/camunda/bpm/engine/cdi/jsf/TaskForm.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-cdi/core/src/main/java/org/camunda/bpm/engine/cdi/jsf/TaskForm.java
Apache-2.0
@Deprecated public void startProcessInstanceByKeyForm(String processDefinitionKey, String callbackUrl) { this.url = callbackUrl; this.processDefinitionKey = processDefinitionKey; beginConversation(); }
@deprecated use {@link startProcessInstanceByKeyForm()} instead @param processDefinitionKey @param callbackUrl
startProcessInstanceByKeyForm
java
camunda/camunda-bpm-platform
engine-cdi/core/src/main/java/org/camunda/bpm/engine/cdi/jsf/TaskForm.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-cdi/core/src/main/java/org/camunda/bpm/engine/cdi/jsf/TaskForm.java
Apache-2.0
@Test @Deployment(resources = "org/camunda/bpm/engine/cdi/test/api/annotation/CompleteTaskTest.bpmn20.xml") public void testCompleteTask() { BusinessProcess businessProcess = getBeanInstance(BusinessProcess.class); businessProcess.startProcessByKey("keyOfTheProcess"); Task task = taskService.createTaskQuery().singleResult(); // associate current unit of work with the task: businessProcess.startTask(task.getId()); getBeanInstance(DeclarativeProcessController.class).completeTask(); // assert that now the task is completed assertNull(taskService.createTaskQuery().singleResult()); }
Testcase for assuring that the {@link CompleteTaskInterceptor} works as expected @author Daniel Meyer
testCompleteTask
java
camunda/camunda-bpm-platform
engine-cdi/core/src/test/java/org/camunda/bpm/engine/cdi/test/api/annotation/CompleteTaskTest.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-cdi/core/src/test/java/org/camunda/bpm/engine/cdi/test/api/annotation/CompleteTaskTest.java
Apache-2.0
@Test @Deployment(resources = "org/camunda/bpm/engine/cdi/test/api/annotation/StartProcessTest.bpmn20.xml") public void testStartProcessByKey() { assertNull(runtimeService.createProcessInstanceQuery().singleResult()); getBeanInstance(DeclarativeProcessController.class).startProcessByKey(); BusinessProcess businessProcess = getBeanInstance(BusinessProcess.class); assertNotNull(runtimeService.createProcessInstanceQuery().singleResult()); assertEquals("camunda", businessProcess.getVariable("name")); TypedValue nameTypedValue = businessProcess.getVariableTyped("name"); assertNotNull(nameTypedValue); assertTrue(nameTypedValue instanceof StringValue); assertEquals(ValueType.STRING, nameTypedValue.getType()); assertEquals("camunda", nameTypedValue.getValue()); assertEquals("untypedName", businessProcess.getVariable("untypedName")); TypedValue untypedNameTypedValue = businessProcess.getVariableTyped("untypedName"); assertNotNull(untypedNameTypedValue); assertTrue(untypedNameTypedValue instanceof StringValue); assertEquals(ValueType.STRING, untypedNameTypedValue.getType()); assertEquals("untypedName", untypedNameTypedValue.getValue()); assertEquals("typedName", businessProcess.getVariable("typedName")); TypedValue typedNameTypedValue = businessProcess.getVariableTyped("typedName"); assertNotNull(typedNameTypedValue); assertTrue(typedNameTypedValue instanceof StringValue); assertEquals(ValueType.STRING, typedNameTypedValue.getType()); assertEquals("typedName", typedNameTypedValue.getValue()); businessProcess.startTask(taskService.createTaskQuery().singleResult().getId()); businessProcess.completeTask(); }
Testcase for assuring that the {@link StartProcessInterceptor} behaves as expected. @author Daniel Meyer
testStartProcessByKey
java
camunda/camunda-bpm-platform
engine-cdi/core/src/test/java/org/camunda/bpm/engine/cdi/test/api/annotation/StartProcessTest.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-cdi/core/src/test/java/org/camunda/bpm/engine/cdi/test/api/annotation/StartProcessTest.java
Apache-2.0
public static DmnEngineConfiguration createDefaultDmnEngineConfiguration() { return new DefaultDmnEngineConfiguration(); }
@return a new default dmn engine configuration
createDefaultDmnEngineConfiguration
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/DmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/DmnEngineConfiguration.java
Apache-2.0
public List<DmnDecisionTableEvaluationListener> getDecisionTableEvaluationListeners() { return decisionTableEvaluationListeners; }
The list of decision table evaluation listeners of the configuration. Contains the pre, default and post decision table evaluation listeners. Is set during the build of an engine. @return the list of decision table evaluation listeners
getDecisionTableEvaluationListeners
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public List<DmnDecisionEvaluationListener> getDecisionEvaluationListeners() { return decisionEvaluationListeners; }
The list of decision evaluation listeners of the configuration. Contains the pre, default and post decision evaluation listeners. Is set during the build of an engine. @return the list of decision table evaluation listeners
getDecisionEvaluationListeners
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public void setScriptEngineResolver(DmnScriptEngineResolver scriptEngineResolver) { this.scriptEngineResolver = scriptEngineResolver; }
Set the script engine resolver which is used by the engine to get an instance of a script engine to evaluated expressions. @param scriptEngineResolver the script engine resolver
setScriptEngineResolver
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public DefaultDmnEngineConfiguration scriptEngineResolver(DmnScriptEngineResolver scriptEngineResolver) { setScriptEngineResolver(scriptEngineResolver); return this; }
Set the script engine resolver which is used by the engine to get an instance of a script engine to evaluated expressions. @param scriptEngineResolver the script engine resolver @return this
scriptEngineResolver
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public void setElProvider(ElProvider elProvider) { this.elProvider = elProvider; }
Set the el provider which is used by the engine to evaluate an el expression. @param elProvider the el provider
setElProvider
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public DefaultDmnEngineConfiguration elProvider(ElProvider elProvider) { setElProvider(elProvider); return this; }
Set the el provider which is used by the engine to evaluate an el expression. @param elProvider the el provider @return this
elProvider
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public FeelEngineFactory getFeelEngineFactory() { return feelEngineFactory; }
@return the factory is used to create a {@link FeelEngine}
getFeelEngineFactory
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public void setFeelEngineFactory(FeelEngineFactory feelEngineFactory) { this.feelEngineFactory = feelEngineFactory; this.feelEngine = null; // clear cached FEEL engine }
Set the factory to create a {@link FeelEngine} @param feelEngineFactory the feel engine factory
setFeelEngineFactory
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public DefaultDmnEngineConfiguration feelEngineFactory(FeelEngineFactory feelEngineFactory) { setFeelEngineFactory(feelEngineFactory); return this; }
Set the factory to create a {@link FeelEngine} @param feelEngineFactory the feel engine factory @return this
feelEngineFactory
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public FeelEngine getFeelEngine() { return feelEngine; }
The feel engine used by the engine. Is initialized during the build of the engine. @return the feel engine
getFeelEngine
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public String getDefaultInputExpressionExpressionLanguage() { return defaultInputExpressionExpressionLanguage; }
@return the default expression language for input expressions
getDefaultInputExpressionExpressionLanguage
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public void setDefaultInputExpressionExpressionLanguage(String expressionLanguage) { this.defaultInputExpressionExpressionLanguage = expressionLanguage; }
Set the default expression language which is used to evaluate input expressions. It is used for all input expressions which do not have a expression language set. @param expressionLanguage the default expression language for input expressions
setDefaultInputExpressionExpressionLanguage
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public DefaultDmnEngineConfiguration defaultInputExpressionExpressionLanguage(String expressionLanguage) { setDefaultInputExpressionExpressionLanguage(expressionLanguage); return this; }
Set the default expression language which is used to evaluate input expressions. It is used for all input expressions which do not have a expression language set. @param expressionLanguage the default expression language for input expressions @return this configuration
defaultInputExpressionExpressionLanguage
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public String getDefaultInputEntryExpressionLanguage() { return defaultInputEntryExpressionLanguage; }
@return the default expression language for input entries
getDefaultInputEntryExpressionLanguage
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public void setDefaultInputEntryExpressionLanguage(String expressionLanguage) { this.defaultInputEntryExpressionLanguage = expressionLanguage; }
Set the default expression language which is used to evaluate input entries. It is used for all input entries which do not have a expression language set. @param expressionLanguage the default expression language for input entries
setDefaultInputEntryExpressionLanguage
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public DefaultDmnEngineConfiguration defaultInputEntryExpressionLanguage(String expressionLanguage) { setDefaultInputEntryExpressionLanguage(expressionLanguage); return this; }
Set the default expression language which is used to evaluate input entries. It is used for all input entries which do not have a expression language set. @param expressionLanguage the default expression language for input entries @return this configuration
defaultInputEntryExpressionLanguage
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public String getDefaultOutputEntryExpressionLanguage() { return defaultOutputEntryExpressionLanguage; }
@return the default expression language for output entries
getDefaultOutputEntryExpressionLanguage
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public void setDefaultOutputEntryExpressionLanguage(String expressionLanguage) { this.defaultOutputEntryExpressionLanguage = expressionLanguage; }
Set the default expression language which is used to evaluate output entries. It is used for all output entries which do not have a expression language set. @param expressionLanguage the default expression language for output entries
setDefaultOutputEntryExpressionLanguage
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public DefaultDmnEngineConfiguration defaultOutputEntryExpressionLanguage(String expressionLanguage) { setDefaultOutputEntryExpressionLanguage(expressionLanguage); return this; }
Set the default expression language which is used to evaluate output entries. It is used for all output entries which do not have a expression language set. @param expressionLanguage the default expression language for output entries @return this configuration
defaultOutputEntryExpressionLanguage
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public String getDefaultLiteralExpressionLanguage() { return defaultLiteralExpressionLanguage; }
@return the default expression language for literal expressions
getDefaultLiteralExpressionLanguage
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public void setDefaultLiteralExpressionLanguage(String expressionLanguage) { this.defaultLiteralExpressionLanguage = expressionLanguage; }
Set the default expression language which is used to evaluate literal expressions. It is used for all literal expressions which do not have a expression language set. @param expressionLanguage the default expression language for literal expressions
setDefaultLiteralExpressionLanguage
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public DefaultDmnEngineConfiguration defaultLiteralExpressionLanguage(String expressionLanguage) { setDefaultLiteralExpressionLanguage(expressionLanguage); return this; }
Set the default expression language which is used to evaluate literal expressions. It is used for all literal expressions which do not have a expression language set. @param expressionLanguage the default expression language for literal expressions @return this configuration
defaultLiteralExpressionLanguage
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public void setTransformer(DmnTransformer transformer) { this.transformer = transformer; }
Set the DMN transformer used to transform the DMN model. @param transformer the DMN transformer
setTransformer
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public DefaultDmnEngineConfiguration transformer(DmnTransformer transformer) { setTransformer(transformer); return this; }
Set the DMN transformer used to transform the DMN model. @param transformer the DMN transformer @return this
transformer
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public List<FeelCustomFunctionProvider> getFeelCustomFunctionProviders() { return feelCustomFunctionProviders; }
@return the list of FEEL Custom Function Providers
getFeelCustomFunctionProviders
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public void setFeelCustomFunctionProviders(List<FeelCustomFunctionProvider> feelCustomFunctionProviders) { this.feelCustomFunctionProviders = feelCustomFunctionProviders; }
Set a list of FEEL Custom Function Providers. @param feelCustomFunctionProviders a list of FEEL Custom Function Providers
setFeelCustomFunctionProviders
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public DefaultDmnEngineConfiguration feelCustomFunctionProviders(List<FeelCustomFunctionProvider> feelCustomFunctionProviders) { setFeelCustomFunctionProviders(feelCustomFunctionProviders); return this; }
Set a list of FEEL Custom Function Providers. @param feelCustomFunctionProviders a list of FEEL Custom Function Providers @return this
feelCustomFunctionProviders
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public boolean isEnableFeelLegacyBehavior() { return enableFeelLegacyBehavior; }
@return whether FEEL legacy behavior is enabled or not
isEnableFeelLegacyBehavior
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public void setEnableFeelLegacyBehavior(boolean enableFeelLegacyBehavior) { this.enableFeelLegacyBehavior = enableFeelLegacyBehavior; }
Controls whether the FEEL legacy behavior is enabled or not @param enableFeelLegacyBehavior the FEEL legacy behavior
setEnableFeelLegacyBehavior
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public DefaultDmnEngineConfiguration enableFeelLegacyBehavior(boolean enableFeelLegacyBehavior) { setEnableFeelLegacyBehavior(enableFeelLegacyBehavior); return this; }
Controls whether the FEEL legacy behavior is enabled or not @param enableFeelLegacyBehavior the FEEL legacy behavior @return this
enableFeelLegacyBehavior
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public boolean isReturnBlankTableOutputAsNull() { return returnBlankTableOutputAsNull; }
@return whether blank table outputs are swallowed or returned as {@code null}.
isReturnBlankTableOutputAsNull
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
public DefaultDmnEngineConfiguration setReturnBlankTableOutputAsNull(boolean returnBlankTableOutputAsNull) { this.returnBlankTableOutputAsNull = returnBlankTableOutputAsNull; return this; }
Controls whether blank table outputs are swallowed or returned as {@code null}. @param returnBlankTableOutputAsNull toggles whether blank table outputs are swallowed or returned as {@code null}. @return this
setReturnBlankTableOutputAsNull
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/DefaultDmnEngineConfiguration.java
Apache-2.0
@Override public TypedValue transform(Object value) throws IllegalArgumentException { return Variables.untypedValue(value); }
Transform the given value into untyped value. @author Philipp Ossler
transform
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/type/IdentityDataTypeTransformer.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/type/IdentityDataTypeTransformer.java
Apache-2.0
@Override public TypedValue transform(Object value) throws IllegalArgumentException { String stringValue = String.valueOf(value); return Variables.stringValue(stringValue); }
Transform values of type {@link Object} into {@link StringValue}. @author Philipp Ossler
transform
java
camunda/camunda-bpm-platform
engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/type/StringDataTypeTransformer.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/engine/src/main/java/org/camunda/bpm/dmn/engine/impl/type/StringDataTypeTransformer.java
Apache-2.0
public String getFunction() { return function; }
Exception thrown if a method used in a FEEL expression is not available.
getFunction
java
camunda/camunda-bpm-platform
engine-dmn/feel-juel/src/main/java/org/camunda/bpm/dmn/feel/impl/juel/FeelMissingFunctionException.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/feel-juel/src/main/java/org/camunda/bpm/dmn/feel/impl/juel/FeelMissingFunctionException.java
Apache-2.0
public String getVariable() { return variable; }
Exception thrown if a variable used in a FEEL expression is not available.
getVariable
java
camunda/camunda-bpm-platform
engine-dmn/feel-juel/src/main/java/org/camunda/bpm/dmn/feel/impl/juel/FeelMissingVariableException.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-dmn/feel-juel/src/main/java/org/camunda/bpm/dmn/feel/impl/juel/FeelMissingVariableException.java
Apache-2.0
protected void initializeControls(AbstractQuery<?, ?> query) { List<Control> listControls = new ArrayList<>(); if (ldapConfiguration.isSortControlSupported()) { listControls.addAll(getSortingControls(query)); } try { if (isPaginationSupported()) { LdapClient.addPaginationControl(listControls, null, getPageSize()); } } catch (IdentityProviderException ignored) { // Ignore exception when pagination is not supported } finally { if (!listControls.isEmpty()) { ldapClient.setRequestControls(listControls); } } }
Initializes paged results and sort controls. Might not be supported by all LDAP implementations.
initializeControls
java
camunda/camunda-bpm-platform
engine-plugins/identity-ldap/src/main/java/org/camunda/bpm/identity/impl/ldap/LdapIdentityProviderSession.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-plugins/identity-ldap/src/main/java/org/camunda/bpm/identity/impl/ldap/LdapIdentityProviderSession.java
Apache-2.0
@Before public void setup() { identityService = engineRule.getIdentityService(); ldapTestEnvironment = ldapRule.getLdapTestEnvironment(); }
Represents a test case where the sortControlSupport property is enabled. @author Christopher Zell <christopher.zell@camunda.com>
setup
java
camunda/camunda-bpm-platform
engine-plugins/identity-ldap/src/test/java/org/camunda/bpm/identity/impl/ldap/LdapEnableSortControlSupportTest.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-plugins/identity-ldap/src/test/java/org/camunda/bpm/identity/impl/ldap/LdapEnableSortControlSupportTest.java
Apache-2.0
protected void initSchemaPartition() throws Exception { InstanceLayout instanceLayout = service.getInstanceLayout(); File schemaPartitionDirectory = new File(instanceLayout.getPartitionsDirectory(), "schema"); // Extract the schema on disk (a brand new one) and load the registries if (schemaPartitionDirectory.exists()) { LOG.info("schema partition already exists, skipping schema extraction"); } else { SchemaLdifExtractor extractor = new DefaultSchemaLdifExtractor(instanceLayout.getPartitionsDirectory()); extractor.extractOrCopy(); } SchemaLoader loader = new LdifSchemaLoader(schemaPartitionDirectory); SchemaManager schemaManager = new DefaultSchemaManager(loader); // We have to load the schema now, otherwise we won't be able // to initialize the Partitions, as we won't be able to parse // and normalize their suffix Dn schemaManager.loadAllEnabled(); List<Throwable> errors = schemaManager.getErrors(); if (!errors.isEmpty()) { throw new Exception(I18n.err(I18n.ERR_317, Exceptions.printErrors(errors))); } service.setSchemaManager(schemaManager); // Init the LdifPartition with schema LdifPartition schemaLdifPartition = new LdifPartition(schemaManager, service.getDnFactory()); schemaLdifPartition.setPartitionPath(schemaPartitionDirectory.toURI()); // The schema partition SchemaPartition schemaPartition = new SchemaPartition(schemaManager); schemaPartition.setWrappedPartition(schemaLdifPartition); service.setSchemaPartition(schemaPartition); }
initialize the schema manager and add the schema partition to directory service @throws Exception if the schema LDIF files are not found on the classpath
initSchemaPartition
java
camunda/camunda-bpm-platform
engine-plugins/identity-ldap/src/test/java/org/camunda/bpm/identity/ldap/util/LdapTestEnvironment.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-plugins/identity-ldap/src/test/java/org/camunda/bpm/identity/ldap/util/LdapTestEnvironment.java
Apache-2.0
protected void initializeDirectory() throws Exception { workingDirectory.mkdirs(); service = new DefaultDirectoryService(); InstanceLayout il = new InstanceLayout(workingDirectory); service.setInstanceLayout(il); CacheService cacheService = new CacheService(); cacheService.initialize(service.getInstanceLayout()); service.setCacheService(cacheService); initSchemaPartition(); // then the system partition // this is a MANDATORY partition // DO NOT add this via addPartition() method, trunk code complains about duplicate partition // while initializing JdbmPartition systemPartition = new JdbmPartition(service.getSchemaManager(), service.getDnFactory()); systemPartition.setId("system"); systemPartition.setPartitionPath(new File(service.getInstanceLayout().getPartitionsDirectory(), systemPartition.getId()).toURI()); systemPartition.setSuffixDn(new Dn(ServerDNConstants.SYSTEM_DN)); systemPartition.setSchemaManager(service.getSchemaManager()); // mandatory to call this method to set the system partition // Note: this system partition might be removed from trunk service.setSystemPartition(systemPartition); // Disable the ChangeLog system service.getChangeLog().setEnabled(false); service.setDenormalizeOpAttrsEnabled(true); Partition camundaPartition = addPartition("camunda", BASE_DN, service.getDnFactory()); addIndex(camundaPartition, "objectClass", "ou", "uid"); service.startup(); // Create the root entry if (!service.getAdminSession().exists(camundaPartition.getSuffixDn())) { Dn dn = new Dn(BASE_DN); Entry entry = service.newEntry(dn); entry.add("objectClass", "top", "domain", "extensibleObject"); entry.add("dc", "camunda"); service.getAdminSession().add(entry); } }
Initialize the server. It creates the partition, adds the index, and injects the context entries for the created partitions. @throws Exception if there were some problems while initializing the system
initializeDirectory
java
camunda/camunda-bpm-platform
engine-plugins/identity-ldap/src/test/java/org/camunda/bpm/identity/ldap/util/LdapTestEnvironment.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-plugins/identity-ldap/src/test/java/org/camunda/bpm/identity/ldap/util/LdapTestEnvironment.java
Apache-2.0
public void createGroup(String name) throws Exception { Dn dn = new Dn("ou=" + name + ",o=camunda,c=org"); if (!service.getAdminSession().exists(dn)) { Entry entry = service.newEntry(dn); entry.add("objectClass", "top", "organizationalUnit"); entry.add("ou", name); service.getAdminSession().add(entry); System.out.println("created entry: " + dn.getNormName()); numberOfGroupsCreated++; } }
A role is implemented by a LDAP organizationalUnit @param name group to create @throws Exception in case of error
createGroup
java
camunda/camunda-bpm-platform
engine-plugins/identity-ldap/src/test/java/org/camunda/bpm/identity/ldap/util/LdapTestEnvironment.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-plugins/identity-ldap/src/test/java/org/camunda/bpm/identity/ldap/util/LdapTestEnvironment.java
Apache-2.0
protected void createRole(String roleName, String... users) throws Exception { Dn dn = new Dn("ou=" + roleName + ",o=camunda,c=org"); if (!service.getAdminSession().exists(dn)) { Entry entry = service.newEntry(dn); entry.add("objectClass", "top", "groupOfNames"); entry.add("cn", roleName); for (String user : users) { entry.add("member", user); } service.getAdminSession().add(entry); numberOfRolesCreated++; } }
A role is implemented by a LDAP groupOfNames @param roleName role to create (cn) @param users users members of this role @throws Exception in case of error
createRole
java
camunda/camunda-bpm-platform
engine-plugins/identity-ldap/src/test/java/org/camunda/bpm/identity/ldap/util/LdapTestEnvironment.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-plugins/identity-ldap/src/test/java/org/camunda/bpm/identity/ldap/util/LdapTestEnvironment.java
Apache-2.0
protected Partition addPartition(String partitionId, String partitionDn, DnFactory dnFactory) throws Exception { // Create a new partition with the given partition id JdbmPartition partition = new JdbmPartition(service.getSchemaManager(), dnFactory); partition.setId(partitionId); partition.setPartitionPath(new File(service.getInstanceLayout().getPartitionsDirectory(), partitionId).toURI()); partition.setSuffixDn(new Dn(partitionDn)); service.addPartition(partition); return partition; }
Add a new partition to the server @param partitionId The partition Id @param partitionDn The partition DN @param dnFactory the DN factory @return The newly added partition @throws Exception If the partition can't be added
addPartition
java
camunda/camunda-bpm-platform
engine-plugins/identity-ldap/src/test/java/org/camunda/bpm/identity/ldap/util/LdapTestEnvironment.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-plugins/identity-ldap/src/test/java/org/camunda/bpm/identity/ldap/util/LdapTestEnvironment.java
Apache-2.0
public String[] resolve(String language) { String envScript = SpinScriptEnv.get(language); if(envScript != null) { return new String[] { envScript }; } return null; }
Resolves Spin Environment Scripts. @author Daniel Meyer
resolve
java
camunda/camunda-bpm-platform
engine-plugins/spin-plugin/src/main/java/org/camunda/spin/plugin/impl/SpinScriptEnvResolver.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-plugins/spin-plugin/src/main/java/org/camunda/spin/plugin/impl/SpinScriptEnvResolver.java
Apache-2.0
public static AuthorizationExceptionDto fromException(AuthorizationException e) { AuthorizationExceptionDto dto = new AuthorizationExceptionDto(); dto.setMessage(e.getMessage()); dto.setType(AuthorizationException.class.getSimpleName()); dto.setUserId(e.getUserId()); dto.setMissingAuthorizations(MissingAuthorizationDto.fromInfo(e.getMissingAuthorizations())); dto.setPermissionName(e.getViolatedPermissionName()); dto.setResourceId(e.getResourceId()); dto.setResourceName(e.getResourceType()); return dto; }
<p>Dto for {@link AuthorizationException}</p> <p>The exception contains a list of Missing authorizations. The List is a disjunction i.e. a user should have any of the authorization for the engine to continue the execution beyond the point where it failed.</p> @author Daniel Meyer
fromException
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/AuthorizationExceptionDto.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/AuthorizationExceptionDto.java
Apache-2.0
@Deprecated public String getResourceName() { return resourceName; }
@return the name of the resource if there is only one {@link MissingAuthorizationDto}, {@code null} otherwise @deprecated Use {@link #getMissingAuthorizations()} to get the name of the resource of the {@link MissingAuthorizationDto}(s). This method will be removed in future version.
getResourceName
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/AuthorizationExceptionDto.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/AuthorizationExceptionDto.java
Apache-2.0
@Deprecated public String getResourceId() { return resourceId; }
@return the id of the resource if there is only one {@link MissingAuthorizationDto}, {@code null} otherwise @deprecated Use {@link #getMissingAuthorizations()} to get the id of the resource of the {@link MissingAuthorizationDto}(s). This method will be removed in future version.
getResourceId
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/AuthorizationExceptionDto.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/AuthorizationExceptionDto.java
Apache-2.0
@Deprecated public String getPermissionName() { return permissionName; }
@return the name of the violated permission if there is only one {@link MissingAuthorizationDto}, {@code null} otherwise @deprecated Use {@link #getMissingAuthorizations()} to get the name of the violated permission of the {@link MissingAuthorizationDto}(s). This method will be removed in future version.
getPermissionName
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/AuthorizationExceptionDto.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/AuthorizationExceptionDto.java
Apache-2.0
@Override public List<VariableQueryParameterDto> convertQueryParameterToType(String value) { String[] expressions = value.split(EXPRESSION_DELIMITER); List<VariableQueryParameterDto> queryVariables = new ArrayList<VariableQueryParameterDto>(); for (String expression : expressions) { String[] valueTriple = expression.split(ATTRIBUTE_DELIMITER); if (valueTriple.length != 3) { throw new InvalidRequestException(Status.BAD_REQUEST, "variable query parameter has to have format KEY_OPERATOR_VALUE."); } VariableQueryParameterDto queryVariable = new VariableQueryParameterDto(); queryVariable.setName(valueTriple[0]); queryVariable.setOperator(valueTriple[1]); queryVariable.setValue(valueTriple[2]); queryVariables.add(queryVariable); } return queryVariables; }
Expects a query parameter of multiple variable expressions formatted as KEY_OPERATOR_VALUE, e.g. aVariable_eq_aValue. Multiple values are expected to be comma-separated.
convertQueryParameterToType
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/converter/VariableListConverter.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/converter/VariableListConverter.java
Apache-2.0
public String getId() { return id; }
The id of the activity instance
getId
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/runtime/ActivityInstanceDto.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/runtime/ActivityInstanceDto.java
Apache-2.0
public String getParentActivityInstanceId() { return parentActivityInstanceId; }
The id of the parent activity instance. If the activity is the process definition, {@link #getId()} and {@link #getParentActivityInstanceId()} return the same value
getParentActivityInstanceId
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/runtime/ActivityInstanceDto.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/runtime/ActivityInstanceDto.java
Apache-2.0
public String getActivityType() { return activityType; }
type of the activity, corresponds to BPMN element name in XML (e.g. 'userTask')
getActivityType
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/runtime/ActivityInstanceDto.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/runtime/ActivityInstanceDto.java
Apache-2.0
public String[] getExecutionIds() { return executionIds; }
the list of executions that are currently waiting in this activity instance
getExecutionIds
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/runtime/ActivityInstanceDto.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/dto/runtime/ActivityInstanceDto.java
Apache-2.0
@Override public Response toResponse(Throwable throwable) { return ExceptionHandlerHelper.getInstance().getResponse(throwable); }
Translates any {@link Throwable} to a HTTP 500 error and a JSON response. Response content format: <code>{"type" : "ExceptionType", "message" : "some exception message"} @author nico.rehwaldt
toResponse
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/exception/ExceptionHandler.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/exception/ExceptionHandler.java
Apache-2.0
@Override public Response toResponse(ProcessEngineException exception) { return ExceptionHandlerHelper.getInstance().getResponse(exception); }
<p>Translates any {@link ProcessEngineException} to a HTTP 500 error and a JSON response. Response content format: <code>{"type" : "ExceptionType", "message" : "some exception message"}</code> </p> <p>Provides dedicated exception handling for {@link AuthorizationException AuthorizationExceptions}: The status code is always set to 403, "Forbidden" and details about the requested resource and violated permission are added to the response body</p> @author Thorben Lindhauer @author Daniel Meyer
toResponse
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/exception/ProcessEngineExceptionHandler.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/exception/ProcessEngineExceptionHandler.java
Apache-2.0
@Override public Response toResponse(RestException exception) { return ExceptionHandlerHelper.getInstance().getResponse(exception); }
Translates {@link RestException}s to error responses according to the status that is set in the exception. Response content format: <code>{"type" : "ExceptionType", "message" : "some exception message"}</code> @author Thorben Lindhauer
toResponse
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/exception/RestExceptionHandler.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/exception/RestExceptionHandler.java
Apache-2.0
public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws IOException, ServletException { final HttpServletRequest request = (HttpServletRequest) req; final HttpServletResponse response = (HttpServletResponse) resp; if("GET".equals(request.getMethod()) && !request.getRequestURI().endsWith("xml")) { response.setHeader("Cache-Control", "no-cache"); } chain.doFilter(req, resp); }
<p>Cache control filter setting "Cache-Control: no-cache" on all GET requests. @author Daniel Meyer
doFilter
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/filter/CacheControlFilter.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/filter/CacheControlFilter.java
Apache-2.0
public List<HalResource<?>> resolve(HalRelation relation, ProcessEngine processEngine) { HalLinkResolver linkResolver = hal.getLinkResolver(relation.resourceType); if(linkResolver != null) { Set<String> linkedIds = getLinkedResourceIdsByRelation(relation); if(!linkedIds.isEmpty()) { return linkResolver.resolveLinks(linkedIds.toArray(new String[linkedIds.size()]), processEngine); } else { return Collections.emptyList(); } } else { throw new RuntimeException("Cannot find HAL link resolver for resource type '"+relation.resourceType+"'."); } }
Resolves a relation. Locates a HalLinkResolver for resolving the set of all linked resources in the relation. @param relation the relation to resolve @param processEngine the process engine to use @return the list of resolved resources @throws RuntimeException if no HalLinkResolver can be found for the linked resource type.
resolve
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/hal/HalLinker.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/hal/HalLinker.java
Apache-2.0
public void mergeLinks(HalResource<?> embedded) { for (Entry<HalRelation, Set<String>> linkentry : embedded.linker.linkedResources.entrySet()) { Set<String> linkedIdSet = linkedResources.get(linkentry.getKey()); if(linkedIdSet != null) { linkedIdSet.addAll(linkentry.getValue()); }else { linkedResources.put(linkentry.getKey(), linkentry.getValue()); } } }
merge the links of an embedded resource into this linker. This is useful when building resources which are actually resource collections. You can then merge the relations of all resources in the collection and the unique the set of linked resources to embed. @param embedded the embedded resource for which the links should be merged into this linker.
mergeLinks
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/hal/HalLinker.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/hal/HalLinker.java
Apache-2.0
@SuppressWarnings("unchecked") public T embed(HalRelation relation, ProcessEngine processEngine) { List<HalResource<?>> resolvedLinks = linker.resolve(relation, processEngine); if(resolvedLinks != null && resolvedLinks.size() > 0) { addEmbedded(relation.relName, resolvedLinks); } return (T) this; }
Can be used to embed a relation. Embedded all linked resources in the given relation. @param relation the relation to embedded @param processEngine used to resolve the resources @return the resource itself.
embed
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/hal/HalResource.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/hal/HalResource.java
Apache-2.0
public List<HalResource<?>> resolveLinks(String[] linkedIds, ProcessEngine processEngine) { Cache cache = getCache(); if (cache == null) { return resolveNotCachedLinks(linkedIds, processEngine); } else { ArrayList<String> notCachedLinkedIds = new ArrayList<String>(); List<HalResource<?>> resolvedResources = resolveCachedLinks(linkedIds, cache, notCachedLinkedIds); if (!notCachedLinkedIds.isEmpty()) { List<HalResource<?>> notCachedResources = resolveNotCachedLinks(notCachedLinkedIds.toArray(new String[notCachedLinkedIds.size()]), processEngine); resolvedResources.addAll(notCachedResources); putIntoCache(notCachedResources); } sortResolvedResources(resolvedResources); return resolvedResources; } }
Resolve resources for linked ids, if configured uses a cache.
resolveLinks
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/hal/cache/HalCachingLinkResolver.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/hal/cache/HalCachingLinkResolver.java
Apache-2.0
protected void sortResolvedResources(List<HalResource<?>> resolvedResources) { Comparator<HalResource<?>> comparator = getResourceComparator(); if (comparator != null) { Collections.sort(resolvedResources, comparator); } }
Sort the resolved resources to ensure consistent order of resolved resources.
sortResolvedResources
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/hal/cache/HalCachingLinkResolver.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/hal/cache/HalCachingLinkResolver.java
Apache-2.0
protected Cache getCache() { return Hal.getInstance().getHalRelationCache(getHalResourceClass()); }
@return the cache for this resolver
getCache
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/hal/cache/HalCachingLinkResolver.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/hal/cache/HalCachingLinkResolver.java
Apache-2.0
protected List<HalResource<?>> resolveCachedLinks(String[] linkedIds, Cache cache, List<String> notCachedLinkedIds) { ArrayList<HalResource<?>> resolvedResources = new ArrayList<HalResource<?>>(); for (String linkedId : linkedIds) { HalResource<?> resource = (HalResource<?>) cache.get(linkedId); if (resource != null) { resolvedResources.add(resource); } else { notCachedLinkedIds.add(linkedId); } } return resolvedResources; }
Returns a list with all resources which are cached. @param linkedIds the ids to resolve @param cache the cache to use @param notCachedLinkedIds a list with ids which are not found in the cache @return the cached resources
resolveCachedLinks
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/hal/cache/HalCachingLinkResolver.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/hal/cache/HalCachingLinkResolver.java
Apache-2.0
protected Comparator<HalResource<?>> getResourceComparator() { return null; }
@return a comparator for this HAL resource if not overridden sorting is skipped
getResourceComparator
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/hal/cache/HalCachingLinkResolver.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/hal/cache/HalCachingLinkResolver.java
Apache-2.0
public static Comparator<HalResourceCacheEntry> getInstance() { return INSTANCE; }
Sort cache entries by ascending create time (oldest first)
getInstance
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/hal/cache/HalResourceCacheEntryComparator.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/hal/cache/HalResourceCacheEntryComparator.java
Apache-2.0
public static Set<Class<?>> getResourceClasses() { return RESOURCE_CLASSES; }
Returns a set containing all resource classes provided by Camunda Platform. @return a set of resource classes.
getResourceClasses
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/impl/CamundaRestResources.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/impl/CamundaRestResources.java
Apache-2.0
public static Set<Class<?>> getConfigurationClasses() { return CONFIGURATION_CLASSES; }
Returns a set containing all provider / mapper / config classes used in the default setup of the camunda REST api. @return a set of provider / mapper / config classes.
getConfigurationClasses
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/impl/CamundaRestResources.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/impl/CamundaRestResources.java
Apache-2.0
protected Response responseForFileVariable(FileValue fileValue) { String type = fileValue.getMimeType() != null ? fileValue.getMimeType() : MediaType.APPLICATION_OCTET_STREAM; if (fileValue.getEncoding() != null) { type += "; charset=" + fileValue.getEncoding(); } Object value = fileValue.getValue() == null ? "" : fileValue.getValue(); return Response.ok(value, type).header("Content-Disposition", URLEncodingUtil.buildAttachmentValue(fileValue.getFilename())).build(); }
Creates a response for a variable of type {@link ValueType#FILE}.
responseForFileVariable
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/sub/impl/VariableResponseProvider.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/sub/impl/VariableResponseProvider.java
Apache-2.0
protected Response responseForByteVariable(TypedValue variableInstance) { byte[] valueBytes = (byte[]) variableInstance.getValue(); if (valueBytes == null) { valueBytes = new byte[0]; } return Response.ok(new ByteArrayInputStream(valueBytes), MediaType.APPLICATION_OCTET_STREAM).build(); }
Creates a response for a variable of type {@link ValueType#BYTES}.
responseForByteVariable
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/sub/impl/VariableResponseProvider.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/sub/impl/VariableResponseProvider.java
Apache-2.0
@Override public void updateComment(CommentDto comment) { ensureHistoryEnabled(Status.FORBIDDEN); ensureProcessInstanceExists(Status.NOT_FOUND); TaskService taskService = engine.getTaskService(); try { taskService.updateProcessInstanceComment(processInstanceId, comment.getId(), comment.getMessage()); } catch (AuthorizationException e) { throw e; } catch (NullValueException e) { throw new InvalidRequestException(Status.BAD_REQUEST, e.getMessage()); } }
Updates message for a given processInstanceId and commentId
updateComment
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/sub/runtime/impl/ProcessInstanceCommentResourceImpl.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/sub/runtime/impl/ProcessInstanceCommentResourceImpl.java
Apache-2.0
public static boolean setWebapp(String engineName, String webapp) { ProcessEngineProvider processEngineProvider = getProcessEngineProvider(); ManagementServiceImpl managementService = (ManagementServiceImpl) processEngineProvider.getProcessEngine(engineName).getManagementService(); return managementService.addWebappToTelemetry(webapp); }
Adds the web application name to the telemetry data of the engine. @param engineName the engine for which the web application usage should be indicated @param webapp the web application that is used with the engine @return whether the web application was successfully added or not
setWebapp
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/util/WebApplicationUtil.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/main/java/org/camunda/bpm/engine/rest/util/WebApplicationUtil.java
Apache-2.0
@Override public Object answer(InvocationOnMock invocation) throws Throwable { Class<?> returnType = invocation.getMethod().getReturnType(); Object mock = invocation.getMock(); if (returnType.isAssignableFrom(mock.getClass())) { return mock; } else { return null; } }
Default answer for Mockito mocks to always return themselves if the method return type matches. Can be used to mock fluent APIs more easily. @author Thorben Lindhauer
answer
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/helper/FluentAnswer.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/helper/FluentAnswer.java
Apache-2.0
public String getValue(String key) { if (!values.containsKey(key)) { String nextValue = String.format(valueFormat, counter++); values.put(key, nextValue); } return values.get(key); }
Generate distinct values based on a format string @author Thorben Lindhauer
getValue
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/helper/ValueGenerator.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/helper/ValueGenerator.java
Apache-2.0
public static String toExpectedValueTypeName(ValueType type) { String typeName = type.getName(); String expectedName = typeName.substring(0, 1).toUpperCase() + typeName.substring(1); return expectedName; }
The REST API is expected to return the variable's value type name in capitalized form.
toExpectedValueTypeName
java
camunda/camunda-bpm-platform
engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/helper/VariableTypeHelper.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest/src/test/java/org/camunda/bpm/engine/rest/helper/VariableTypeHelper.java
Apache-2.0
protected static void resolveVersions(Map<String, Object> templateData) { String version = TemplateParser.class.getPackage().getImplementationVersion(); if (version != null) { // cambpmVersion = 7.X.Y templateData.put("cambpmVersion", version); if (version.contains("SNAPSHOT")) { templateData.put("docsVersion", "develop"); } else if (version.contains("alpha")) { templateData.put("docsVersion", "latest"); } else { // docsVersion = 7.X templateData.put("docsVersion", version.substring(0, version.lastIndexOf("."))); } } else { // only for debug cases templateData.put("cambpmVersion", "develop"); templateData.put("docsVersion", "develop"); } }
Resolve the Camunda Platform version and the respective documentation version used in the links.
resolveVersions
java
camunda/camunda-bpm-platform
engine-rest/engine-rest-openapi-generator/src/main/java/org/camunda/bpm/engine/rest/openapi/generator/impl/TemplateParser.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest-openapi-generator/src/main/java/org/camunda/bpm/engine/rest/openapi/generator/impl/TemplateParser.java
Apache-2.0
protected static Map<String, String> resolveModels(String sourceDirectory) { File modelsDir = new File(sourceDirectory + "/models"); Collection<File> modelFiles = FileUtils.listFiles( modelsDir, new RegexFileFilter("^(.*?)"), DirectoryFileFilter.DIRECTORY ); Map<String, String> models = new TreeMap<>(); for (File file : modelFiles) { String modelName = FilenameUtils.removeExtension(file.getName()); String filePath = file.getAbsolutePath(); String modelPackage = filePath .substring(filePath.lastIndexOf("org"), filePath.lastIndexOf(File.separator)); models.put(modelName, modelPackage); } return models; }
@param sourceDirectory the template directory that stores the models @return a map of model name and file path to it, the map is ordered lexicographically by the model names
resolveModels
java
camunda/camunda-bpm-platform
engine-rest/engine-rest-openapi-generator/src/main/java/org/camunda/bpm/engine/rest/openapi/generator/impl/TemplateParser.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest-openapi-generator/src/main/java/org/camunda/bpm/engine/rest/openapi/generator/impl/TemplateParser.java
Apache-2.0
protected static Map<String, List<String>> resolvePaths(String sourceDirectory) { File endpointsDir = new File(sourceDirectory + "/paths"); int endpointStartAt = endpointsDir.getAbsolutePath().length(); Collection<File> endpointsFiles = FileUtils.listFiles( endpointsDir, new RegexFileFilter("^(.*?)"), DirectoryFileFilter.DIRECTORY ); Map<String, List<String>> endpoints = new TreeMap<>(); for (File file : endpointsFiles) { String endpointMethod = FilenameUtils.removeExtension(file.getName()); String filePath = file.getAbsolutePath(); String endpointPath = filePath .substring(endpointStartAt, filePath.lastIndexOf(File.separator)) .replace(File.separator, "/"); List<String> operations; if (endpoints.containsKey(endpointPath)) { operations = endpoints.get(endpointPath); operations.add(endpointMethod); } else { operations = new ArrayList<>(); operations.add(endpointMethod); endpoints.put(endpointPath, operations); } if(operations.size() > 1) { Collections.sort(operations); } } return endpoints; }
@param sourceDirectory the template directory that stores the endpoints @return a map of endpoint path and HTTP methods pairs, the map is ordered lexicographically by the endpoint paths the list of methods is ordered as well
resolvePaths
java
camunda/camunda-bpm-platform
engine-rest/engine-rest-openapi-generator/src/main/java/org/camunda/bpm/engine/rest/openapi/generator/impl/TemplateParser.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-rest/engine-rest-openapi-generator/src/main/java/org/camunda/bpm/engine/rest/openapi/generator/impl/TemplateParser.java
Apache-2.0
@Override protected ELResolver createElResolver() { CompositeELResolver compositeElResolver = new CompositeELResolver(); compositeElResolver.add(new VariableScopeElResolver()); compositeElResolver.add(new VariableContextElResolver()); compositeElResolver.add(new MockElResolver()); if(beans != null) { // Only expose limited set of beans in expressions compositeElResolver.add(new ReadOnlyMapELResolver(beans)); } else { // Expose full application-context in expressions compositeElResolver.add(new ApplicationContextElResolver(applicationContext)); } compositeElResolver.add(new ArrayELResolver()); compositeElResolver.add(new ListELResolver()); compositeElResolver.add(new MapELResolver()); compositeElResolver.add(new BeanELResolver()); return compositeElResolver; }
@param applicationContext the applicationContext to use. @see #SpringExpressionManager(ApplicationContext, Map)
createElResolver
java
camunda/camunda-bpm-platform
engine-spring/core/src/main/java/org/camunda/bpm/engine/spring/SpringExpressionManager.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-spring/core/src/main/java/org/camunda/bpm/engine/spring/SpringExpressionManager.java
Apache-2.0
protected Map<String, Object> processVariablesFromAnnotations(MethodInvocation invocation) throws Throwable { Map<ProcessVariable, Object> vars = this.mapOfAnnotationValues(ProcessVariable.class, invocation); Map<String, Object> varNameToValueMap = new HashMap<String, Object>(); for (ProcessVariable processVariable : vars.keySet()) { varNameToValueMap.put(processVariable.value(), vars.get(processVariable)); } return varNameToValueMap; }
if there any arguments with the {@link org.camunda.bpm.engine.annotations.ProcessVariable} annotation, then we feed those parameters into the business process @param invocation the invocation of the method as passed to the {@link org.aopalliance.intercept.MethodInterceptor#invoke(org.aopalliance.intercept.MethodInvocation)} method @return returns the map of process variables extracted from the parameters @throws Throwable thrown anything goes wrong
processVariablesFromAnnotations
java
camunda/camunda-bpm-platform
engine-spring/core/src/main/java/org/camunda/bpm/engine/spring/components/aop/ProcessStartingMethodInterceptor.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-spring/core/src/main/java/org/camunda/bpm/engine/spring/components/aop/ProcessStartingMethodInterceptor.java
Apache-2.0
@Override @SuppressWarnings("rawtypes") public boolean matches(Method method, Class targetClass) { if (AnnotationUtils.getAnnotation(method, this.annotationType) != null) { return true; } // The method may be on an interface, so let's check on the target class as well. Method specificMethod = AopUtils.getMostSpecificMethod(method, targetClass); return (specificMethod != method && (AnnotationUtils.getAnnotation(specificMethod, this.annotationType) != null)); }
Create a new AnnotationClassFilter for the given annotation type. @param annotationType the annotation type to look for
matches
java
camunda/camunda-bpm-platform
engine-spring/core/src/main/java/org/camunda/bpm/engine/spring/components/aop/util/MetaAnnotationMethodMatcher.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-spring/core/src/main/java/org/camunda/bpm/engine/spring/components/aop/util/MetaAnnotationMethodMatcher.java
Apache-2.0
public void init() { registerBeanDefinitionParser("annotation-driven", new ActivitiAnnotationDrivenBeanDefinitionParser()); }
responsible for providing <activiti:annotation-driven/> support. @author Josh Long @since 5.3
init
java
camunda/camunda-bpm-platform
engine-spring/core/src/main/java/org/camunda/bpm/engine/spring/components/config/xml/ActivitiNamespaceHandler.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-spring/core/src/main/java/org/camunda/bpm/engine/spring/components/config/xml/ActivitiNamespaceHandler.java
Apache-2.0
public TaskExecutor getTaskExecutor() { return taskExecutor; }
<p> This is a spring based implementation of the {@link JobExecutor} using spring abstraction {@link TaskExecutor} for performing background task execution. </p> <p> The idea behind this implementation is to externalize the configuration of the task executor, so it can leverage to Application servers controller thread pools, for example using the commonj API. The use of unmanaged thread in application servers is discouraged by the Java EE spec. </p> @author Pablo Ganga
getTaskExecutor
java
camunda/camunda-bpm-platform
engine-spring/core/src/main/java/org/camunda/bpm/engine/spring/components/jobexecutor/SpringJobExecutor.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-spring/core/src/main/java/org/camunda/bpm/engine/spring/components/jobexecutor/SpringJobExecutor.java
Apache-2.0
public void registerActivitiStateHandler( ActivitiStateHandlerRegistration registration) { String regKey = registrationKey(registration.getProcessName(), registration.getStateName()); this.registrations.put(regKey, registration); }
used at runtime to register state handlers as they are registered with the spring context @param registration the {@link org.camunda.bpm.engine.test.spring.components.registry.ActivitiStateHandlerRegistration}
registerActivitiStateHandler
java
camunda/camunda-bpm-platform
engine-spring/core/src/main/java/org/camunda/bpm/engine/spring/components/registry/ActivitiStateHandlerRegistry.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-spring/core/src/main/java/org/camunda/bpm/engine/spring/components/registry/ActivitiStateHandlerRegistry.java
Apache-2.0
public Collection<ActivitiStateHandlerRegistration> findRegistrationsForProcessAndState( String processName, String stateName) { Collection<ActivitiStateHandlerRegistration> registrationCollection = new ArrayList<ActivitiStateHandlerRegistration>(); String regKeyFull = registrationKey(processName, stateName); String regKeyWithJustState = registrationKey(null, stateName); for (String k : this.registrations.keySet()) if (k.contains(regKeyFull)) { registrationCollection.add(this.registrations.get(k)); } if (registrationCollection.size() == 0) { for (String k : this.registrations.keySet()) if (k.contains(regKeyWithJustState)) { registrationCollection.add(this.registrations.get(k)); } } return registrationCollection; }
this is responsible for looking up components in the registry and returning the appropriate handler based on specificity of the {@link org.camunda.bpm.engine.test.spring.components.registry.ActivitiStateHandlerRegistration} @param processName the process name to look for (optional) @param stateName the state name to look for (not optional) @return all matching options
findRegistrationsForProcessAndState
java
camunda/camunda-bpm-platform
engine-spring/core/src/main/java/org/camunda/bpm/engine/spring/components/registry/ActivitiStateHandlerRegistry.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-spring/core/src/main/java/org/camunda/bpm/engine/spring/components/registry/ActivitiStateHandlerRegistry.java
Apache-2.0
@Test public void testProcessApplicationDeployment() { // initially, no process engine is registered: Assert.assertNull(BpmPlatform.getDefaultProcessEngine()); Assert.assertEquals(0, BpmPlatform.getProcessEngineService().getProcessEngines().size()); // start spring application context AbstractApplicationContext applicationContext = new ClassPathXmlApplicationContext("org/camunda/bpm/engine/spring/test/container/ManagedProcessEngineFactoryBean-context.xml"); applicationContext.start(); // assert that now the process engine is registered: Assert.assertNotNull(BpmPlatform.getDefaultProcessEngine()); // close the spring application context applicationContext.close(); // after closing the application context, the process engine is gone Assert.assertNull(BpmPlatform.getDefaultProcessEngine()); Assert.assertEquals(0, BpmPlatform.getProcessEngineService().getProcessEngines().size()); }
<p>Testcase for {@link ManagedProcessEngineFactoryBean}</p> @author Daniel Meyer
testProcessApplicationDeployment
java
camunda/camunda-bpm-platform
engine-spring/core/src/test/java/org/camunda/bpm/engine/spring/test/container/ManagedProcessEngineFactoryBeanTest.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-spring/core/src/test/java/org/camunda/bpm/engine/spring/test/container/ManagedProcessEngineFactoryBeanTest.java
Apache-2.0
@Deployment(resources = { "org/camunda/bpm/engine/spring/test/expression/callactivity/CallActivityBasedOnSpringBeansExpressionTest.testCallActivityByExpression.bpmn20.xml", "org/camunda/bpm/engine/spring/test/expression/callactivity/simpleSubProcess.bpmn20.xml" }) public void testCallActivityByExpression() throws Exception { // Start process (main) ProcessInstance processInstance = runtimeService.startProcessInstanceByKey("testCallActivityByExpression"); // one task in the subprocess should be active after starting the process instance TaskQuery taskQuery = taskService.createTaskQuery(); Task taskBeforeSubProcess = taskQuery.singleResult(); assertEquals("Task before subprocess", taskBeforeSubProcess.getName()); // Completing the task continues the process which leads to calling the subprocess. The sub process we want to // call is passed in as a variable into this task taskService.complete(taskBeforeSubProcess.getId()); Task taskInSubProcess = taskQuery.singleResult(); assertEquals("Task in subprocess", taskInSubProcess.getName()); // Completing the task in the subprocess, finishes the subprocess taskService.complete(taskInSubProcess.getId()); Task taskAfterSubProcess = taskQuery.singleResult(); assertEquals("Task after subprocess", taskAfterSubProcess.getName()); // Completing this task end the process instance taskService.complete(taskAfterSubProcess.getId()); assertProcessEnded(processInstance.getId()); }
The CallActivityBasedOnSpringBeansExpressionTest is used to test dynamically wiring in the calledElement in the callActivity task. This test case helps verify that we do not have to hard code the sub process definition key within the process. @author Sang Venkatraman
testCallActivityByExpression
java
camunda/camunda-bpm-platform
engine-spring/core/src/test/java/org/camunda/bpm/engine/spring/test/expression/callactivity/CallActivityBasedOnSpringBeansExpressionTest.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-spring/core/src/test/java/org/camunda/bpm/engine/spring/test/expression/callactivity/CallActivityBasedOnSpringBeansExpressionTest.java
Apache-2.0
public String returnProcessDefinitionToCall() { //some business logic here return "simpleSubProcess"; }
The NextProcessExecutionEvaluator class provides the name of the sub process to be executed next. This allows us to test dynamically wire in the calledElement in the callActivity task. In an actual implementation there would be business logic here to determine which process to execute in the callActivity task. @author Sang Venkatraman
returnProcessDefinitionToCall
java
camunda/camunda-bpm-platform
engine-spring/core/src/test/java/org/camunda/bpm/engine/spring/test/expression/callactivity/NextProcessExecutionEvaluator.java
https://github.com/camunda/camunda-bpm-platform/blob/master/engine-spring/core/src/test/java/org/camunda/bpm/engine/spring/test/expression/callactivity/NextProcessExecutionEvaluator.java
Apache-2.0
public void contextInitialized(ServletContextEvent contextEvent) { String contextPath = contextEvent.getServletContext().getContextPath(); defaultEjbProcessApplication.getProperties().put(ProcessApplicationInfo.PROP_SERVLET_CONTEXT_PATH, contextPath); }
<p>Sets the ProcessApplicationInfo.PROP_SERVLET_CONTEXT_PATH property if this is deployed as part of a WebApplication.</p> @author Daniel Meyer
contextInitialized
java
camunda/camunda-bpm-platform
javaee/ejb-client/src/main/java/org/camunda/bpm/application/impl/web/ProcessArchiveServletContextListener.java
https://github.com/camunda/camunda-bpm-platform/blob/master/javaee/ejb-client/src/main/java/org/camunda/bpm/application/impl/web/ProcessArchiveServletContextListener.java
Apache-2.0
public JobFailureCollector executeJob(String job, CommandExecutor commandExecutor) { JobFailureCollector jobFailureCollector = new JobFailureCollector(job); ExecuteJobHelper.executeJob(job, commandExecutor, jobFailureCollector, new ExecuteJobsCmd(job, jobFailureCollector)); return jobFailureCollector; }
<p>MessageDrivenBean implementation of the {@link JobExecutionHandler} interface</p> @author Daniel Meyer
executeJob
java
camunda/camunda-bpm-platform
javaee/ejb-service/src/main/java/org/camunda/bpm/container/impl/ejb/JobExecutionHandlerMDB.java
https://github.com/camunda/camunda-bpm-platform/blob/master/javaee/ejb-service/src/main/java/org/camunda/bpm/container/impl/ejb/JobExecutionHandlerMDB.java
Apache-2.0