id
int32
0
165k
repo
stringlengths
7
58
path
stringlengths
12
218
func_name
stringlengths
3
140
original_string
stringlengths
73
34.1k
language
stringclasses
1 value
code
stringlengths
73
34.1k
code_tokens
list
docstring
stringlengths
3
16k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
105
339
16,400
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java
PvmExecutionImpl.setParent
@SuppressWarnings("unchecked") public void setParent(PvmExecutionImpl parent) { PvmExecutionImpl currentParent = getParent(); setParentExecution(parent); if (currentParent != null) { currentParent.getExecutions().remove(this); } if (parent != null) { ((List<PvmExecutionImpl>) parent.getExecutions()).add(this); } }
java
@SuppressWarnings("unchecked") public void setParent(PvmExecutionImpl parent) { PvmExecutionImpl currentParent = getParent(); setParentExecution(parent); if (currentParent != null) { currentParent.getExecutions().remove(this); } if (parent != null) { ((List<PvmExecutionImpl>) parent.getExecutions()).add(this); } }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "void", "setParent", "(", "PvmExecutionImpl", "parent", ")", "{", "PvmExecutionImpl", "currentParent", "=", "getParent", "(", ")", ";", "setParentExecution", "(", "parent", ")", ";", "if", "(", "currentParent", "!=", "null", ")", "{", "currentParent", ".", "getExecutions", "(", ")", ".", "remove", "(", "this", ")", ";", "}", "if", "(", "parent", "!=", "null", ")", "{", "(", "(", "List", "<", "PvmExecutionImpl", ">", ")", "parent", ".", "getExecutions", "(", ")", ")", ".", "add", "(", "this", ")", ";", "}", "}" ]
Sets the execution's parent and updates the old and new parents' set of child executions
[ "Sets", "the", "execution", "s", "parent", "and", "updates", "the", "old", "and", "new", "parents", "set", "of", "child", "executions" ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java#L1309-L1322
16,401
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java
PvmExecutionImpl.delayEvent
public void delayEvent(PvmExecutionImpl targetScope, VariableEvent variableEvent) { DelayedVariableEvent delayedVariableEvent = new DelayedVariableEvent(targetScope, variableEvent); delayEvent(delayedVariableEvent); }
java
public void delayEvent(PvmExecutionImpl targetScope, VariableEvent variableEvent) { DelayedVariableEvent delayedVariableEvent = new DelayedVariableEvent(targetScope, variableEvent); delayEvent(delayedVariableEvent); }
[ "public", "void", "delayEvent", "(", "PvmExecutionImpl", "targetScope", ",", "VariableEvent", "variableEvent", ")", "{", "DelayedVariableEvent", "delayedVariableEvent", "=", "new", "DelayedVariableEvent", "(", "targetScope", ",", "variableEvent", ")", ";", "delayEvent", "(", "delayedVariableEvent", ")", ";", "}" ]
Delays a given variable event with the given target scope. @param targetScope the target scope of the variable event @param variableEvent the variable event which should be delayed
[ "Delays", "a", "given", "variable", "event", "with", "the", "given", "target", "scope", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java#L1866-L1869
16,402
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java
PvmExecutionImpl.delayEvent
public void delayEvent(DelayedVariableEvent delayedVariableEvent) { //if process definition has no conditional events the variable events does not have to be delayed Boolean hasConditionalEvents = this.getProcessDefinition().getProperties().get(BpmnProperties.HAS_CONDITIONAL_EVENTS); if (hasConditionalEvents == null || !hasConditionalEvents.equals(Boolean.TRUE)) { return; } if (isProcessInstanceExecution()) { delayedEvents.add(delayedVariableEvent); } else { getProcessInstance().delayEvent(delayedVariableEvent); } }
java
public void delayEvent(DelayedVariableEvent delayedVariableEvent) { //if process definition has no conditional events the variable events does not have to be delayed Boolean hasConditionalEvents = this.getProcessDefinition().getProperties().get(BpmnProperties.HAS_CONDITIONAL_EVENTS); if (hasConditionalEvents == null || !hasConditionalEvents.equals(Boolean.TRUE)) { return; } if (isProcessInstanceExecution()) { delayedEvents.add(delayedVariableEvent); } else { getProcessInstance().delayEvent(delayedVariableEvent); } }
[ "public", "void", "delayEvent", "(", "DelayedVariableEvent", "delayedVariableEvent", ")", "{", "//if process definition has no conditional events the variable events does not have to be delayed", "Boolean", "hasConditionalEvents", "=", "this", ".", "getProcessDefinition", "(", ")", ".", "getProperties", "(", ")", ".", "get", "(", "BpmnProperties", ".", "HAS_CONDITIONAL_EVENTS", ")", ";", "if", "(", "hasConditionalEvents", "==", "null", "||", "!", "hasConditionalEvents", ".", "equals", "(", "Boolean", ".", "TRUE", ")", ")", "{", "return", ";", "}", "if", "(", "isProcessInstanceExecution", "(", ")", ")", "{", "delayedEvents", ".", "add", "(", "delayedVariableEvent", ")", ";", "}", "else", "{", "getProcessInstance", "(", ")", ".", "delayEvent", "(", "delayedVariableEvent", ")", ";", "}", "}" ]
Delays and stores the given DelayedVariableEvent on the process instance. @param delayedVariableEvent the DelayedVariableEvent which should be store on the process instance
[ "Delays", "and", "stores", "the", "given", "DelayedVariableEvent", "on", "the", "process", "instance", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java#L1876-L1889
16,403
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java
PvmExecutionImpl.continueIfExecutionDoesNotAffectNextOperation
public void continueIfExecutionDoesNotAffectNextOperation(Callback<PvmExecutionImpl, Void> dispatching, Callback<PvmExecutionImpl, Void> continuation, PvmExecutionImpl execution) { String lastActivityId = execution.getActivityId(); String lastActivityInstanceId = getActivityInstanceId(execution); dispatching.callback(execution); execution = execution.getReplacedBy() != null ? execution.getReplacedBy() : execution; String currentActivityInstanceId = getActivityInstanceId(execution); String currentActivityId = execution.getActivityId(); //if execution was canceled or was changed during the dispatch we should not execute the next operation //since another atomic operation was executed during the dispatching if (!execution.isCanceled() && isOnSameActivity(lastActivityInstanceId, lastActivityId, currentActivityInstanceId, currentActivityId)) { continuation.callback(execution); } }
java
public void continueIfExecutionDoesNotAffectNextOperation(Callback<PvmExecutionImpl, Void> dispatching, Callback<PvmExecutionImpl, Void> continuation, PvmExecutionImpl execution) { String lastActivityId = execution.getActivityId(); String lastActivityInstanceId = getActivityInstanceId(execution); dispatching.callback(execution); execution = execution.getReplacedBy() != null ? execution.getReplacedBy() : execution; String currentActivityInstanceId = getActivityInstanceId(execution); String currentActivityId = execution.getActivityId(); //if execution was canceled or was changed during the dispatch we should not execute the next operation //since another atomic operation was executed during the dispatching if (!execution.isCanceled() && isOnSameActivity(lastActivityInstanceId, lastActivityId, currentActivityInstanceId, currentActivityId)) { continuation.callback(execution); } }
[ "public", "void", "continueIfExecutionDoesNotAffectNextOperation", "(", "Callback", "<", "PvmExecutionImpl", ",", "Void", ">", "dispatching", ",", "Callback", "<", "PvmExecutionImpl", ",", "Void", ">", "continuation", ",", "PvmExecutionImpl", "execution", ")", "{", "String", "lastActivityId", "=", "execution", ".", "getActivityId", "(", ")", ";", "String", "lastActivityInstanceId", "=", "getActivityInstanceId", "(", "execution", ")", ";", "dispatching", ".", "callback", "(", "execution", ")", ";", "execution", "=", "execution", ".", "getReplacedBy", "(", ")", "!=", "null", "?", "execution", ".", "getReplacedBy", "(", ")", ":", "execution", ";", "String", "currentActivityInstanceId", "=", "getActivityInstanceId", "(", "execution", ")", ";", "String", "currentActivityId", "=", "execution", ".", "getActivityId", "(", ")", ";", "//if execution was canceled or was changed during the dispatch we should not execute the next operation", "//since another atomic operation was executed during the dispatching", "if", "(", "!", "execution", ".", "isCanceled", "(", ")", "&&", "isOnSameActivity", "(", "lastActivityInstanceId", ",", "lastActivityId", ",", "currentActivityInstanceId", ",", "currentActivityId", ")", ")", "{", "continuation", ".", "callback", "(", "execution", ")", ";", "}", "}" ]
Executes the given depending operations with the given execution. The execution state will be checked with the help of the activity instance id and activity id of the execution before and after the dispatching callback call. If the id's are not changed the continuation callback is called. @param dispatching the callback to dispatch the variable events @param continuation the callback to continue with the next atomic operation @param execution the execution which is used for the execution
[ "Executes", "the", "given", "depending", "operations", "with", "the", "given", "execution", ".", "The", "execution", "state", "will", "be", "checked", "with", "the", "help", "of", "the", "activity", "instance", "id", "and", "activity", "id", "of", "the", "execution", "before", "and", "after", "the", "dispatching", "callback", "call", ".", "If", "the", "id", "s", "are", "not", "changed", "the", "continuation", "callback", "is", "called", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java#L1970-L1988
16,404
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java
PvmExecutionImpl.dispatchScopeEvents
protected void dispatchScopeEvents(PvmExecutionImpl execution) { PvmExecutionImpl scopeExecution = execution.isScope() ? execution : execution.getParent(); List<DelayedVariableEvent> delayedEvents = new ArrayList<>(scopeExecution.getDelayedEvents()); scopeExecution.clearDelayedEvents(); Map<PvmExecutionImpl, String> activityInstanceIds = new HashMap<>(); Map<PvmExecutionImpl, String> activityIds = new HashMap<>(); initActivityIds(delayedEvents, activityInstanceIds, activityIds); //For each delayed variable event we have to check if the delayed event can be dispatched, //the check will be done with the help of the activity id and activity instance id. //That means it will be checked if the dispatching changed the execution tree in a way that we can't dispatch the //the other delayed variable events. We have to check the target scope with the last activity id and activity instance id //and also the replace pointer if it exist. Because on concurrency the replace pointer will be set on which we have //to check the latest state. for (DelayedVariableEvent event : delayedEvents) { PvmExecutionImpl targetScope = event.getTargetScope(); PvmExecutionImpl replaced = targetScope.getReplacedBy() != null ? targetScope.getReplacedBy() : targetScope; dispatchOnSameActivity(targetScope, replaced, activityIds, activityInstanceIds, event); } }
java
protected void dispatchScopeEvents(PvmExecutionImpl execution) { PvmExecutionImpl scopeExecution = execution.isScope() ? execution : execution.getParent(); List<DelayedVariableEvent> delayedEvents = new ArrayList<>(scopeExecution.getDelayedEvents()); scopeExecution.clearDelayedEvents(); Map<PvmExecutionImpl, String> activityInstanceIds = new HashMap<>(); Map<PvmExecutionImpl, String> activityIds = new HashMap<>(); initActivityIds(delayedEvents, activityInstanceIds, activityIds); //For each delayed variable event we have to check if the delayed event can be dispatched, //the check will be done with the help of the activity id and activity instance id. //That means it will be checked if the dispatching changed the execution tree in a way that we can't dispatch the //the other delayed variable events. We have to check the target scope with the last activity id and activity instance id //and also the replace pointer if it exist. Because on concurrency the replace pointer will be set on which we have //to check the latest state. for (DelayedVariableEvent event : delayedEvents) { PvmExecutionImpl targetScope = event.getTargetScope(); PvmExecutionImpl replaced = targetScope.getReplacedBy() != null ? targetScope.getReplacedBy() : targetScope; dispatchOnSameActivity(targetScope, replaced, activityIds, activityInstanceIds, event); } }
[ "protected", "void", "dispatchScopeEvents", "(", "PvmExecutionImpl", "execution", ")", "{", "PvmExecutionImpl", "scopeExecution", "=", "execution", ".", "isScope", "(", ")", "?", "execution", ":", "execution", ".", "getParent", "(", ")", ";", "List", "<", "DelayedVariableEvent", ">", "delayedEvents", "=", "new", "ArrayList", "<>", "(", "scopeExecution", ".", "getDelayedEvents", "(", ")", ")", ";", "scopeExecution", ".", "clearDelayedEvents", "(", ")", ";", "Map", "<", "PvmExecutionImpl", ",", "String", ">", "activityInstanceIds", "=", "new", "HashMap", "<>", "(", ")", ";", "Map", "<", "PvmExecutionImpl", ",", "String", ">", "activityIds", "=", "new", "HashMap", "<>", "(", ")", ";", "initActivityIds", "(", "delayedEvents", ",", "activityInstanceIds", ",", "activityIds", ")", ";", "//For each delayed variable event we have to check if the delayed event can be dispatched,", "//the check will be done with the help of the activity id and activity instance id.", "//That means it will be checked if the dispatching changed the execution tree in a way that we can't dispatch the", "//the other delayed variable events. We have to check the target scope with the last activity id and activity instance id", "//and also the replace pointer if it exist. Because on concurrency the replace pointer will be set on which we have", "//to check the latest state.", "for", "(", "DelayedVariableEvent", "event", ":", "delayedEvents", ")", "{", "PvmExecutionImpl", "targetScope", "=", "event", ".", "getTargetScope", "(", ")", ";", "PvmExecutionImpl", "replaced", "=", "targetScope", ".", "getReplacedBy", "(", ")", "!=", "null", "?", "targetScope", ".", "getReplacedBy", "(", ")", ":", "targetScope", ";", "dispatchOnSameActivity", "(", "targetScope", ",", "replaced", ",", "activityIds", ",", "activityInstanceIds", ",", "event", ")", ";", "}", "}" ]
Dispatches the current delayed variable events on the scope of the given execution. @param execution the execution on which scope the delayed variable should be dispatched
[ "Dispatches", "the", "current", "delayed", "variable", "events", "on", "the", "scope", "of", "the", "given", "execution", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java#L2001-L2022
16,405
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java
PvmExecutionImpl.initActivityIds
protected void initActivityIds(List<DelayedVariableEvent> delayedEvents, Map<PvmExecutionImpl, String> activityInstanceIds, Map<PvmExecutionImpl, String> activityIds) { for (DelayedVariableEvent event : delayedEvents) { PvmExecutionImpl targetScope = event.getTargetScope(); String targetScopeActivityInstanceId = getActivityInstanceId(targetScope); activityInstanceIds.put(targetScope, targetScopeActivityInstanceId); activityIds.put(targetScope, targetScope.getActivityId()); } }
java
protected void initActivityIds(List<DelayedVariableEvent> delayedEvents, Map<PvmExecutionImpl, String> activityInstanceIds, Map<PvmExecutionImpl, String> activityIds) { for (DelayedVariableEvent event : delayedEvents) { PvmExecutionImpl targetScope = event.getTargetScope(); String targetScopeActivityInstanceId = getActivityInstanceId(targetScope); activityInstanceIds.put(targetScope, targetScopeActivityInstanceId); activityIds.put(targetScope, targetScope.getActivityId()); } }
[ "protected", "void", "initActivityIds", "(", "List", "<", "DelayedVariableEvent", ">", "delayedEvents", ",", "Map", "<", "PvmExecutionImpl", ",", "String", ">", "activityInstanceIds", ",", "Map", "<", "PvmExecutionImpl", ",", "String", ">", "activityIds", ")", "{", "for", "(", "DelayedVariableEvent", "event", ":", "delayedEvents", ")", "{", "PvmExecutionImpl", "targetScope", "=", "event", ".", "getTargetScope", "(", ")", ";", "String", "targetScopeActivityInstanceId", "=", "getActivityInstanceId", "(", "targetScope", ")", ";", "activityInstanceIds", ".", "put", "(", "targetScope", ",", "targetScopeActivityInstanceId", ")", ";", "activityIds", ".", "put", "(", "targetScope", ",", "targetScope", ".", "getActivityId", "(", ")", ")", ";", "}", "}" ]
Initializes the given maps with the target scopes and current activity id's and activity instance id's. @param delayedEvents the delayed events which contains the information about the target scope @param activityInstanceIds the map which maps target scope to activity instance id @param activityIds the map which maps target scope to activity id
[ "Initializes", "the", "given", "maps", "with", "the", "target", "scopes", "and", "current", "activity", "id", "s", "and", "activity", "instance", "id", "s", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java#L2031-L2042
16,406
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java
PvmExecutionImpl.isOnDispatchableState
private boolean isOnDispatchableState(PvmExecutionImpl targetScope) { ActivityImpl targetActivity = targetScope.getActivity(); return //if not leaf, activity id is null -> dispatchable targetScope.getActivityId() == null || // if leaf and not scope -> dispatchable !targetActivity.isScope() || // if leaf, scope and state in default -> dispatchable (targetScope.isInState(ActivityInstanceState.DEFAULT)); }
java
private boolean isOnDispatchableState(PvmExecutionImpl targetScope) { ActivityImpl targetActivity = targetScope.getActivity(); return //if not leaf, activity id is null -> dispatchable targetScope.getActivityId() == null || // if leaf and not scope -> dispatchable !targetActivity.isScope() || // if leaf, scope and state in default -> dispatchable (targetScope.isInState(ActivityInstanceState.DEFAULT)); }
[ "private", "boolean", "isOnDispatchableState", "(", "PvmExecutionImpl", "targetScope", ")", "{", "ActivityImpl", "targetActivity", "=", "targetScope", ".", "getActivity", "(", ")", ";", "return", "//if not leaf, activity id is null -> dispatchable", "targetScope", ".", "getActivityId", "(", ")", "==", "null", "||", "// if leaf and not scope -> dispatchable", "!", "targetActivity", ".", "isScope", "(", ")", "||", "// if leaf, scope and state in default -> dispatchable", "(", "targetScope", ".", "isInState", "(", "ActivityInstanceState", ".", "DEFAULT", ")", ")", ";", "}" ]
Checks if the given execution is on a dispatchable state. That means if the current activity is not a leaf in the activity tree OR it is a leaf but not a scope OR it is a leaf, a scope and the execution is in state DEFAULT, which means not in state Starting, Execute or Ending. For this states it is prohibited to trigger conditional events, otherwise unexpected behavior can appear. @return true if the execution is on a dispatchable state, false otherwise
[ "Checks", "if", "the", "given", "execution", "is", "on", "a", "dispatchable", "state", ".", "That", "means", "if", "the", "current", "activity", "is", "not", "a", "leaf", "in", "the", "activity", "tree", "OR", "it", "is", "a", "leaf", "but", "not", "a", "scope", "OR", "it", "is", "a", "leaf", "a", "scope", "and", "the", "execution", "is", "in", "state", "DEFAULT", "which", "means", "not", "in", "state", "Starting", "Execute", "or", "Ending", ".", "For", "this", "states", "it", "is", "prohibited", "to", "trigger", "conditional", "events", "otherwise", "unexpected", "behavior", "can", "appear", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java#L2092-L2101
16,407
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java
PvmExecutionImpl.isOnSameActivity
private boolean isOnSameActivity(String lastActivityInstanceId, String lastActivityId, String currentActivityInstanceId, String currentActivityId) { return //activityInstanceId's can be null on transitions, so the activityId must be equal ((lastActivityInstanceId == null && lastActivityInstanceId == currentActivityInstanceId && lastActivityId.equals(currentActivityId)) //if activityInstanceId's are not null they must be equal -> otherwise execution changed || (lastActivityInstanceId != null && lastActivityInstanceId.equals(currentActivityInstanceId) && (lastActivityId == null || lastActivityId.equals(currentActivityId)))); }
java
private boolean isOnSameActivity(String lastActivityInstanceId, String lastActivityId, String currentActivityInstanceId, String currentActivityId) { return //activityInstanceId's can be null on transitions, so the activityId must be equal ((lastActivityInstanceId == null && lastActivityInstanceId == currentActivityInstanceId && lastActivityId.equals(currentActivityId)) //if activityInstanceId's are not null they must be equal -> otherwise execution changed || (lastActivityInstanceId != null && lastActivityInstanceId.equals(currentActivityInstanceId) && (lastActivityId == null || lastActivityId.equals(currentActivityId)))); }
[ "private", "boolean", "isOnSameActivity", "(", "String", "lastActivityInstanceId", ",", "String", "lastActivityId", ",", "String", "currentActivityInstanceId", ",", "String", "currentActivityId", ")", "{", "return", "//activityInstanceId's can be null on transitions, so the activityId must be equal", "(", "(", "lastActivityInstanceId", "==", "null", "&&", "lastActivityInstanceId", "==", "currentActivityInstanceId", "&&", "lastActivityId", ".", "equals", "(", "currentActivityId", ")", ")", "//if activityInstanceId's are not null they must be equal -> otherwise execution changed", "||", "(", "lastActivityInstanceId", "!=", "null", "&&", "lastActivityInstanceId", ".", "equals", "(", "currentActivityInstanceId", ")", "&&", "(", "lastActivityId", "==", "null", "||", "lastActivityId", ".", "equals", "(", "currentActivityId", ")", ")", ")", ")", ";", "}" ]
Compares the given activity instance id's and activity id's to check if the execution is on the same activity as before an operation was executed. The activity instance id's can be null on transitions. In this case the activity Id's have to be equal, otherwise the execution changed. @param lastActivityInstanceId the last activity instance id @param lastActivityId the last activity id @param currentActivityInstanceId the current activity instance id @param currentActivityId the current activity id @return true if the execution is on the same activity, otherwise false
[ "Compares", "the", "given", "activity", "instance", "id", "s", "and", "activity", "id", "s", "to", "check", "if", "the", "execution", "is", "on", "the", "same", "activity", "as", "before", "an", "operation", "was", "executed", ".", "The", "activity", "instance", "id", "s", "can", "be", "null", "on", "transitions", ".", "In", "this", "case", "the", "activity", "Id", "s", "have", "to", "be", "equal", "otherwise", "the", "execution", "changed", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java#L2115-L2124
16,408
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java
PvmExecutionImpl.getActivityInstanceId
private String getActivityInstanceId(PvmExecutionImpl targetScope) { if (targetScope.isConcurrent()) { return targetScope.getActivityInstanceId(); } else { ActivityImpl targetActivity = targetScope.getActivity(); if ((targetActivity != null && targetActivity.getActivities().isEmpty())) { return targetScope.getActivityInstanceId(); } else { return targetScope.getParentActivityInstanceId(); } } }
java
private String getActivityInstanceId(PvmExecutionImpl targetScope) { if (targetScope.isConcurrent()) { return targetScope.getActivityInstanceId(); } else { ActivityImpl targetActivity = targetScope.getActivity(); if ((targetActivity != null && targetActivity.getActivities().isEmpty())) { return targetScope.getActivityInstanceId(); } else { return targetScope.getParentActivityInstanceId(); } } }
[ "private", "String", "getActivityInstanceId", "(", "PvmExecutionImpl", "targetScope", ")", "{", "if", "(", "targetScope", ".", "isConcurrent", "(", ")", ")", "{", "return", "targetScope", ".", "getActivityInstanceId", "(", ")", ";", "}", "else", "{", "ActivityImpl", "targetActivity", "=", "targetScope", ".", "getActivity", "(", ")", ";", "if", "(", "(", "targetActivity", "!=", "null", "&&", "targetActivity", ".", "getActivities", "(", ")", ".", "isEmpty", "(", ")", ")", ")", "{", "return", "targetScope", ".", "getActivityInstanceId", "(", ")", ";", "}", "else", "{", "return", "targetScope", ".", "getParentActivityInstanceId", "(", ")", ";", "}", "}", "}" ]
Returns the activity instance id for the given execution. @param targetScope the execution for which the activity instance id should be returned @return the activity instance id
[ "Returns", "the", "activity", "instance", "id", "for", "the", "given", "execution", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java#L2132-L2143
16,409
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java
PvmExecutionImpl.resolveIncident
@Override public void resolveIncident(final String incidentId) { IncidentEntity incident = (IncidentEntity) Context .getCommandContext() .getIncidentManager() .findIncidentById(incidentId); IncidentHandler incidentHandler = findIncidentHandler(incident.getIncidentType()); if (incidentHandler == null) { incidentHandler = new DefaultIncidentHandler(incident.getIncidentType()); } IncidentContext incidentContext = new IncidentContext(incident); incidentHandler.resolveIncident(incidentContext); }
java
@Override public void resolveIncident(final String incidentId) { IncidentEntity incident = (IncidentEntity) Context .getCommandContext() .getIncidentManager() .findIncidentById(incidentId); IncidentHandler incidentHandler = findIncidentHandler(incident.getIncidentType()); if (incidentHandler == null) { incidentHandler = new DefaultIncidentHandler(incident.getIncidentType()); } IncidentContext incidentContext = new IncidentContext(incident); incidentHandler.resolveIncident(incidentContext); }
[ "@", "Override", "public", "void", "resolveIncident", "(", "final", "String", "incidentId", ")", "{", "IncidentEntity", "incident", "=", "(", "IncidentEntity", ")", "Context", ".", "getCommandContext", "(", ")", ".", "getIncidentManager", "(", ")", ".", "findIncidentById", "(", "incidentId", ")", ";", "IncidentHandler", "incidentHandler", "=", "findIncidentHandler", "(", "incident", ".", "getIncidentType", "(", ")", ")", ";", "if", "(", "incidentHandler", "==", "null", ")", "{", "incidentHandler", "=", "new", "DefaultIncidentHandler", "(", "incident", ".", "getIncidentType", "(", ")", ")", ";", "}", "IncidentContext", "incidentContext", "=", "new", "IncidentContext", "(", "incident", ")", ";", "incidentHandler", ".", "resolveIncident", "(", "incidentContext", ")", ";", "}" ]
Resolves an incident with given id. @param incidentId
[ "Resolves", "an", "incident", "with", "given", "id", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/PvmExecutionImpl.java#L2180-L2194
16,410
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/history/producer/CacheAwareHistoryEventProducer.java
CacheAwareHistoryEventProducer.findInCache
protected <T extends HistoryEvent> T findInCache(Class<T> type, String id) { return Context.getCommandContext() .getDbEntityManager() .getCachedEntity(type, id); }
java
protected <T extends HistoryEvent> T findInCache(Class<T> type, String id) { return Context.getCommandContext() .getDbEntityManager() .getCachedEntity(type, id); }
[ "protected", "<", "T", "extends", "HistoryEvent", ">", "T", "findInCache", "(", "Class", "<", "T", ">", "type", ",", "String", "id", ")", "{", "return", "Context", ".", "getCommandContext", "(", ")", ".", "getDbEntityManager", "(", ")", ".", "getCachedEntity", "(", "type", ",", "id", ")", ";", "}" ]
find a cached entity by primary key
[ "find", "a", "cached", "entity", "by", "primary", "key" ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/history/producer/CacheAwareHistoryEventProducer.java#L111-L115
16,411
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java
LegacyBehavior.getScopeExecution
public static PvmExecutionImpl getScopeExecution(ScopeImpl scope, Map<ScopeImpl, PvmExecutionImpl> activityExecutionMapping) { ScopeImpl flowScope = scope.getFlowScope(); return activityExecutionMapping.get(flowScope); }
java
public static PvmExecutionImpl getScopeExecution(ScopeImpl scope, Map<ScopeImpl, PvmExecutionImpl> activityExecutionMapping) { ScopeImpl flowScope = scope.getFlowScope(); return activityExecutionMapping.get(flowScope); }
[ "public", "static", "PvmExecutionImpl", "getScopeExecution", "(", "ScopeImpl", "scope", ",", "Map", "<", "ScopeImpl", ",", "PvmExecutionImpl", ">", "activityExecutionMapping", ")", "{", "ScopeImpl", "flowScope", "=", "scope", ".", "getFlowScope", "(", ")", ";", "return", "activityExecutionMapping", ".", "get", "(", "flowScope", ")", ";", "}" ]
In case the process instance was migrated from a previous version, activities which are now parsed as scopes do not have scope executions. Use the flow scopes of these activities in order to find their execution. - For an event subprocess this is the scope execution of the scope in which the event subprocess is embeded in - For a multi instance sequential subprocess this is the multi instace scope body. @param scope @param activityExecutionMapping @return
[ "In", "case", "the", "process", "instance", "was", "migrated", "from", "a", "previous", "version", "activities", "which", "are", "now", "parsed", "as", "scopes", "do", "not", "have", "scope", "executions", ".", "Use", "the", "flow", "scopes", "of", "these", "activities", "in", "order", "to", "find", "their", "execution", ".", "-", "For", "an", "event", "subprocess", "this", "is", "the", "scope", "execution", "of", "the", "scope", "in", "which", "the", "event", "subprocess", "is", "embeded", "in", "-", "For", "a", "multi", "instance", "sequential", "subprocess", "this", "is", "the", "multi", "instace", "scope", "body", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java#L231-L234
16,412
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java
LegacyBehavior.createActivityExecutionMapping
public static Map<ScopeImpl, PvmExecutionImpl> createActivityExecutionMapping(List<PvmExecutionImpl> scopeExecutions, List<ScopeImpl> scopes) { PvmExecutionImpl deepestExecution = scopeExecutions.get(0); if (isLegacyAsyncAtMultiInstance(deepestExecution)) { // in case the deepest execution is in fact async at multi-instance, the multi instance body is part // of the list of scopes, however it is not instantiated yet or has already ended. Thus it must be removed. scopes.remove(0); } // The trees are out of sync. // We are missing executions: int numOfMissingExecutions = scopes.size() - scopeExecutions.size(); // We need to find out which executions are missing. // Consider: elements which did not use to be scopes are now scopes. // But, this does not mean that all instances of elements which became scopes // are missing their executions. We could have created new instances in the // lower part of the tree after legacy behavior was turned off while instances of these elements // further up the hierarchy miss scopes. So we need to iterate from the top down and skip all scopes which // were not scopes before: Collections.reverse(scopeExecutions); Collections.reverse(scopes); Map<ScopeImpl, PvmExecutionImpl> mapping = new HashMap<ScopeImpl, PvmExecutionImpl>(); // process definition / process instance. mapping.put(scopes.get(0), scopeExecutions.get(0)); // nested activities int executionCounter = 0; for(int i = 1; i < scopes.size(); i++) { ActivityImpl scope = (ActivityImpl) scopes.get(i); PvmExecutionImpl scopeExecutionCandidate = null; if (executionCounter + 1 < scopeExecutions.size()) { scopeExecutionCandidate = scopeExecutions.get(executionCounter + 1); } if(numOfMissingExecutions > 0 && wasNoScope(scope, scopeExecutionCandidate)) { // found a missing scope numOfMissingExecutions--; } else { executionCounter++; } if (executionCounter >= scopeExecutions.size()) { throw new ProcessEngineException("Cannot construct activity-execution mapping: there are " + "more scope executions missing than explained by the flow scope hierarchy."); } PvmExecutionImpl execution = scopeExecutions.get(executionCounter); mapping.put(scope, execution); } return mapping; }
java
public static Map<ScopeImpl, PvmExecutionImpl> createActivityExecutionMapping(List<PvmExecutionImpl> scopeExecutions, List<ScopeImpl> scopes) { PvmExecutionImpl deepestExecution = scopeExecutions.get(0); if (isLegacyAsyncAtMultiInstance(deepestExecution)) { // in case the deepest execution is in fact async at multi-instance, the multi instance body is part // of the list of scopes, however it is not instantiated yet or has already ended. Thus it must be removed. scopes.remove(0); } // The trees are out of sync. // We are missing executions: int numOfMissingExecutions = scopes.size() - scopeExecutions.size(); // We need to find out which executions are missing. // Consider: elements which did not use to be scopes are now scopes. // But, this does not mean that all instances of elements which became scopes // are missing their executions. We could have created new instances in the // lower part of the tree after legacy behavior was turned off while instances of these elements // further up the hierarchy miss scopes. So we need to iterate from the top down and skip all scopes which // were not scopes before: Collections.reverse(scopeExecutions); Collections.reverse(scopes); Map<ScopeImpl, PvmExecutionImpl> mapping = new HashMap<ScopeImpl, PvmExecutionImpl>(); // process definition / process instance. mapping.put(scopes.get(0), scopeExecutions.get(0)); // nested activities int executionCounter = 0; for(int i = 1; i < scopes.size(); i++) { ActivityImpl scope = (ActivityImpl) scopes.get(i); PvmExecutionImpl scopeExecutionCandidate = null; if (executionCounter + 1 < scopeExecutions.size()) { scopeExecutionCandidate = scopeExecutions.get(executionCounter + 1); } if(numOfMissingExecutions > 0 && wasNoScope(scope, scopeExecutionCandidate)) { // found a missing scope numOfMissingExecutions--; } else { executionCounter++; } if (executionCounter >= scopeExecutions.size()) { throw new ProcessEngineException("Cannot construct activity-execution mapping: there are " + "more scope executions missing than explained by the flow scope hierarchy."); } PvmExecutionImpl execution = scopeExecutions.get(executionCounter); mapping.put(scope, execution); } return mapping; }
[ "public", "static", "Map", "<", "ScopeImpl", ",", "PvmExecutionImpl", ">", "createActivityExecutionMapping", "(", "List", "<", "PvmExecutionImpl", ">", "scopeExecutions", ",", "List", "<", "ScopeImpl", ">", "scopes", ")", "{", "PvmExecutionImpl", "deepestExecution", "=", "scopeExecutions", ".", "get", "(", "0", ")", ";", "if", "(", "isLegacyAsyncAtMultiInstance", "(", "deepestExecution", ")", ")", "{", "// in case the deepest execution is in fact async at multi-instance, the multi instance body is part", "// of the list of scopes, however it is not instantiated yet or has already ended. Thus it must be removed.", "scopes", ".", "remove", "(", "0", ")", ";", "}", "// The trees are out of sync.", "// We are missing executions:", "int", "numOfMissingExecutions", "=", "scopes", ".", "size", "(", ")", "-", "scopeExecutions", ".", "size", "(", ")", ";", "// We need to find out which executions are missing.", "// Consider: elements which did not use to be scopes are now scopes.", "// But, this does not mean that all instances of elements which became scopes", "// are missing their executions. We could have created new instances in the", "// lower part of the tree after legacy behavior was turned off while instances of these elements", "// further up the hierarchy miss scopes. So we need to iterate from the top down and skip all scopes which", "// were not scopes before:", "Collections", ".", "reverse", "(", "scopeExecutions", ")", ";", "Collections", ".", "reverse", "(", "scopes", ")", ";", "Map", "<", "ScopeImpl", ",", "PvmExecutionImpl", ">", "mapping", "=", "new", "HashMap", "<", "ScopeImpl", ",", "PvmExecutionImpl", ">", "(", ")", ";", "// process definition / process instance.", "mapping", ".", "put", "(", "scopes", ".", "get", "(", "0", ")", ",", "scopeExecutions", ".", "get", "(", "0", ")", ")", ";", "// nested activities", "int", "executionCounter", "=", "0", ";", "for", "(", "int", "i", "=", "1", ";", "i", "<", "scopes", ".", "size", "(", ")", ";", "i", "++", ")", "{", "ActivityImpl", "scope", "=", "(", "ActivityImpl", ")", "scopes", ".", "get", "(", "i", ")", ";", "PvmExecutionImpl", "scopeExecutionCandidate", "=", "null", ";", "if", "(", "executionCounter", "+", "1", "<", "scopeExecutions", ".", "size", "(", ")", ")", "{", "scopeExecutionCandidate", "=", "scopeExecutions", ".", "get", "(", "executionCounter", "+", "1", ")", ";", "}", "if", "(", "numOfMissingExecutions", ">", "0", "&&", "wasNoScope", "(", "scope", ",", "scopeExecutionCandidate", ")", ")", "{", "// found a missing scope", "numOfMissingExecutions", "--", ";", "}", "else", "{", "executionCounter", "++", ";", "}", "if", "(", "executionCounter", ">=", "scopeExecutions", ".", "size", "(", ")", ")", "{", "throw", "new", "ProcessEngineException", "(", "\"Cannot construct activity-execution mapping: there are \"", "+", "\"more scope executions missing than explained by the flow scope hierarchy.\"", ")", ";", "}", "PvmExecutionImpl", "execution", "=", "scopeExecutions", ".", "get", "(", "executionCounter", ")", ";", "mapping", ".", "put", "(", "scope", ",", "execution", ")", ";", "}", "return", "mapping", ";", "}" ]
Creates an activity execution mapping, when the scope hierarchy and the execution hierarchy are out of sync. @param scopeExecutions @param scopes @return
[ "Creates", "an", "activity", "execution", "mapping", "when", "the", "scope", "hierarchy", "and", "the", "execution", "hierarchy", "are", "out", "of", "sync", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java#L262-L315
16,413
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java
LegacyBehavior.wasNoScope
protected static boolean wasNoScope(ActivityImpl activity, PvmExecutionImpl scopeExecutionCandidate) { return wasNoScope72(activity) || wasNoScope73(activity, scopeExecutionCandidate); }
java
protected static boolean wasNoScope(ActivityImpl activity, PvmExecutionImpl scopeExecutionCandidate) { return wasNoScope72(activity) || wasNoScope73(activity, scopeExecutionCandidate); }
[ "protected", "static", "boolean", "wasNoScope", "(", "ActivityImpl", "activity", ",", "PvmExecutionImpl", "scopeExecutionCandidate", ")", "{", "return", "wasNoScope72", "(", "activity", ")", "||", "wasNoScope73", "(", "activity", ",", "scopeExecutionCandidate", ")", ";", "}" ]
Determines whether the given scope was a scope in previous versions
[ "Determines", "whether", "the", "given", "scope", "was", "a", "scope", "in", "previous", "versions" ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java#L320-L322
16,414
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java
LegacyBehavior.isLegacyAsyncAtMultiInstance
protected static boolean isLegacyAsyncAtMultiInstance(PvmExecutionImpl execution) { ActivityImpl activity = execution.getActivity(); if (activity != null) { boolean isAsync = execution.getActivityInstanceId() == null; boolean isAtMultiInstance = activity.getParentFlowScopeActivity() != null && activity.getParentFlowScopeActivity().getActivityBehavior() instanceof MultiInstanceActivityBehavior; return isAsync && isAtMultiInstance; } else { return false; } }
java
protected static boolean isLegacyAsyncAtMultiInstance(PvmExecutionImpl execution) { ActivityImpl activity = execution.getActivity(); if (activity != null) { boolean isAsync = execution.getActivityInstanceId() == null; boolean isAtMultiInstance = activity.getParentFlowScopeActivity() != null && activity.getParentFlowScopeActivity().getActivityBehavior() instanceof MultiInstanceActivityBehavior; return isAsync && isAtMultiInstance; } else { return false; } }
[ "protected", "static", "boolean", "isLegacyAsyncAtMultiInstance", "(", "PvmExecutionImpl", "execution", ")", "{", "ActivityImpl", "activity", "=", "execution", ".", "getActivity", "(", ")", ";", "if", "(", "activity", "!=", "null", ")", "{", "boolean", "isAsync", "=", "execution", ".", "getActivityInstanceId", "(", ")", "==", "null", ";", "boolean", "isAtMultiInstance", "=", "activity", ".", "getParentFlowScopeActivity", "(", ")", "!=", "null", "&&", "activity", ".", "getParentFlowScopeActivity", "(", ")", ".", "getActivityBehavior", "(", ")", "instanceof", "MultiInstanceActivityBehavior", ";", "return", "isAsync", "&&", "isAtMultiInstance", ";", "}", "else", "{", "return", "false", ";", "}", "}" ]
This returns true only if the provided execution has reached its wait state in a legacy engine version, because only in that case, it can be async and waiting at the inner activity wrapped by the miBody. In versions >= 7.3, the execution would reference the multi-instance body instead.
[ "This", "returns", "true", "only", "if", "the", "provided", "execution", "has", "reached", "its", "wait", "state", "in", "a", "legacy", "engine", "version", "because", "only", "in", "that", "case", "it", "can", "be", "async", "and", "waiting", "at", "the", "inner", "activity", "wrapped", "by", "the", "miBody", ".", "In", "versions", ">", "=", "7", ".", "3", "the", "execution", "would", "reference", "the", "multi", "-", "instance", "body", "instead", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java#L353-L367
16,415
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java
LegacyBehavior.determinePropagatingExecutionOnEnd
public static PvmExecutionImpl determinePropagatingExecutionOnEnd(PvmExecutionImpl propagatingExecution, Map<ScopeImpl, PvmExecutionImpl> activityExecutionMapping) { if (!propagatingExecution.isScope()) { // non-scope executions may end in the "wrong" flow scope return propagatingExecution; } else { // superfluous scope executions won't be contained in the activity-execution mapping if (activityExecutionMapping.values().contains(propagatingExecution)) { return propagatingExecution; } else { // skip one scope propagatingExecution.remove(); PvmExecutionImpl parent = propagatingExecution.getParent(); parent.setActivity(propagatingExecution.getActivity()); return propagatingExecution.getParent(); } } }
java
public static PvmExecutionImpl determinePropagatingExecutionOnEnd(PvmExecutionImpl propagatingExecution, Map<ScopeImpl, PvmExecutionImpl> activityExecutionMapping) { if (!propagatingExecution.isScope()) { // non-scope executions may end in the "wrong" flow scope return propagatingExecution; } else { // superfluous scope executions won't be contained in the activity-execution mapping if (activityExecutionMapping.values().contains(propagatingExecution)) { return propagatingExecution; } else { // skip one scope propagatingExecution.remove(); PvmExecutionImpl parent = propagatingExecution.getParent(); parent.setActivity(propagatingExecution.getActivity()); return propagatingExecution.getParent(); } } }
[ "public", "static", "PvmExecutionImpl", "determinePropagatingExecutionOnEnd", "(", "PvmExecutionImpl", "propagatingExecution", ",", "Map", "<", "ScopeImpl", ",", "PvmExecutionImpl", ">", "activityExecutionMapping", ")", "{", "if", "(", "!", "propagatingExecution", ".", "isScope", "(", ")", ")", "{", "// non-scope executions may end in the \"wrong\" flow scope", "return", "propagatingExecution", ";", "}", "else", "{", "// superfluous scope executions won't be contained in the activity-execution mapping", "if", "(", "activityExecutionMapping", ".", "values", "(", ")", ".", "contains", "(", "propagatingExecution", ")", ")", "{", "return", "propagatingExecution", ";", "}", "else", "{", "// skip one scope", "propagatingExecution", ".", "remove", "(", ")", ";", "PvmExecutionImpl", "parent", "=", "propagatingExecution", ".", "getParent", "(", ")", ";", "parent", ".", "setActivity", "(", "propagatingExecution", ".", "getActivity", "(", ")", ")", ";", "return", "propagatingExecution", ".", "getParent", "(", ")", ";", "}", "}", "}" ]
Tolerates the broken execution trees fixed with CAM-3727 where there may be more ancestor scope executions than ancestor flow scopes; In that case, the argument execution is removed, the parent execution of the argument is returned such that one level of mismatch is corrected. Note that this does not necessarily skip the correct scope execution, since the broken parent-child relationships may be anywhere in the tree (e.g. consider a non-interrupting boundary event followed by a subprocess (i.e. scope), when the subprocess ends, we would skip the subprocess's execution).
[ "Tolerates", "the", "broken", "execution", "trees", "fixed", "with", "CAM", "-", "3727", "where", "there", "may", "be", "more", "ancestor", "scope", "executions", "than", "ancestor", "flow", "scopes", ";" ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java#L382-L400
16,416
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java
LegacyBehavior.areEqualEventSubscriptions
protected static boolean areEqualEventSubscriptions(EventSubscriptionEntity subscription1, EventSubscriptionEntity subscription2) { return valuesEqual(subscription1.getEventType(), subscription2.getEventType()) && valuesEqual(subscription1.getEventName(), subscription2.getEventName()) && valuesEqual(subscription1.getActivityId(), subscription2.getActivityId()); }
java
protected static boolean areEqualEventSubscriptions(EventSubscriptionEntity subscription1, EventSubscriptionEntity subscription2) { return valuesEqual(subscription1.getEventType(), subscription2.getEventType()) && valuesEqual(subscription1.getEventName(), subscription2.getEventName()) && valuesEqual(subscription1.getActivityId(), subscription2.getActivityId()); }
[ "protected", "static", "boolean", "areEqualEventSubscriptions", "(", "EventSubscriptionEntity", "subscription1", ",", "EventSubscriptionEntity", "subscription2", ")", "{", "return", "valuesEqual", "(", "subscription1", ".", "getEventType", "(", ")", ",", "subscription2", ".", "getEventType", "(", ")", ")", "&&", "valuesEqual", "(", "subscription1", ".", "getEventName", "(", ")", ",", "subscription2", ".", "getEventName", "(", ")", ")", "&&", "valuesEqual", "(", "subscription1", ".", "getActivityId", "(", ")", ",", "subscription2", ".", "getActivityId", "(", ")", ")", ";", "}" ]
Checks if the parameters are the same apart from the execution id
[ "Checks", "if", "the", "parameters", "are", "the", "same", "apart", "from", "the", "execution", "id" ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java#L450-L455
16,417
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java
LegacyBehavior.removeLegacyNonScopesFromMapping
public static void removeLegacyNonScopesFromMapping(Map<ScopeImpl, PvmExecutionImpl> mapping) { Map<PvmExecutionImpl, List<ScopeImpl>> scopesForExecutions = new HashMap<PvmExecutionImpl, List<ScopeImpl>>(); for (Map.Entry<ScopeImpl, PvmExecutionImpl> mappingEntry : mapping.entrySet()) { List<ScopeImpl> scopesForExecution = scopesForExecutions.get(mappingEntry.getValue()); if (scopesForExecution == null) { scopesForExecution = new ArrayList<ScopeImpl>(); scopesForExecutions.put(mappingEntry.getValue(), scopesForExecution); } scopesForExecution.add(mappingEntry.getKey()); } for (Map.Entry<PvmExecutionImpl, List<ScopeImpl>> scopesForExecution : scopesForExecutions.entrySet()) { List<ScopeImpl> scopes = scopesForExecution.getValue(); if (scopes.size() > 1) { ScopeImpl topMostScope = getTopMostScope(scopes); for (ScopeImpl scope : scopes) { if (scope != scope.getProcessDefinition() && scope != topMostScope) { mapping.remove(scope); } } } } }
java
public static void removeLegacyNonScopesFromMapping(Map<ScopeImpl, PvmExecutionImpl> mapping) { Map<PvmExecutionImpl, List<ScopeImpl>> scopesForExecutions = new HashMap<PvmExecutionImpl, List<ScopeImpl>>(); for (Map.Entry<ScopeImpl, PvmExecutionImpl> mappingEntry : mapping.entrySet()) { List<ScopeImpl> scopesForExecution = scopesForExecutions.get(mappingEntry.getValue()); if (scopesForExecution == null) { scopesForExecution = new ArrayList<ScopeImpl>(); scopesForExecutions.put(mappingEntry.getValue(), scopesForExecution); } scopesForExecution.add(mappingEntry.getKey()); } for (Map.Entry<PvmExecutionImpl, List<ScopeImpl>> scopesForExecution : scopesForExecutions.entrySet()) { List<ScopeImpl> scopes = scopesForExecution.getValue(); if (scopes.size() > 1) { ScopeImpl topMostScope = getTopMostScope(scopes); for (ScopeImpl scope : scopes) { if (scope != scope.getProcessDefinition() && scope != topMostScope) { mapping.remove(scope); } } } } }
[ "public", "static", "void", "removeLegacyNonScopesFromMapping", "(", "Map", "<", "ScopeImpl", ",", "PvmExecutionImpl", ">", "mapping", ")", "{", "Map", "<", "PvmExecutionImpl", ",", "List", "<", "ScopeImpl", ">", ">", "scopesForExecutions", "=", "new", "HashMap", "<", "PvmExecutionImpl", ",", "List", "<", "ScopeImpl", ">", ">", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "ScopeImpl", ",", "PvmExecutionImpl", ">", "mappingEntry", ":", "mapping", ".", "entrySet", "(", ")", ")", "{", "List", "<", "ScopeImpl", ">", "scopesForExecution", "=", "scopesForExecutions", ".", "get", "(", "mappingEntry", ".", "getValue", "(", ")", ")", ";", "if", "(", "scopesForExecution", "==", "null", ")", "{", "scopesForExecution", "=", "new", "ArrayList", "<", "ScopeImpl", ">", "(", ")", ";", "scopesForExecutions", ".", "put", "(", "mappingEntry", ".", "getValue", "(", ")", ",", "scopesForExecution", ")", ";", "}", "scopesForExecution", ".", "add", "(", "mappingEntry", ".", "getKey", "(", ")", ")", ";", "}", "for", "(", "Map", ".", "Entry", "<", "PvmExecutionImpl", ",", "List", "<", "ScopeImpl", ">", ">", "scopesForExecution", ":", "scopesForExecutions", ".", "entrySet", "(", ")", ")", "{", "List", "<", "ScopeImpl", ">", "scopes", "=", "scopesForExecution", ".", "getValue", "(", ")", ";", "if", "(", "scopes", ".", "size", "(", ")", ">", "1", ")", "{", "ScopeImpl", "topMostScope", "=", "getTopMostScope", "(", "scopes", ")", ";", "for", "(", "ScopeImpl", "scope", ":", "scopes", ")", "{", "if", "(", "scope", "!=", "scope", ".", "getProcessDefinition", "(", ")", "&&", "scope", "!=", "topMostScope", ")", "{", "mapping", ".", "remove", "(", "scope", ")", ";", "}", "}", "}", "}", "}" ]
Remove all entries for legacy non-scopes given that the assigned scope execution is also responsible for another scope
[ "Remove", "all", "entries", "for", "legacy", "non", "-", "scopes", "given", "that", "the", "assigned", "scope", "execution", "is", "also", "responsible", "for", "another", "scope" ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java#L464-L490
16,418
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java
LegacyBehavior.migrateMultiInstanceJobDefinitions
public static void migrateMultiInstanceJobDefinitions(ProcessDefinitionEntity processDefinition, List<JobDefinitionEntity> jobDefinitions) { for (JobDefinitionEntity jobDefinition : jobDefinitions) { String activityId = jobDefinition.getActivityId(); if (activityId != null) { ActivityImpl activity = processDefinition.findActivity(jobDefinition.getActivityId()); if (!isAsync(activity) && isActivityWrappedInMultiInstanceBody(activity) && isAsyncJobDefinition(jobDefinition)) { jobDefinition.setActivityId(activity.getFlowScope().getId()); } } } }
java
public static void migrateMultiInstanceJobDefinitions(ProcessDefinitionEntity processDefinition, List<JobDefinitionEntity> jobDefinitions) { for (JobDefinitionEntity jobDefinition : jobDefinitions) { String activityId = jobDefinition.getActivityId(); if (activityId != null) { ActivityImpl activity = processDefinition.findActivity(jobDefinition.getActivityId()); if (!isAsync(activity) && isActivityWrappedInMultiInstanceBody(activity) && isAsyncJobDefinition(jobDefinition)) { jobDefinition.setActivityId(activity.getFlowScope().getId()); } } } }
[ "public", "static", "void", "migrateMultiInstanceJobDefinitions", "(", "ProcessDefinitionEntity", "processDefinition", ",", "List", "<", "JobDefinitionEntity", ">", "jobDefinitions", ")", "{", "for", "(", "JobDefinitionEntity", "jobDefinition", ":", "jobDefinitions", ")", "{", "String", "activityId", "=", "jobDefinition", ".", "getActivityId", "(", ")", ";", "if", "(", "activityId", "!=", "null", ")", "{", "ActivityImpl", "activity", "=", "processDefinition", ".", "findActivity", "(", "jobDefinition", ".", "getActivityId", "(", ")", ")", ";", "if", "(", "!", "isAsync", "(", "activity", ")", "&&", "isActivityWrappedInMultiInstanceBody", "(", "activity", ")", "&&", "isAsyncJobDefinition", "(", "jobDefinition", ")", ")", "{", "jobDefinition", ".", "setActivityId", "(", "activity", ".", "getFlowScope", "(", ")", ".", "getId", "(", ")", ")", ";", "}", "}", "}", "}" ]
When deploying an async job definition for an activity wrapped in an miBody, set the activity id to the miBody except the wrapped activity is marked as async. Background: in <= 7.2 async job definitions were created for the inner activity, although the semantics are that they are executed before the miBody is entered
[ "When", "deploying", "an", "async", "job", "definition", "for", "an", "activity", "wrapped", "in", "an", "miBody", "set", "the", "activity", "id", "to", "the", "miBody", "except", "the", "wrapped", "activity", "is", "marked", "as", "async", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java#L525-L537
16,419
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java
LegacyBehavior.repairMultiInstanceAsyncJob
public static void repairMultiInstanceAsyncJob(ExecutionEntity execution) { ActivityImpl activity = execution.getActivity(); if (!isAsync(activity) && isActivityWrappedInMultiInstanceBody(activity)) { execution.setActivity((ActivityImpl) activity.getFlowScope()); } }
java
public static void repairMultiInstanceAsyncJob(ExecutionEntity execution) { ActivityImpl activity = execution.getActivity(); if (!isAsync(activity) && isActivityWrappedInMultiInstanceBody(activity)) { execution.setActivity((ActivityImpl) activity.getFlowScope()); } }
[ "public", "static", "void", "repairMultiInstanceAsyncJob", "(", "ExecutionEntity", "execution", ")", "{", "ActivityImpl", "activity", "=", "execution", ".", "getActivity", "(", ")", ";", "if", "(", "!", "isAsync", "(", "activity", ")", "&&", "isActivityWrappedInMultiInstanceBody", "(", "activity", ")", ")", "{", "execution", ".", "setActivity", "(", "(", "ActivityImpl", ")", "activity", ".", "getFlowScope", "(", ")", ")", ";", "}", "}" ]
When executing an async job for an activity wrapped in an miBody, set the execution to the miBody except the wrapped activity is marked as async. Background: in <= 7.2 async jobs were created for the inner activity, although the semantics are that they are executed before the miBody is entered
[ "When", "executing", "an", "async", "job", "for", "an", "activity", "wrapped", "in", "an", "miBody", "set", "the", "execution", "to", "the", "miBody", "except", "the", "wrapped", "activity", "is", "marked", "as", "async", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java#L566-L572
16,420
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java
LegacyBehavior.isCompensationThrowing
public static boolean isCompensationThrowing(PvmExecutionImpl execution, Map<ScopeImpl, PvmExecutionImpl> activityExecutionMapping) { if (CompensationBehavior.isCompensationThrowing(execution)) { ScopeImpl compensationThrowingActivity = execution.getActivity(); if (compensationThrowingActivity.isScope()) { return activityExecutionMapping.get(compensationThrowingActivity) == activityExecutionMapping.get(compensationThrowingActivity.getFlowScope()); } else { // for transaction sub processes with cancel end events, the compensation throwing execution waits in the boundary event, not in the end // event; cancel boundary events are currently not scope return compensationThrowingActivity.getActivityBehavior() instanceof CancelBoundaryEventActivityBehavior; } } else { return false; } }
java
public static boolean isCompensationThrowing(PvmExecutionImpl execution, Map<ScopeImpl, PvmExecutionImpl> activityExecutionMapping) { if (CompensationBehavior.isCompensationThrowing(execution)) { ScopeImpl compensationThrowingActivity = execution.getActivity(); if (compensationThrowingActivity.isScope()) { return activityExecutionMapping.get(compensationThrowingActivity) == activityExecutionMapping.get(compensationThrowingActivity.getFlowScope()); } else { // for transaction sub processes with cancel end events, the compensation throwing execution waits in the boundary event, not in the end // event; cancel boundary events are currently not scope return compensationThrowingActivity.getActivityBehavior() instanceof CancelBoundaryEventActivityBehavior; } } else { return false; } }
[ "public", "static", "boolean", "isCompensationThrowing", "(", "PvmExecutionImpl", "execution", ",", "Map", "<", "ScopeImpl", ",", "PvmExecutionImpl", ">", "activityExecutionMapping", ")", "{", "if", "(", "CompensationBehavior", ".", "isCompensationThrowing", "(", "execution", ")", ")", "{", "ScopeImpl", "compensationThrowingActivity", "=", "execution", ".", "getActivity", "(", ")", ";", "if", "(", "compensationThrowingActivity", ".", "isScope", "(", ")", ")", "{", "return", "activityExecutionMapping", ".", "get", "(", "compensationThrowingActivity", ")", "==", "activityExecutionMapping", ".", "get", "(", "compensationThrowingActivity", ".", "getFlowScope", "(", ")", ")", ";", "}", "else", "{", "// for transaction sub processes with cancel end events, the compensation throwing execution waits in the boundary event, not in the end", "// event; cancel boundary events are currently not scope", "return", "compensationThrowingActivity", ".", "getActivityBehavior", "(", ")", "instanceof", "CancelBoundaryEventActivityBehavior", ";", "}", "}", "else", "{", "return", "false", ";", "}", "}" ]
Returns true if the given execution is in a compensation-throwing activity but there is no dedicated scope execution in the given mapping.
[ "Returns", "true", "if", "the", "given", "execution", "is", "in", "a", "compensation", "-", "throwing", "activity", "but", "there", "is", "no", "dedicated", "scope", "execution", "in", "the", "given", "mapping", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/LegacyBehavior.java#L604-L621
16,421
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/util/xml/Element.java
Element.collectIds
public void collectIds(List<String> ids) { ids.add(attribute("id")); for (Element child : elements) { child.collectIds(ids); } }
java
public void collectIds(List<String> ids) { ids.add(attribute("id")); for (Element child : elements) { child.collectIds(ids); } }
[ "public", "void", "collectIds", "(", "List", "<", "String", ">", "ids", ")", "{", "ids", ".", "add", "(", "attribute", "(", "\"id\"", ")", ")", ";", "for", "(", "Element", "child", ":", "elements", ")", "{", "child", ".", "collectIds", "(", "ids", ")", ";", "}", "}" ]
allows to recursively collect the ids of all elements in the tree.
[ "allows", "to", "recursively", "collect", "the", "ids", "of", "all", "elements", "in", "the", "tree", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/util/xml/Element.java#L202-L207
16,422
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/javax/el/CompositeELResolver.java
CompositeELResolver.getFeatureDescriptors
@Override public Iterator<FeatureDescriptor> getFeatureDescriptors(final ELContext context, final Object base) { return new Iterator<FeatureDescriptor>() { Iterator<FeatureDescriptor> empty = Collections.<FeatureDescriptor> emptyList().iterator(); Iterator<ELResolver> resolvers = CompositeELResolver.this.resolvers.iterator(); Iterator<FeatureDescriptor> features = empty; Iterator<FeatureDescriptor> features() { while (!features.hasNext() && resolvers.hasNext()) { features = resolvers.next().getFeatureDescriptors(context, base); if (features == null) { features = empty; } } return features; } public boolean hasNext() { return features().hasNext(); } public FeatureDescriptor next() { return features().next(); } public void remove() { features().remove(); } }; }
java
@Override public Iterator<FeatureDescriptor> getFeatureDescriptors(final ELContext context, final Object base) { return new Iterator<FeatureDescriptor>() { Iterator<FeatureDescriptor> empty = Collections.<FeatureDescriptor> emptyList().iterator(); Iterator<ELResolver> resolvers = CompositeELResolver.this.resolvers.iterator(); Iterator<FeatureDescriptor> features = empty; Iterator<FeatureDescriptor> features() { while (!features.hasNext() && resolvers.hasNext()) { features = resolvers.next().getFeatureDescriptors(context, base); if (features == null) { features = empty; } } return features; } public boolean hasNext() { return features().hasNext(); } public FeatureDescriptor next() { return features().next(); } public void remove() { features().remove(); } }; }
[ "@", "Override", "public", "Iterator", "<", "FeatureDescriptor", ">", "getFeatureDescriptors", "(", "final", "ELContext", "context", ",", "final", "Object", "base", ")", "{", "return", "new", "Iterator", "<", "FeatureDescriptor", ">", "(", ")", "{", "Iterator", "<", "FeatureDescriptor", ">", "empty", "=", "Collections", ".", "<", "FeatureDescriptor", ">", "emptyList", "(", ")", ".", "iterator", "(", ")", ";", "Iterator", "<", "ELResolver", ">", "resolvers", "=", "CompositeELResolver", ".", "this", ".", "resolvers", ".", "iterator", "(", ")", ";", "Iterator", "<", "FeatureDescriptor", ">", "features", "=", "empty", ";", "Iterator", "<", "FeatureDescriptor", ">", "features", "(", ")", "{", "while", "(", "!", "features", ".", "hasNext", "(", ")", "&&", "resolvers", ".", "hasNext", "(", ")", ")", "{", "features", "=", "resolvers", ".", "next", "(", ")", ".", "getFeatureDescriptors", "(", "context", ",", "base", ")", ";", "if", "(", "features", "==", "null", ")", "{", "features", "=", "empty", ";", "}", "}", "return", "features", ";", "}", "public", "boolean", "hasNext", "(", ")", "{", "return", "features", "(", ")", ".", "hasNext", "(", ")", ";", "}", "public", "FeatureDescriptor", "next", "(", ")", "{", "return", "features", "(", ")", ".", "next", "(", ")", ";", "}", "public", "void", "remove", "(", ")", "{", "features", "(", ")", ".", "remove", "(", ")", ";", "}", "}", ";", "}" ]
Returns information about the set of variables or properties that can be resolved for the given base object. One use for this method is to assist tools in auto-completion. The results are collected from all component resolvers. The propertyResolved property of the ELContext is not relevant to this method. The results of all ELResolvers are concatenated. The Iterator returned is an iterator over the collection of FeatureDescriptor objects returned by the iterators returned by each component resolver's getFeatureDescriptors method. If null is returned by a resolver, it is skipped. @param context The context of this evaluation. @param base The base object to return the most general property type for, or null to enumerate the set of top-level variables that this resolver can evaluate. @return An Iterator containing zero or more (possibly infinitely more) FeatureDescriptor objects, or null if this resolver does not handle the given base object or that the results are too complex to represent with this method
[ "Returns", "information", "about", "the", "set", "of", "variables", "or", "properties", "that", "can", "be", "resolved", "for", "the", "given", "base", "object", ".", "One", "use", "for", "this", "method", "is", "to", "assist", "tools", "in", "auto", "-", "completion", ".", "The", "results", "are", "collected", "from", "all", "component", "resolvers", ".", "The", "propertyResolved", "property", "of", "the", "ELContext", "is", "not", "relevant", "to", "this", "method", ".", "The", "results", "of", "all", "ELResolvers", "are", "concatenated", ".", "The", "Iterator", "returned", "is", "an", "iterator", "over", "the", "collection", "of", "FeatureDescriptor", "objects", "returned", "by", "the", "iterators", "returned", "by", "each", "component", "resolver", "s", "getFeatureDescriptors", "method", ".", "If", "null", "is", "returned", "by", "a", "resolver", "it", "is", "skipped", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/javax/el/CompositeELResolver.java#L112-L141
16,423
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/util/CompareUtil.java
CompareUtil.elementIsNotContainedInList
public static <T> boolean elementIsNotContainedInList(T element, Collection<T> values) { if (element != null && values != null) { return !values.contains(element); } else { return false; } }
java
public static <T> boolean elementIsNotContainedInList(T element, Collection<T> values) { if (element != null && values != null) { return !values.contains(element); } else { return false; } }
[ "public", "static", "<", "T", ">", "boolean", "elementIsNotContainedInList", "(", "T", "element", ",", "Collection", "<", "T", ">", "values", ")", "{", "if", "(", "element", "!=", "null", "&&", "values", "!=", "null", ")", "{", "return", "!", "values", ".", "contains", "(", "element", ")", ";", "}", "else", "{", "return", "false", ";", "}", "}" ]
Checks if the element is not contained within the list of values. If the element, or the list are null then true is returned. @param element to check @param values to check in @param <T> the type of the element @return {@code true} if the element and values are not {@code null} and the values does not contain the element, {@code false} otherwise
[ "Checks", "if", "the", "element", "is", "not", "contained", "within", "the", "list", "of", "values", ".", "If", "the", "element", "or", "the", "list", "are", "null", "then", "true", "is", "returned", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/util/CompareUtil.java#L86-L93
16,424
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/util/CompareUtil.java
CompareUtil.elementIsNotContainedInArray
public static <T> boolean elementIsNotContainedInArray(T element, T... values) { if (element != null && values != null) { return elementIsNotContainedInList(element, Arrays.asList(values)); } else { return false; } }
java
public static <T> boolean elementIsNotContainedInArray(T element, T... values) { if (element != null && values != null) { return elementIsNotContainedInList(element, Arrays.asList(values)); } else { return false; } }
[ "public", "static", "<", "T", ">", "boolean", "elementIsNotContainedInArray", "(", "T", "element", ",", "T", "...", "values", ")", "{", "if", "(", "element", "!=", "null", "&&", "values", "!=", "null", ")", "{", "return", "elementIsNotContainedInList", "(", "element", ",", "Arrays", ".", "asList", "(", "values", ")", ")", ";", "}", "else", "{", "return", "false", ";", "}", "}" ]
Checks if the element is contained within the list of values. If the element, or the list are null then true is returned. @param element to check @param values to check in @param <T> the type of the element @return {@code true} if the element and values are not {@code null} and the values does not contain the element, {@code false} otherwise
[ "Checks", "if", "the", "element", "is", "contained", "within", "the", "list", "of", "values", ".", "If", "the", "element", "or", "the", "list", "are", "null", "then", "true", "is", "returned", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/util/CompareUtil.java#L103-L110
16,425
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/juel/TreeValueExpression.java
TreeValueExpression.getType
@Override public Class<?> getType(ELContext context) throws ELException { return node.getType(bindings, context); }
java
@Override public Class<?> getType(ELContext context) throws ELException { return node.getType(bindings, context); }
[ "@", "Override", "public", "Class", "<", "?", ">", "getType", "(", "ELContext", "context", ")", "throws", "ELException", "{", "return", "node", ".", "getType", "(", "bindings", ",", "context", ")", ";", "}" ]
Evaluates the expression as an lvalue and answers the result type. @param context used to resolve properties (<code>base.property</code> and <code>base[property]</code>) and to determine the result from the last base/property pair @return lvalue evaluation type or <code>null</code> for rvalue expressions @throws ELException if evaluation fails (e.g. property not found, type conversion failed, ...)
[ "Evaluates", "the", "expression", "as", "an", "lvalue", "and", "answers", "the", "result", "type", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/juel/TreeValueExpression.java#L100-L103
16,426
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/juel/TreeValueExpression.java
TreeValueExpression.getValue
@Override public Object getValue(ELContext context) throws ELException { return node.getValue(bindings, context, type); }
java
@Override public Object getValue(ELContext context) throws ELException { return node.getValue(bindings, context, type); }
[ "@", "Override", "public", "Object", "getValue", "(", "ELContext", "context", ")", "throws", "ELException", "{", "return", "node", ".", "getValue", "(", "bindings", ",", "context", ",", "type", ")", ";", "}" ]
Evaluates the expression as an rvalue and answers the result. @param context used to resolve properties (<code>base.property</code> and <code>base[property]</code>) and to determine the result from the last base/property pair @return rvalue evaluation result @throws ELException if evaluation fails (e.g. property not found, type conversion failed, ...)
[ "Evaluates", "the", "expression", "as", "an", "rvalue", "and", "answers", "the", "result", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/juel/TreeValueExpression.java#L112-L115
16,427
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/juel/TreeValueExpression.java
TreeValueExpression.setValue
@Override public void setValue(ELContext context, Object value) throws ELException { node.setValue(bindings, context, value); }
java
@Override public void setValue(ELContext context, Object value) throws ELException { node.setValue(bindings, context, value); }
[ "@", "Override", "public", "void", "setValue", "(", "ELContext", "context", ",", "Object", "value", ")", "throws", "ELException", "{", "node", ".", "setValue", "(", "bindings", ",", "context", ",", "value", ")", ";", "}" ]
Evaluates the expression as an lvalue and assigns the given value. @param context used to resolve properties (<code>base.property</code> and <code>base[property]</code>) and to perform the assignment to the last base/property pair @throws ELException if evaluation fails (e.g. property not found, type conversion failed, assignment failed...)
[ "Evaluates", "the", "expression", "as", "an", "lvalue", "and", "assigns", "the", "given", "value", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/juel/TreeValueExpression.java#L136-L139
16,428
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/migration/instance/MigratingActivityInstance.java
MigratingActivityInstance.getChildren
public Set<MigratingProcessElementInstance> getChildren() { Set<MigratingProcessElementInstance> childInstances = new HashSet<MigratingProcessElementInstance>(); childInstances.addAll(childActivityInstances); childInstances.addAll(childTransitionInstances); childInstances.addAll(childCompensationInstances); childInstances.addAll(childCompensationSubscriptionInstances); return childInstances; }
java
public Set<MigratingProcessElementInstance> getChildren() { Set<MigratingProcessElementInstance> childInstances = new HashSet<MigratingProcessElementInstance>(); childInstances.addAll(childActivityInstances); childInstances.addAll(childTransitionInstances); childInstances.addAll(childCompensationInstances); childInstances.addAll(childCompensationSubscriptionInstances); return childInstances; }
[ "public", "Set", "<", "MigratingProcessElementInstance", ">", "getChildren", "(", ")", "{", "Set", "<", "MigratingProcessElementInstance", ">", "childInstances", "=", "new", "HashSet", "<", "MigratingProcessElementInstance", ">", "(", ")", ";", "childInstances", ".", "addAll", "(", "childActivityInstances", ")", ";", "childInstances", ".", "addAll", "(", "childTransitionInstances", ")", ";", "childInstances", ".", "addAll", "(", "childCompensationInstances", ")", ";", "childInstances", ".", "addAll", "(", "childCompensationSubscriptionInstances", ")", ";", "return", "childInstances", ";", "}" ]
Returns a copy of all children, modifying the returned set does not have any further effect.
[ "Returns", "a", "copy", "of", "all", "children", "modifying", "the", "returned", "set", "does", "not", "have", "any", "further", "effect", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/migration/instance/MigratingActivityInstance.java#L298-L305
16,429
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/juel/TreeMethodExpression.java
TreeMethodExpression.getMethodInfo
@Override public MethodInfo getMethodInfo(ELContext context) throws ELException { return node.getMethodInfo(bindings, context, type, types); }
java
@Override public MethodInfo getMethodInfo(ELContext context) throws ELException { return node.getMethodInfo(bindings, context, type, types); }
[ "@", "Override", "public", "MethodInfo", "getMethodInfo", "(", "ELContext", "context", ")", "throws", "ELException", "{", "return", "node", ".", "getMethodInfo", "(", "bindings", ",", "context", ",", "type", ",", "types", ")", ";", "}" ]
Evaluates the expression and answers information about the method @param context used to resolve properties (<code>base.property</code> and <code>base[property]</code>) @return method information or <code>null</code> for literal expressions @throws ELException if evaluation fails (e.g. suitable method not found)
[ "Evaluates", "the", "expression", "and", "answers", "information", "about", "the", "method" ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/juel/TreeMethodExpression.java#L105-L108
16,430
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/juel/TreeMethodExpression.java
TreeMethodExpression.invoke
@Override public Object invoke(ELContext context, Object[] paramValues) throws ELException { return node.invoke(bindings, context, type, types, paramValues); }
java
@Override public Object invoke(ELContext context, Object[] paramValues) throws ELException { return node.invoke(bindings, context, type, types, paramValues); }
[ "@", "Override", "public", "Object", "invoke", "(", "ELContext", "context", ",", "Object", "[", "]", "paramValues", ")", "throws", "ELException", "{", "return", "node", ".", "invoke", "(", "bindings", ",", "context", ",", "type", ",", "types", ",", "paramValues", ")", ";", "}" ]
Evaluates the expression and invokes the method. @param context used to resolve properties (<code>base.property</code> and <code>base[property]</code>) @param paramValues @return method result or <code>null</code> if this is a literal text expression @throws ELException if evaluation fails (e.g. suitable method not found)
[ "Evaluates", "the", "expression", "and", "invokes", "the", "method", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/juel/TreeMethodExpression.java#L122-L125
16,431
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/AuthorizationQueryImpl.java
AuthorizationQueryImpl.containsIncompatibleResourceType
private boolean containsIncompatibleResourceType() { if (queryByResourceType && queryByPermission) { Resource[] resources = resourcesIntersection.toArray(new Resource[resourcesIntersection.size()]); return !ResourceTypeUtil.resourceIsContainedInArray(resourceType, resources); } return false; }
java
private boolean containsIncompatibleResourceType() { if (queryByResourceType && queryByPermission) { Resource[] resources = resourcesIntersection.toArray(new Resource[resourcesIntersection.size()]); return !ResourceTypeUtil.resourceIsContainedInArray(resourceType, resources); } return false; }
[ "private", "boolean", "containsIncompatibleResourceType", "(", ")", "{", "if", "(", "queryByResourceType", "&&", "queryByPermission", ")", "{", "Resource", "[", "]", "resources", "=", "resourcesIntersection", ".", "toArray", "(", "new", "Resource", "[", "resourcesIntersection", ".", "size", "(", ")", "]", ")", ";", "return", "!", "ResourceTypeUtil", ".", "resourceIsContainedInArray", "(", "resourceType", ",", "resources", ")", ";", "}", "return", "false", ";", "}" ]
check whether the permissions' resources are compatible to the filtered resource parameter
[ "check", "whether", "the", "permissions", "resources", "are", "compatible", "to", "the", "filtered", "resource", "parameter" ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/AuthorizationQueryImpl.java#L145-L151
16,432
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/cmmn/entity/repository/CaseDefinitionEntity.java
CaseDefinitionEntity.updateModifiableFieldsFromEntity
@Override public void updateModifiableFieldsFromEntity(CaseDefinitionEntity updatingCaseDefinition) { if (this.key.equals(updatingCaseDefinition.key) && this.deploymentId.equals(updatingCaseDefinition.deploymentId)) { this.revision = updatingCaseDefinition.revision; this.historyTimeToLive = updatingCaseDefinition.historyTimeToLive; } else { LOG.logUpdateUnrelatedCaseDefinitionEntity(this.key, updatingCaseDefinition.key, this.deploymentId, updatingCaseDefinition.deploymentId); } }
java
@Override public void updateModifiableFieldsFromEntity(CaseDefinitionEntity updatingCaseDefinition) { if (this.key.equals(updatingCaseDefinition.key) && this.deploymentId.equals(updatingCaseDefinition.deploymentId)) { this.revision = updatingCaseDefinition.revision; this.historyTimeToLive = updatingCaseDefinition.historyTimeToLive; } else { LOG.logUpdateUnrelatedCaseDefinitionEntity(this.key, updatingCaseDefinition.key, this.deploymentId, updatingCaseDefinition.deploymentId); } }
[ "@", "Override", "public", "void", "updateModifiableFieldsFromEntity", "(", "CaseDefinitionEntity", "updatingCaseDefinition", ")", "{", "if", "(", "this", ".", "key", ".", "equals", "(", "updatingCaseDefinition", ".", "key", ")", "&&", "this", ".", "deploymentId", ".", "equals", "(", "updatingCaseDefinition", ".", "deploymentId", ")", ")", "{", "this", ".", "revision", "=", "updatingCaseDefinition", ".", "revision", ";", "this", ".", "historyTimeToLive", "=", "updatingCaseDefinition", ".", "historyTimeToLive", ";", "}", "else", "{", "LOG", ".", "logUpdateUnrelatedCaseDefinitionEntity", "(", "this", ".", "key", ",", "updatingCaseDefinition", ".", "key", ",", "this", ".", "deploymentId", ",", "updatingCaseDefinition", ".", "deploymentId", ")", ";", "}", "}" ]
Updates all modifiable fields from another case definition entity. @param updatingCaseDefinition
[ "Updates", "all", "modifiable", "fields", "from", "another", "case", "definition", "entity", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/cmmn/entity/repository/CaseDefinitionEntity.java#L256-L265
16,433
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/jobexecutor/historycleanup/HistoryCleanupHelper.java
HistoryCleanupHelper.isWithinBatchWindow
public static boolean isWithinBatchWindow(Date date, ProcessEngineConfigurationImpl configuration) { if (configuration.getBatchWindowManager().isBatchWindowConfigured(configuration)) { BatchWindow batchWindow = configuration.getBatchWindowManager().getCurrentOrNextBatchWindow(date, configuration); if (batchWindow == null) { return false; } return batchWindow.isWithin(date); } else { return false; } }
java
public static boolean isWithinBatchWindow(Date date, ProcessEngineConfigurationImpl configuration) { if (configuration.getBatchWindowManager().isBatchWindowConfigured(configuration)) { BatchWindow batchWindow = configuration.getBatchWindowManager().getCurrentOrNextBatchWindow(date, configuration); if (batchWindow == null) { return false; } return batchWindow.isWithin(date); } else { return false; } }
[ "public", "static", "boolean", "isWithinBatchWindow", "(", "Date", "date", ",", "ProcessEngineConfigurationImpl", "configuration", ")", "{", "if", "(", "configuration", ".", "getBatchWindowManager", "(", ")", ".", "isBatchWindowConfigured", "(", "configuration", ")", ")", "{", "BatchWindow", "batchWindow", "=", "configuration", ".", "getBatchWindowManager", "(", ")", ".", "getCurrentOrNextBatchWindow", "(", "date", ",", "configuration", ")", ";", "if", "(", "batchWindow", "==", "null", ")", "{", "return", "false", ";", "}", "return", "batchWindow", ".", "isWithin", "(", "date", ")", ";", "}", "else", "{", "return", "false", ";", "}", "}" ]
Checks if given date is within a batch window. Batch window start time is checked inclusively. @param date @return
[ "Checks", "if", "given", "date", "is", "within", "a", "batch", "window", ".", "Batch", "window", "start", "time", "is", "checked", "inclusively", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/jobexecutor/historycleanup/HistoryCleanupHelper.java#L45-L55
16,434
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/helper/CompensationUtil.java
CompensationUtil.collectCompensateEventSubscriptionsForScope
public static List<EventSubscriptionEntity> collectCompensateEventSubscriptionsForScope(ActivityExecution execution) { final Map<ScopeImpl, PvmExecutionImpl> scopeExecutionMapping = execution.createActivityExecutionMapping(); ScopeImpl activity = (ScopeImpl) execution.getActivity(); // <LEGACY>: different flow scopes may have the same scope execution => // collect subscriptions in a set final Set<EventSubscriptionEntity> subscriptions = new HashSet<EventSubscriptionEntity>(); TreeVisitor<ScopeImpl> eventSubscriptionCollector = new TreeVisitor<ScopeImpl>() { @Override public void visit(ScopeImpl obj) { PvmExecutionImpl execution = scopeExecutionMapping.get(obj); subscriptions.addAll(((ExecutionEntity) execution).getCompensateEventSubscriptions()); } }; new FlowScopeWalker(activity).addPostVisitor(eventSubscriptionCollector).walkUntil(new ReferenceWalker.WalkCondition<ScopeImpl>() { @Override public boolean isFulfilled(ScopeImpl element) { Boolean consumesCompensationProperty = (Boolean) element.getProperty(BpmnParse.PROPERTYNAME_CONSUMES_COMPENSATION); return consumesCompensationProperty == null || consumesCompensationProperty == Boolean.TRUE; } }); return new ArrayList<EventSubscriptionEntity>(subscriptions); }
java
public static List<EventSubscriptionEntity> collectCompensateEventSubscriptionsForScope(ActivityExecution execution) { final Map<ScopeImpl, PvmExecutionImpl> scopeExecutionMapping = execution.createActivityExecutionMapping(); ScopeImpl activity = (ScopeImpl) execution.getActivity(); // <LEGACY>: different flow scopes may have the same scope execution => // collect subscriptions in a set final Set<EventSubscriptionEntity> subscriptions = new HashSet<EventSubscriptionEntity>(); TreeVisitor<ScopeImpl> eventSubscriptionCollector = new TreeVisitor<ScopeImpl>() { @Override public void visit(ScopeImpl obj) { PvmExecutionImpl execution = scopeExecutionMapping.get(obj); subscriptions.addAll(((ExecutionEntity) execution).getCompensateEventSubscriptions()); } }; new FlowScopeWalker(activity).addPostVisitor(eventSubscriptionCollector).walkUntil(new ReferenceWalker.WalkCondition<ScopeImpl>() { @Override public boolean isFulfilled(ScopeImpl element) { Boolean consumesCompensationProperty = (Boolean) element.getProperty(BpmnParse.PROPERTYNAME_CONSUMES_COMPENSATION); return consumesCompensationProperty == null || consumesCompensationProperty == Boolean.TRUE; } }); return new ArrayList<EventSubscriptionEntity>(subscriptions); }
[ "public", "static", "List", "<", "EventSubscriptionEntity", ">", "collectCompensateEventSubscriptionsForScope", "(", "ActivityExecution", "execution", ")", "{", "final", "Map", "<", "ScopeImpl", ",", "PvmExecutionImpl", ">", "scopeExecutionMapping", "=", "execution", ".", "createActivityExecutionMapping", "(", ")", ";", "ScopeImpl", "activity", "=", "(", "ScopeImpl", ")", "execution", ".", "getActivity", "(", ")", ";", "// <LEGACY>: different flow scopes may have the same scope execution =>", "// collect subscriptions in a set", "final", "Set", "<", "EventSubscriptionEntity", ">", "subscriptions", "=", "new", "HashSet", "<", "EventSubscriptionEntity", ">", "(", ")", ";", "TreeVisitor", "<", "ScopeImpl", ">", "eventSubscriptionCollector", "=", "new", "TreeVisitor", "<", "ScopeImpl", ">", "(", ")", "{", "@", "Override", "public", "void", "visit", "(", "ScopeImpl", "obj", ")", "{", "PvmExecutionImpl", "execution", "=", "scopeExecutionMapping", ".", "get", "(", "obj", ")", ";", "subscriptions", ".", "addAll", "(", "(", "(", "ExecutionEntity", ")", "execution", ")", ".", "getCompensateEventSubscriptions", "(", ")", ")", ";", "}", "}", ";", "new", "FlowScopeWalker", "(", "activity", ")", ".", "addPostVisitor", "(", "eventSubscriptionCollector", ")", ".", "walkUntil", "(", "new", "ReferenceWalker", ".", "WalkCondition", "<", "ScopeImpl", ">", "(", ")", "{", "@", "Override", "public", "boolean", "isFulfilled", "(", "ScopeImpl", "element", ")", "{", "Boolean", "consumesCompensationProperty", "=", "(", "Boolean", ")", "element", ".", "getProperty", "(", "BpmnParse", ".", "PROPERTYNAME_CONSUMES_COMPENSATION", ")", ";", "return", "consumesCompensationProperty", "==", "null", "||", "consumesCompensationProperty", "==", "Boolean", ".", "TRUE", ";", "}", "}", ")", ";", "return", "new", "ArrayList", "<", "EventSubscriptionEntity", ">", "(", "subscriptions", ")", ";", "}" ]
Collect all compensate event subscriptions for scope of given execution.
[ "Collect", "all", "compensate", "event", "subscriptions", "for", "scope", "of", "given", "execution", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/helper/CompensationUtil.java#L184-L209
16,435
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/helper/CompensationUtil.java
CompensationUtil.collectCompensateEventSubscriptionsForActivity
public static List<EventSubscriptionEntity> collectCompensateEventSubscriptionsForActivity(ActivityExecution execution, String activityRef) { final List<EventSubscriptionEntity> eventSubscriptions = collectCompensateEventSubscriptionsForScope(execution); final String subscriptionActivityId = getSubscriptionActivityId(execution, activityRef); List<EventSubscriptionEntity> eventSubscriptionsForActivity = new ArrayList<EventSubscriptionEntity>(); for (EventSubscriptionEntity subscription : eventSubscriptions) { if (subscriptionActivityId.equals(subscription.getActivityId())) { eventSubscriptionsForActivity.add(subscription); } } return eventSubscriptionsForActivity; }
java
public static List<EventSubscriptionEntity> collectCompensateEventSubscriptionsForActivity(ActivityExecution execution, String activityRef) { final List<EventSubscriptionEntity> eventSubscriptions = collectCompensateEventSubscriptionsForScope(execution); final String subscriptionActivityId = getSubscriptionActivityId(execution, activityRef); List<EventSubscriptionEntity> eventSubscriptionsForActivity = new ArrayList<EventSubscriptionEntity>(); for (EventSubscriptionEntity subscription : eventSubscriptions) { if (subscriptionActivityId.equals(subscription.getActivityId())) { eventSubscriptionsForActivity.add(subscription); } } return eventSubscriptionsForActivity; }
[ "public", "static", "List", "<", "EventSubscriptionEntity", ">", "collectCompensateEventSubscriptionsForActivity", "(", "ActivityExecution", "execution", ",", "String", "activityRef", ")", "{", "final", "List", "<", "EventSubscriptionEntity", ">", "eventSubscriptions", "=", "collectCompensateEventSubscriptionsForScope", "(", "execution", ")", ";", "final", "String", "subscriptionActivityId", "=", "getSubscriptionActivityId", "(", "execution", ",", "activityRef", ")", ";", "List", "<", "EventSubscriptionEntity", ">", "eventSubscriptionsForActivity", "=", "new", "ArrayList", "<", "EventSubscriptionEntity", ">", "(", ")", ";", "for", "(", "EventSubscriptionEntity", "subscription", ":", "eventSubscriptions", ")", "{", "if", "(", "subscriptionActivityId", ".", "equals", "(", "subscription", ".", "getActivityId", "(", ")", ")", ")", "{", "eventSubscriptionsForActivity", ".", "add", "(", "subscription", ")", ";", "}", "}", "return", "eventSubscriptionsForActivity", ";", "}" ]
Collect all compensate event subscriptions for activity on the scope of given execution.
[ "Collect", "all", "compensate", "event", "subscriptions", "for", "activity", "on", "the", "scope", "of", "given", "execution", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/helper/CompensationUtil.java#L215-L227
16,436
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/AuthorizationException.java
AuthorizationException.generateExceptionMessage
private static String generateExceptionMessage(String userId, List<MissingAuthorization> missingAuthorizations) { StringBuilder sBuilder = new StringBuilder(); sBuilder.append("The user with id '"); sBuilder.append(userId); sBuilder.append("' does not have one of the following permissions: "); boolean first = true; for(MissingAuthorization missingAuthorization: missingAuthorizations) { if (!first) { sBuilder.append(" or "); } else { first = false; } sBuilder.append(generateMissingAuthorizationMessage(missingAuthorization)); } return sBuilder.toString(); }
java
private static String generateExceptionMessage(String userId, List<MissingAuthorization> missingAuthorizations) { StringBuilder sBuilder = new StringBuilder(); sBuilder.append("The user with id '"); sBuilder.append(userId); sBuilder.append("' does not have one of the following permissions: "); boolean first = true; for(MissingAuthorization missingAuthorization: missingAuthorizations) { if (!first) { sBuilder.append(" or "); } else { first = false; } sBuilder.append(generateMissingAuthorizationMessage(missingAuthorization)); } return sBuilder.toString(); }
[ "private", "static", "String", "generateExceptionMessage", "(", "String", "userId", ",", "List", "<", "MissingAuthorization", ">", "missingAuthorizations", ")", "{", "StringBuilder", "sBuilder", "=", "new", "StringBuilder", "(", ")", ";", "sBuilder", ".", "append", "(", "\"The user with id '\"", ")", ";", "sBuilder", ".", "append", "(", "userId", ")", ";", "sBuilder", ".", "append", "(", "\"' does not have one of the following permissions: \"", ")", ";", "boolean", "first", "=", "true", ";", "for", "(", "MissingAuthorization", "missingAuthorization", ":", "missingAuthorizations", ")", "{", "if", "(", "!", "first", ")", "{", "sBuilder", ".", "append", "(", "\" or \"", ")", ";", "}", "else", "{", "first", "=", "false", ";", "}", "sBuilder", ".", "append", "(", "generateMissingAuthorizationMessage", "(", "missingAuthorization", ")", ")", ";", "}", "return", "sBuilder", ".", "toString", "(", ")", ";", "}" ]
Generate exception message from the missing authorizations. @param userId to use @param missingAuthorizations to use @return The prepared exception message
[ "Generate", "exception", "message", "from", "the", "missing", "authorizations", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/AuthorizationException.java#L151-L166
16,437
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/AuthorizationException.java
AuthorizationException.generateMissingAuthorizationMessage
private static String generateMissingAuthorizationMessage(MissingAuthorization exceptionInfo) { StringBuilder builder = new StringBuilder(); String permissionName = exceptionInfo.getViolatedPermissionName(); String resourceType = exceptionInfo.getResourceType(); String resourceId = exceptionInfo.getResourceId(); builder.append("'"); builder.append(permissionName); builder.append("' permission on resource '"); builder.append((resourceId != null ? (resourceId+"' of type '") : "" )); builder.append(resourceType); builder.append("'"); return builder.toString(); }
java
private static String generateMissingAuthorizationMessage(MissingAuthorization exceptionInfo) { StringBuilder builder = new StringBuilder(); String permissionName = exceptionInfo.getViolatedPermissionName(); String resourceType = exceptionInfo.getResourceType(); String resourceId = exceptionInfo.getResourceId(); builder.append("'"); builder.append(permissionName); builder.append("' permission on resource '"); builder.append((resourceId != null ? (resourceId+"' of type '") : "" )); builder.append(resourceType); builder.append("'"); return builder.toString(); }
[ "private", "static", "String", "generateMissingAuthorizationMessage", "(", "MissingAuthorization", "exceptionInfo", ")", "{", "StringBuilder", "builder", "=", "new", "StringBuilder", "(", ")", ";", "String", "permissionName", "=", "exceptionInfo", ".", "getViolatedPermissionName", "(", ")", ";", "String", "resourceType", "=", "exceptionInfo", ".", "getResourceType", "(", ")", ";", "String", "resourceId", "=", "exceptionInfo", ".", "getResourceId", "(", ")", ";", "builder", ".", "append", "(", "\"'\"", ")", ";", "builder", ".", "append", "(", "permissionName", ")", ";", "builder", ".", "append", "(", "\"' permission on resource '\"", ")", ";", "builder", ".", "append", "(", "(", "resourceId", "!=", "null", "?", "(", "resourceId", "+", "\"' of type '\"", ")", ":", "\"\"", ")", ")", ";", "builder", ".", "append", "(", "resourceType", ")", ";", "builder", ".", "append", "(", "\"'\"", ")", ";", "return", "builder", ".", "toString", "(", ")", ";", "}" ]
Generated exception message for the missing authorization. @param exceptionInfo to use
[ "Generated", "exception", "message", "for", "the", "missing", "authorization", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/AuthorizationException.java#L173-L186
16,438
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/ProcessEngines.java
ProcessEngines.getProcessEngine
public static ProcessEngine getProcessEngine(String processEngineName, boolean forceCreate) { if (!isInitialized) { init(forceCreate); } return processEngines.get(processEngineName); }
java
public static ProcessEngine getProcessEngine(String processEngineName, boolean forceCreate) { if (!isInitialized) { init(forceCreate); } return processEngines.get(processEngineName); }
[ "public", "static", "ProcessEngine", "getProcessEngine", "(", "String", "processEngineName", ",", "boolean", "forceCreate", ")", "{", "if", "(", "!", "isInitialized", ")", "{", "init", "(", "forceCreate", ")", ";", "}", "return", "processEngines", ".", "get", "(", "processEngineName", ")", ";", "}" ]
obtain a process engine by name. @param processEngineName is the name of the process engine or null for the default process engine.
[ "obtain", "a", "process", "engine", "by", "name", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/ProcessEngines.java#L246-L251
16,439
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/juel/Parser.java
Parser.parseInteger
protected Number parseInteger(String string) throws ParseException { try { return Long.valueOf(string); } catch (NumberFormatException e) { fail(INTEGER); return null; } }
java
protected Number parseInteger(String string) throws ParseException { try { return Long.valueOf(string); } catch (NumberFormatException e) { fail(INTEGER); return null; } }
[ "protected", "Number", "parseInteger", "(", "String", "string", ")", "throws", "ParseException", "{", "try", "{", "return", "Long", ".", "valueOf", "(", "string", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "fail", "(", "INTEGER", ")", ";", "return", "null", ";", "}", "}" ]
Parse an integer literal. @param string string to parse @return <code>Long.valueOf(string)</code>
[ "Parse", "an", "integer", "literal", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/juel/Parser.java#L170-L177
16,440
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/juel/Parser.java
Parser.parseFloat
protected Number parseFloat(String string) throws ParseException { try { return Double.valueOf(string); } catch (NumberFormatException e) { fail(FLOAT); return null; } }
java
protected Number parseFloat(String string) throws ParseException { try { return Double.valueOf(string); } catch (NumberFormatException e) { fail(FLOAT); return null; } }
[ "protected", "Number", "parseFloat", "(", "String", "string", ")", "throws", "ParseException", "{", "try", "{", "return", "Double", ".", "valueOf", "(", "string", ")", ";", "}", "catch", "(", "NumberFormatException", "e", ")", "{", "fail", "(", "FLOAT", ")", ";", "return", "null", ";", "}", "}" ]
Parse a floating point literal. @param string string to parse @return <code>Double.valueOf(string)</code>
[ "Parse", "a", "floating", "point", "literal", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/juel/Parser.java#L184-L191
16,441
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/juel/Parser.java
Parser.lookahead
protected final Token lookahead(int index) throws ScanException, ParseException { if (lookahead.isEmpty()) { lookahead = new LinkedList<LookaheadToken>(); } while (index >= lookahead.size()) { lookahead.add(new LookaheadToken(scanner.next(), scanner.getPosition())); } return lookahead.get(index).token; }
java
protected final Token lookahead(int index) throws ScanException, ParseException { if (lookahead.isEmpty()) { lookahead = new LinkedList<LookaheadToken>(); } while (index >= lookahead.size()) { lookahead.add(new LookaheadToken(scanner.next(), scanner.getPosition())); } return lookahead.get(index).token; }
[ "protected", "final", "Token", "lookahead", "(", "int", "index", ")", "throws", "ScanException", ",", "ParseException", "{", "if", "(", "lookahead", ".", "isEmpty", "(", ")", ")", "{", "lookahead", "=", "new", "LinkedList", "<", "LookaheadToken", ">", "(", ")", ";", "}", "while", "(", "index", ">=", "lookahead", ".", "size", "(", ")", ")", "{", "lookahead", ".", "add", "(", "new", "LookaheadToken", "(", "scanner", ".", "next", "(", ")", ",", "scanner", ".", "getPosition", "(", ")", ")", ")", ";", "}", "return", "lookahead", ".", "get", "(", "index", ")", ".", "token", ";", "}" ]
get lookahead symbol.
[ "get", "lookahead", "symbol", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/juel/Parser.java#L258-L266
16,442
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/javax/el/ExpressionFactory.java
ExpressionFactory.newInstance
private static ExpressionFactory newInstance(Properties properties, String className, ClassLoader classLoader) { Class<?> clazz = null; try { clazz = classLoader.loadClass(className.trim()); if (!ExpressionFactory.class.isAssignableFrom(clazz)) { throw new ELException("Invalid expression factory class: " + clazz.getName()); } } catch (ClassNotFoundException e) { throw new ELException("Could not find expression factory class", e); } try { if (properties != null) { Constructor<?> constructor = null; try { constructor = clazz.getConstructor(Properties.class); } catch (Exception e) { // do nothing } if (constructor != null) { return (ExpressionFactory) constructor.newInstance(properties); } } return (ExpressionFactory) clazz.newInstance(); } catch (Exception e) { throw new ELException("Could not create expression factory instance", e); } }
java
private static ExpressionFactory newInstance(Properties properties, String className, ClassLoader classLoader) { Class<?> clazz = null; try { clazz = classLoader.loadClass(className.trim()); if (!ExpressionFactory.class.isAssignableFrom(clazz)) { throw new ELException("Invalid expression factory class: " + clazz.getName()); } } catch (ClassNotFoundException e) { throw new ELException("Could not find expression factory class", e); } try { if (properties != null) { Constructor<?> constructor = null; try { constructor = clazz.getConstructor(Properties.class); } catch (Exception e) { // do nothing } if (constructor != null) { return (ExpressionFactory) constructor.newInstance(properties); } } return (ExpressionFactory) clazz.newInstance(); } catch (Exception e) { throw new ELException("Could not create expression factory instance", e); } }
[ "private", "static", "ExpressionFactory", "newInstance", "(", "Properties", "properties", ",", "String", "className", ",", "ClassLoader", "classLoader", ")", "{", "Class", "<", "?", ">", "clazz", "=", "null", ";", "try", "{", "clazz", "=", "classLoader", ".", "loadClass", "(", "className", ".", "trim", "(", ")", ")", ";", "if", "(", "!", "ExpressionFactory", ".", "class", ".", "isAssignableFrom", "(", "clazz", ")", ")", "{", "throw", "new", "ELException", "(", "\"Invalid expression factory class: \"", "+", "clazz", ".", "getName", "(", ")", ")", ";", "}", "}", "catch", "(", "ClassNotFoundException", "e", ")", "{", "throw", "new", "ELException", "(", "\"Could not find expression factory class\"", ",", "e", ")", ";", "}", "try", "{", "if", "(", "properties", "!=", "null", ")", "{", "Constructor", "<", "?", ">", "constructor", "=", "null", ";", "try", "{", "constructor", "=", "clazz", ".", "getConstructor", "(", "Properties", ".", "class", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "// do nothing", "}", "if", "(", "constructor", "!=", "null", ")", "{", "return", "(", "ExpressionFactory", ")", "constructor", ".", "newInstance", "(", "properties", ")", ";", "}", "}", "return", "(", "ExpressionFactory", ")", "clazz", ".", "newInstance", "(", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "throw", "new", "ELException", "(", "\"Could not create expression factory instance\"", ",", "e", ")", ";", "}", "}" ]
Create an ExpressionFactory instance. @param properties Properties passed to the constructor of the implementation. @return an instance of ExpressionFactory @param className The name of the ExpressionFactory class. @param classLoader The class loader to be used to load the class. @return An instance of ExpressionFactory. @throws ELException if the class could not be found or if it is not a subclass of ExpressionFactory or if the class could not be instantiated.
[ "Create", "an", "ExpressionFactory", "instance", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/javax/el/ExpressionFactory.java#L201-L227
16,443
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseImports
protected void parseImports() { List<Element> imports = rootElement.elements("import"); for (Element theImport : imports) { String importType = theImport.attribute("importType"); XMLImporter importer = this.getImporter(importType, theImport); if (importer == null) { addError("Could not import item of type " + importType, theImport); } else { importer.importFrom(theImport, this); } } }
java
protected void parseImports() { List<Element> imports = rootElement.elements("import"); for (Element theImport : imports) { String importType = theImport.attribute("importType"); XMLImporter importer = this.getImporter(importType, theImport); if (importer == null) { addError("Could not import item of type " + importType, theImport); } else { importer.importFrom(theImport, this); } } }
[ "protected", "void", "parseImports", "(", ")", "{", "List", "<", "Element", ">", "imports", "=", "rootElement", ".", "elements", "(", "\"import\"", ")", ";", "for", "(", "Element", "theImport", ":", "imports", ")", "{", "String", "importType", "=", "theImport", ".", "attribute", "(", "\"importType\"", ")", ";", "XMLImporter", "importer", "=", "this", ".", "getImporter", "(", "importType", ",", "theImport", ")", ";", "if", "(", "importer", "==", "null", ")", "{", "addError", "(", "\"Could not import item of type \"", "+", "importType", ",", "theImport", ")", ";", "}", "else", "{", "importer", ".", "importFrom", "(", "theImport", ",", "this", ")", ";", "}", "}", "}" ]
Parses the rootElement importing structures
[ "Parses", "the", "rootElement", "importing", "structures" ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L335-L346
16,444
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseMessages
public void parseMessages() { for (Element messageElement : rootElement.elements("message")) { String id = messageElement.attribute("id"); String messageName = messageElement.attribute("name"); Expression messageExpression = null; if (messageName != null) { messageExpression = expressionManager.createExpression(messageName); } MessageDefinition messageDefinition = new MessageDefinition(this.targetNamespace + ":" + id, messageExpression); this.messages.put(messageDefinition.getId(), messageDefinition); } }
java
public void parseMessages() { for (Element messageElement : rootElement.elements("message")) { String id = messageElement.attribute("id"); String messageName = messageElement.attribute("name"); Expression messageExpression = null; if (messageName != null) { messageExpression = expressionManager.createExpression(messageName); } MessageDefinition messageDefinition = new MessageDefinition(this.targetNamespace + ":" + id, messageExpression); this.messages.put(messageDefinition.getId(), messageDefinition); } }
[ "public", "void", "parseMessages", "(", ")", "{", "for", "(", "Element", "messageElement", ":", "rootElement", ".", "elements", "(", "\"message\"", ")", ")", "{", "String", "id", "=", "messageElement", ".", "attribute", "(", "\"id\"", ")", ";", "String", "messageName", "=", "messageElement", ".", "attribute", "(", "\"name\"", ")", ";", "Expression", "messageExpression", "=", "null", ";", "if", "(", "messageName", "!=", "null", ")", "{", "messageExpression", "=", "expressionManager", ".", "createExpression", "(", "messageName", ")", ";", "}", "MessageDefinition", "messageDefinition", "=", "new", "MessageDefinition", "(", "this", ".", "targetNamespace", "+", "\":\"", "+", "id", ",", "messageExpression", ")", ";", "this", ".", "messages", ".", "put", "(", "messageDefinition", ".", "getId", "(", ")", ",", "messageDefinition", ")", ";", "}", "}" ]
Parses the messages of the given definitions file. Messages are not contained within a process element, but they can be referenced from inner process elements.
[ "Parses", "the", "messages", "of", "the", "given", "definitions", "file", ".", "Messages", "are", "not", "contained", "within", "a", "process", "element", "but", "they", "can", "be", "referenced", "from", "inner", "process", "elements", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L372-L385
16,445
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseSignals
protected void parseSignals() { for (Element signalElement : rootElement.elements("signal")) { String id = signalElement.attribute("id"); String signalName = signalElement.attribute("name"); for (SignalDefinition signalDefinition : signals.values()) { if (signalDefinition.getName().equals(signalName)) { addError("duplicate signal name '" + signalName + "'.", signalElement); } } if (id == null) { addError("signal must have an id", signalElement); } else if (signalName == null) { addError("signal with id '" + id + "' has no name", signalElement); } else { Expression signalExpression = expressionManager.createExpression(signalName); SignalDefinition signal = new SignalDefinition(); signal.setId(this.targetNamespace + ":" + id); signal.setExpression(signalExpression); this.signals.put(signal.getId(), signal); } } }
java
protected void parseSignals() { for (Element signalElement : rootElement.elements("signal")) { String id = signalElement.attribute("id"); String signalName = signalElement.attribute("name"); for (SignalDefinition signalDefinition : signals.values()) { if (signalDefinition.getName().equals(signalName)) { addError("duplicate signal name '" + signalName + "'.", signalElement); } } if (id == null) { addError("signal must have an id", signalElement); } else if (signalName == null) { addError("signal with id '" + id + "' has no name", signalElement); } else { Expression signalExpression = expressionManager.createExpression(signalName); SignalDefinition signal = new SignalDefinition(); signal.setId(this.targetNamespace + ":" + id); signal.setExpression(signalExpression); this.signals.put(signal.getId(), signal); } } }
[ "protected", "void", "parseSignals", "(", ")", "{", "for", "(", "Element", "signalElement", ":", "rootElement", ".", "elements", "(", "\"signal\"", ")", ")", "{", "String", "id", "=", "signalElement", ".", "attribute", "(", "\"id\"", ")", ";", "String", "signalName", "=", "signalElement", ".", "attribute", "(", "\"name\"", ")", ";", "for", "(", "SignalDefinition", "signalDefinition", ":", "signals", ".", "values", "(", ")", ")", "{", "if", "(", "signalDefinition", ".", "getName", "(", ")", ".", "equals", "(", "signalName", ")", ")", "{", "addError", "(", "\"duplicate signal name '\"", "+", "signalName", "+", "\"'.\"", ",", "signalElement", ")", ";", "}", "}", "if", "(", "id", "==", "null", ")", "{", "addError", "(", "\"signal must have an id\"", ",", "signalElement", ")", ";", "}", "else", "if", "(", "signalName", "==", "null", ")", "{", "addError", "(", "\"signal with id '\"", "+", "id", "+", "\"' has no name\"", ",", "signalElement", ")", ";", "}", "else", "{", "Expression", "signalExpression", "=", "expressionManager", ".", "createExpression", "(", "signalName", ")", ";", "SignalDefinition", "signal", "=", "new", "SignalDefinition", "(", ")", ";", "signal", ".", "setId", "(", "this", ".", "targetNamespace", "+", "\":\"", "+", "id", ")", ";", "signal", ".", "setExpression", "(", "signalExpression", ")", ";", "this", ".", "signals", ".", "put", "(", "signal", ".", "getId", "(", ")", ",", "signal", ")", ";", "}", "}", "}" ]
Parses the signals of the given definitions file. Signals are not contained within a process element, but they can be referenced from inner process elements.
[ "Parses", "the", "signals", "of", "the", "given", "definitions", "file", ".", "Signals", "are", "not", "contained", "within", "a", "process", "element", "but", "they", "can", "be", "referenced", "from", "inner", "process", "elements", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L392-L416
16,446
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseProcessDefinitions
public void parseProcessDefinitions() { for (Element processElement : rootElement.elements("process")) { boolean isExecutable = !deployment.isNew(); String isExecutableStr = processElement.attribute("isExecutable"); if (isExecutableStr != null) { isExecutable = Boolean.parseBoolean(isExecutableStr); if (!isExecutable) { LOG.ignoringNonExecutableProcess(processElement.attribute("id")); } } else { LOG.missingIsExecutableAttribute(processElement.attribute("id")); } // Only process executable processes if (isExecutable) { processDefinitions.add(parseProcess(processElement)); } } }
java
public void parseProcessDefinitions() { for (Element processElement : rootElement.elements("process")) { boolean isExecutable = !deployment.isNew(); String isExecutableStr = processElement.attribute("isExecutable"); if (isExecutableStr != null) { isExecutable = Boolean.parseBoolean(isExecutableStr); if (!isExecutable) { LOG.ignoringNonExecutableProcess(processElement.attribute("id")); } } else { LOG.missingIsExecutableAttribute(processElement.attribute("id")); } // Only process executable processes if (isExecutable) { processDefinitions.add(parseProcess(processElement)); } } }
[ "public", "void", "parseProcessDefinitions", "(", ")", "{", "for", "(", "Element", "processElement", ":", "rootElement", ".", "elements", "(", "\"process\"", ")", ")", "{", "boolean", "isExecutable", "=", "!", "deployment", ".", "isNew", "(", ")", ";", "String", "isExecutableStr", "=", "processElement", ".", "attribute", "(", "\"isExecutable\"", ")", ";", "if", "(", "isExecutableStr", "!=", "null", ")", "{", "isExecutable", "=", "Boolean", ".", "parseBoolean", "(", "isExecutableStr", ")", ";", "if", "(", "!", "isExecutable", ")", "{", "LOG", ".", "ignoringNonExecutableProcess", "(", "processElement", ".", "attribute", "(", "\"id\"", ")", ")", ";", "}", "}", "else", "{", "LOG", ".", "missingIsExecutableAttribute", "(", "processElement", ".", "attribute", "(", "\"id\"", ")", ")", ";", "}", "// Only process executable processes", "if", "(", "isExecutable", ")", "{", "processDefinitions", ".", "add", "(", "parseProcess", "(", "processElement", ")", ")", ";", "}", "}", "}" ]
Parses all the process definitions defined within the 'definitions' root element.
[ "Parses", "all", "the", "process", "definitions", "defined", "within", "the", "definitions", "root", "element", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L471-L489
16,447
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseCollaboration
public void parseCollaboration() { Element collaboration = rootElement.element("collaboration"); if (collaboration != null) { for (Element participant : collaboration.elements("participant")) { String processRef = participant.attribute("processRef"); if (processRef != null) { ProcessDefinitionImpl procDef = getProcessDefinition(processRef); if (procDef != null) { // Set participant process on the procDef, so it can get rendered // later on if needed ParticipantProcess participantProcess = new ParticipantProcess(); participantProcess.setId(participant.attribute("id")); participantProcess.setName(participant.attribute("name")); procDef.setParticipantProcess(participantProcess); participantProcesses.put(participantProcess.getId(), processRef); } } } } }
java
public void parseCollaboration() { Element collaboration = rootElement.element("collaboration"); if (collaboration != null) { for (Element participant : collaboration.elements("participant")) { String processRef = participant.attribute("processRef"); if (processRef != null) { ProcessDefinitionImpl procDef = getProcessDefinition(processRef); if (procDef != null) { // Set participant process on the procDef, so it can get rendered // later on if needed ParticipantProcess participantProcess = new ParticipantProcess(); participantProcess.setId(participant.attribute("id")); participantProcess.setName(participant.attribute("name")); procDef.setParticipantProcess(participantProcess); participantProcesses.put(participantProcess.getId(), processRef); } } } } }
[ "public", "void", "parseCollaboration", "(", ")", "{", "Element", "collaboration", "=", "rootElement", ".", "element", "(", "\"collaboration\"", ")", ";", "if", "(", "collaboration", "!=", "null", ")", "{", "for", "(", "Element", "participant", ":", "collaboration", ".", "elements", "(", "\"participant\"", ")", ")", "{", "String", "processRef", "=", "participant", ".", "attribute", "(", "\"processRef\"", ")", ";", "if", "(", "processRef", "!=", "null", ")", "{", "ProcessDefinitionImpl", "procDef", "=", "getProcessDefinition", "(", "processRef", ")", ";", "if", "(", "procDef", "!=", "null", ")", "{", "// Set participant process on the procDef, so it can get rendered", "// later on if needed", "ParticipantProcess", "participantProcess", "=", "new", "ParticipantProcess", "(", ")", ";", "participantProcess", ".", "setId", "(", "participant", ".", "attribute", "(", "\"id\"", ")", ")", ";", "participantProcess", ".", "setName", "(", "participant", ".", "attribute", "(", "\"name\"", ")", ")", ";", "procDef", ".", "setParticipantProcess", "(", "participantProcess", ")", ";", "participantProcesses", ".", "put", "(", "participantProcess", ".", "getId", "(", ")", ",", "processRef", ")", ";", "}", "}", "}", "}", "}" ]
Parses the collaboration definition defined within the 'definitions' root element and get all participants to lookup their process references during DI parsing.
[ "Parses", "the", "collaboration", "definition", "defined", "within", "the", "definitions", "root", "element", "and", "get", "all", "participants", "to", "lookup", "their", "process", "references", "during", "DI", "parsing", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L496-L516
16,448
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.setActivityAsyncDelegates
protected void setActivityAsyncDelegates(final ActivityImpl activity) { activity.setDelegateAsyncAfterUpdate(new ActivityImpl.AsyncAfterUpdate() { @Override public void updateAsyncAfter(boolean asyncAfter, boolean exclusive) { if (asyncAfter) { addMessageJobDeclaration(new AsyncAfterMessageJobDeclaration(), activity, exclusive); } else { removeMessageJobDeclarationWithJobConfiguration(activity, MessageJobDeclaration.ASYNC_AFTER); } } }); activity.setDelegateAsyncBeforeUpdate(new ActivityImpl.AsyncBeforeUpdate() { @Override public void updateAsyncBefore(boolean asyncBefore, boolean exclusive) { if (asyncBefore) { addMessageJobDeclaration(new AsyncBeforeMessageJobDeclaration(), activity, exclusive); } else { removeMessageJobDeclarationWithJobConfiguration(activity, MessageJobDeclaration.ASYNC_BEFORE); } } }); }
java
protected void setActivityAsyncDelegates(final ActivityImpl activity) { activity.setDelegateAsyncAfterUpdate(new ActivityImpl.AsyncAfterUpdate() { @Override public void updateAsyncAfter(boolean asyncAfter, boolean exclusive) { if (asyncAfter) { addMessageJobDeclaration(new AsyncAfterMessageJobDeclaration(), activity, exclusive); } else { removeMessageJobDeclarationWithJobConfiguration(activity, MessageJobDeclaration.ASYNC_AFTER); } } }); activity.setDelegateAsyncBeforeUpdate(new ActivityImpl.AsyncBeforeUpdate() { @Override public void updateAsyncBefore(boolean asyncBefore, boolean exclusive) { if (asyncBefore) { addMessageJobDeclaration(new AsyncBeforeMessageJobDeclaration(), activity, exclusive); } else { removeMessageJobDeclarationWithJobConfiguration(activity, MessageJobDeclaration.ASYNC_BEFORE); } } }); }
[ "protected", "void", "setActivityAsyncDelegates", "(", "final", "ActivityImpl", "activity", ")", "{", "activity", ".", "setDelegateAsyncAfterUpdate", "(", "new", "ActivityImpl", ".", "AsyncAfterUpdate", "(", ")", "{", "@", "Override", "public", "void", "updateAsyncAfter", "(", "boolean", "asyncAfter", ",", "boolean", "exclusive", ")", "{", "if", "(", "asyncAfter", ")", "{", "addMessageJobDeclaration", "(", "new", "AsyncAfterMessageJobDeclaration", "(", ")", ",", "activity", ",", "exclusive", ")", ";", "}", "else", "{", "removeMessageJobDeclarationWithJobConfiguration", "(", "activity", ",", "MessageJobDeclaration", ".", "ASYNC_AFTER", ")", ";", "}", "}", "}", ")", ";", "activity", ".", "setDelegateAsyncBeforeUpdate", "(", "new", "ActivityImpl", ".", "AsyncBeforeUpdate", "(", ")", "{", "@", "Override", "public", "void", "updateAsyncBefore", "(", "boolean", "asyncBefore", ",", "boolean", "exclusive", ")", "{", "if", "(", "asyncBefore", ")", "{", "addMessageJobDeclaration", "(", "new", "AsyncBeforeMessageJobDeclaration", "(", ")", ",", "activity", ",", "exclusive", ")", ";", "}", "else", "{", "removeMessageJobDeclarationWithJobConfiguration", "(", "activity", ",", "MessageJobDeclaration", ".", "ASYNC_BEFORE", ")", ";", "}", "}", "}", ")", ";", "}" ]
Sets the delegates for the activity, which will be called if the attribute asyncAfter or asyncBefore was changed. @param activity the activity which gets the delegates
[ "Sets", "the", "delegates", "for", "the", "activity", "which", "will", "be", "called", "if", "the", "attribute", "asyncAfter", "or", "asyncBefore", "was", "changed", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L1797-L1819
16,449
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.addMessageJobDeclaration
protected void addMessageJobDeclaration(MessageJobDeclaration messageJobDeclaration, ActivityImpl activity, boolean exclusive) { ProcessDefinition procDef = (ProcessDefinition) activity.getProcessDefinition(); if (!exists(messageJobDeclaration, procDef.getKey(), activity.getActivityId())) { messageJobDeclaration.setExclusive(exclusive); messageJobDeclaration.setActivity(activity); messageJobDeclaration.setJobPriorityProvider((ParameterValueProvider) activity.getProperty(PROPERTYNAME_JOB_PRIORITY)); addMessageJobDeclarationToActivity(messageJobDeclaration, activity); addJobDeclarationToProcessDefinition(messageJobDeclaration, procDef); } }
java
protected void addMessageJobDeclaration(MessageJobDeclaration messageJobDeclaration, ActivityImpl activity, boolean exclusive) { ProcessDefinition procDef = (ProcessDefinition) activity.getProcessDefinition(); if (!exists(messageJobDeclaration, procDef.getKey(), activity.getActivityId())) { messageJobDeclaration.setExclusive(exclusive); messageJobDeclaration.setActivity(activity); messageJobDeclaration.setJobPriorityProvider((ParameterValueProvider) activity.getProperty(PROPERTYNAME_JOB_PRIORITY)); addMessageJobDeclarationToActivity(messageJobDeclaration, activity); addJobDeclarationToProcessDefinition(messageJobDeclaration, procDef); } }
[ "protected", "void", "addMessageJobDeclaration", "(", "MessageJobDeclaration", "messageJobDeclaration", ",", "ActivityImpl", "activity", ",", "boolean", "exclusive", ")", "{", "ProcessDefinition", "procDef", "=", "(", "ProcessDefinition", ")", "activity", ".", "getProcessDefinition", "(", ")", ";", "if", "(", "!", "exists", "(", "messageJobDeclaration", ",", "procDef", ".", "getKey", "(", ")", ",", "activity", ".", "getActivityId", "(", ")", ")", ")", "{", "messageJobDeclaration", ".", "setExclusive", "(", "exclusive", ")", ";", "messageJobDeclaration", ".", "setActivity", "(", "activity", ")", ";", "messageJobDeclaration", ".", "setJobPriorityProvider", "(", "(", "ParameterValueProvider", ")", "activity", ".", "getProperty", "(", "PROPERTYNAME_JOB_PRIORITY", ")", ")", ";", "addMessageJobDeclarationToActivity", "(", "messageJobDeclaration", ",", "activity", ")", ";", "addJobDeclarationToProcessDefinition", "(", "messageJobDeclaration", ",", "procDef", ")", ";", "}", "}" ]
Adds the new message job declaration to existing declarations. There will be executed an existing check before the adding is executed. @param messageJobDeclaration the new message job declaration @param activity the corresponding activity @param exclusive the flag which indicates if the async should be exclusive
[ "Adds", "the", "new", "message", "job", "declaration", "to", "existing", "declarations", ".", "There", "will", "be", "executed", "an", "existing", "check", "before", "the", "adding", "is", "executed", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L1829-L1839
16,450
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.exists
protected boolean exists(MessageJobDeclaration msgJobdecl, String procDefKey, String activityId) { boolean exist = false; List<JobDeclaration<?, ?>> declarations = jobDeclarations.get(procDefKey); if (declarations != null) { for (int i = 0; i < declarations.size() && !exist; i++) { JobDeclaration<?, ?> decl = declarations.get(i); if (decl.getActivityId().equals(activityId) && decl.getJobConfiguration().equalsIgnoreCase(msgJobdecl.getJobConfiguration())) { exist = true; } } } return exist; }
java
protected boolean exists(MessageJobDeclaration msgJobdecl, String procDefKey, String activityId) { boolean exist = false; List<JobDeclaration<?, ?>> declarations = jobDeclarations.get(procDefKey); if (declarations != null) { for (int i = 0; i < declarations.size() && !exist; i++) { JobDeclaration<?, ?> decl = declarations.get(i); if (decl.getActivityId().equals(activityId) && decl.getJobConfiguration().equalsIgnoreCase(msgJobdecl.getJobConfiguration())) { exist = true; } } } return exist; }
[ "protected", "boolean", "exists", "(", "MessageJobDeclaration", "msgJobdecl", ",", "String", "procDefKey", ",", "String", "activityId", ")", "{", "boolean", "exist", "=", "false", ";", "List", "<", "JobDeclaration", "<", "?", ",", "?", ">", ">", "declarations", "=", "jobDeclarations", ".", "get", "(", "procDefKey", ")", ";", "if", "(", "declarations", "!=", "null", ")", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "declarations", ".", "size", "(", ")", "&&", "!", "exist", ";", "i", "++", ")", "{", "JobDeclaration", "<", "?", ",", "?", ">", "decl", "=", "declarations", ".", "get", "(", "i", ")", ";", "if", "(", "decl", ".", "getActivityId", "(", ")", ".", "equals", "(", "activityId", ")", "&&", "decl", ".", "getJobConfiguration", "(", ")", ".", "equalsIgnoreCase", "(", "msgJobdecl", ".", "getJobConfiguration", "(", ")", ")", ")", "{", "exist", "=", "true", ";", "}", "}", "}", "return", "exist", ";", "}" ]
Checks whether the message declaration already exists. @param msgJobdecl the message job declaration which is searched @param procDefKey the corresponding process definition key @param activityId the corresponding activity id @return true if the message job declaration exists, false otherwise
[ "Checks", "whether", "the", "message", "declaration", "already", "exists", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L1849-L1862
16,451
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.removeMessageJobDeclarationWithJobConfiguration
protected void removeMessageJobDeclarationWithJobConfiguration(ActivityImpl activity, String jobConfiguration) { List<MessageJobDeclaration> messageJobDeclarations = (List<MessageJobDeclaration>) activity.getProperty(PROPERTYNAME_MESSAGE_JOB_DECLARATION); if (messageJobDeclarations != null) { Iterator<MessageJobDeclaration> iter = messageJobDeclarations.iterator(); while (iter.hasNext()) { MessageJobDeclaration msgDecl = iter.next(); if (msgDecl.getJobConfiguration().equalsIgnoreCase(jobConfiguration) && msgDecl.getActivityId().equalsIgnoreCase(activity.getActivityId())) { iter.remove(); } } } ProcessDefinition procDef = (ProcessDefinition) activity.getProcessDefinition(); List<JobDeclaration<?, ?>> declarations = jobDeclarations.get(procDef.getKey()); if (declarations != null) { Iterator<JobDeclaration<?, ?>> iter = declarations.iterator(); while (iter.hasNext()) { JobDeclaration<?, ?> jobDcl = iter.next(); if (jobDcl.getJobConfiguration().equalsIgnoreCase(jobConfiguration) && jobDcl.getActivityId().equalsIgnoreCase(activity.getActivityId())) { iter.remove(); } } } }
java
protected void removeMessageJobDeclarationWithJobConfiguration(ActivityImpl activity, String jobConfiguration) { List<MessageJobDeclaration> messageJobDeclarations = (List<MessageJobDeclaration>) activity.getProperty(PROPERTYNAME_MESSAGE_JOB_DECLARATION); if (messageJobDeclarations != null) { Iterator<MessageJobDeclaration> iter = messageJobDeclarations.iterator(); while (iter.hasNext()) { MessageJobDeclaration msgDecl = iter.next(); if (msgDecl.getJobConfiguration().equalsIgnoreCase(jobConfiguration) && msgDecl.getActivityId().equalsIgnoreCase(activity.getActivityId())) { iter.remove(); } } } ProcessDefinition procDef = (ProcessDefinition) activity.getProcessDefinition(); List<JobDeclaration<?, ?>> declarations = jobDeclarations.get(procDef.getKey()); if (declarations != null) { Iterator<JobDeclaration<?, ?>> iter = declarations.iterator(); while (iter.hasNext()) { JobDeclaration<?, ?> jobDcl = iter.next(); if (jobDcl.getJobConfiguration().equalsIgnoreCase(jobConfiguration) && jobDcl.getActivityId().equalsIgnoreCase(activity.getActivityId())) { iter.remove(); } } } }
[ "protected", "void", "removeMessageJobDeclarationWithJobConfiguration", "(", "ActivityImpl", "activity", ",", "String", "jobConfiguration", ")", "{", "List", "<", "MessageJobDeclaration", ">", "messageJobDeclarations", "=", "(", "List", "<", "MessageJobDeclaration", ">", ")", "activity", ".", "getProperty", "(", "PROPERTYNAME_MESSAGE_JOB_DECLARATION", ")", ";", "if", "(", "messageJobDeclarations", "!=", "null", ")", "{", "Iterator", "<", "MessageJobDeclaration", ">", "iter", "=", "messageJobDeclarations", ".", "iterator", "(", ")", ";", "while", "(", "iter", ".", "hasNext", "(", ")", ")", "{", "MessageJobDeclaration", "msgDecl", "=", "iter", ".", "next", "(", ")", ";", "if", "(", "msgDecl", ".", "getJobConfiguration", "(", ")", ".", "equalsIgnoreCase", "(", "jobConfiguration", ")", "&&", "msgDecl", ".", "getActivityId", "(", ")", ".", "equalsIgnoreCase", "(", "activity", ".", "getActivityId", "(", ")", ")", ")", "{", "iter", ".", "remove", "(", ")", ";", "}", "}", "}", "ProcessDefinition", "procDef", "=", "(", "ProcessDefinition", ")", "activity", ".", "getProcessDefinition", "(", ")", ";", "List", "<", "JobDeclaration", "<", "?", ",", "?", ">", ">", "declarations", "=", "jobDeclarations", ".", "get", "(", "procDef", ".", "getKey", "(", ")", ")", ";", "if", "(", "declarations", "!=", "null", ")", "{", "Iterator", "<", "JobDeclaration", "<", "?", ",", "?", ">", ">", "iter", "=", "declarations", ".", "iterator", "(", ")", ";", "while", "(", "iter", ".", "hasNext", "(", ")", ")", "{", "JobDeclaration", "<", "?", ",", "?", ">", "jobDcl", "=", "iter", ".", "next", "(", ")", ";", "if", "(", "jobDcl", ".", "getJobConfiguration", "(", ")", ".", "equalsIgnoreCase", "(", "jobConfiguration", ")", "&&", "jobDcl", ".", "getActivityId", "(", ")", ".", "equalsIgnoreCase", "(", "activity", ".", "getActivityId", "(", ")", ")", ")", "{", "iter", ".", "remove", "(", ")", ";", "}", "}", "}", "}" ]
Removes a job declaration which belongs to the given activity and has the given job configuration. @param activity the activity of the job declaration @param jobConfiguration the job configuration of the declaration
[ "Removes", "a", "job", "declaration", "which", "belongs", "to", "the", "given", "activity", "and", "has", "the", "given", "job", "configuration", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L1870-L1895
16,452
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseExclusiveGateway
public ActivityImpl parseExclusiveGateway(Element exclusiveGwElement, ScopeImpl scope) { ActivityImpl activity = createActivityOnScope(exclusiveGwElement, scope); activity.setActivityBehavior(new ExclusiveGatewayActivityBehavior()); parseAsynchronousContinuationForActivity(exclusiveGwElement, activity); parseExecutionListenersOnScope(exclusiveGwElement, activity); for (BpmnParseListener parseListener : parseListeners) { parseListener.parseExclusiveGateway(exclusiveGwElement, scope, activity); } return activity; }
java
public ActivityImpl parseExclusiveGateway(Element exclusiveGwElement, ScopeImpl scope) { ActivityImpl activity = createActivityOnScope(exclusiveGwElement, scope); activity.setActivityBehavior(new ExclusiveGatewayActivityBehavior()); parseAsynchronousContinuationForActivity(exclusiveGwElement, activity); parseExecutionListenersOnScope(exclusiveGwElement, activity); for (BpmnParseListener parseListener : parseListeners) { parseListener.parseExclusiveGateway(exclusiveGwElement, scope, activity); } return activity; }
[ "public", "ActivityImpl", "parseExclusiveGateway", "(", "Element", "exclusiveGwElement", ",", "ScopeImpl", "scope", ")", "{", "ActivityImpl", "activity", "=", "createActivityOnScope", "(", "exclusiveGwElement", ",", "scope", ")", ";", "activity", ".", "setActivityBehavior", "(", "new", "ExclusiveGatewayActivityBehavior", "(", ")", ")", ";", "parseAsynchronousContinuationForActivity", "(", "exclusiveGwElement", ",", "activity", ")", ";", "parseExecutionListenersOnScope", "(", "exclusiveGwElement", ",", "activity", ")", ";", "for", "(", "BpmnParseListener", "parseListener", ":", "parseListeners", ")", "{", "parseListener", ".", "parseExclusiveGateway", "(", "exclusiveGwElement", ",", "scope", ",", "activity", ")", ";", "}", "return", "activity", ";", "}" ]
Parses an exclusive gateway declaration.
[ "Parses", "an", "exclusive", "gateway", "declaration", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L1932-L1944
16,453
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseInclusiveGateway
public ActivityImpl parseInclusiveGateway(Element inclusiveGwElement, ScopeImpl scope) { ActivityImpl activity = createActivityOnScope(inclusiveGwElement, scope); activity.setActivityBehavior(new InclusiveGatewayActivityBehavior()); parseAsynchronousContinuationForActivity(inclusiveGwElement, activity); parseExecutionListenersOnScope(inclusiveGwElement, activity); for (BpmnParseListener parseListener : parseListeners) { parseListener.parseInclusiveGateway(inclusiveGwElement, scope, activity); } return activity; }
java
public ActivityImpl parseInclusiveGateway(Element inclusiveGwElement, ScopeImpl scope) { ActivityImpl activity = createActivityOnScope(inclusiveGwElement, scope); activity.setActivityBehavior(new InclusiveGatewayActivityBehavior()); parseAsynchronousContinuationForActivity(inclusiveGwElement, activity); parseExecutionListenersOnScope(inclusiveGwElement, activity); for (BpmnParseListener parseListener : parseListeners) { parseListener.parseInclusiveGateway(inclusiveGwElement, scope, activity); } return activity; }
[ "public", "ActivityImpl", "parseInclusiveGateway", "(", "Element", "inclusiveGwElement", ",", "ScopeImpl", "scope", ")", "{", "ActivityImpl", "activity", "=", "createActivityOnScope", "(", "inclusiveGwElement", ",", "scope", ")", ";", "activity", ".", "setActivityBehavior", "(", "new", "InclusiveGatewayActivityBehavior", "(", ")", ")", ";", "parseAsynchronousContinuationForActivity", "(", "inclusiveGwElement", ",", "activity", ")", ";", "parseExecutionListenersOnScope", "(", "inclusiveGwElement", ",", "activity", ")", ";", "for", "(", "BpmnParseListener", "parseListener", ":", "parseListeners", ")", "{", "parseListener", ".", "parseInclusiveGateway", "(", "inclusiveGwElement", ",", "scope", ",", "activity", ")", ";", "}", "return", "activity", ";", "}" ]
Parses an inclusive gateway declaration.
[ "Parses", "an", "inclusive", "gateway", "declaration", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L1949-L1961
16,454
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseParallelGateway
public ActivityImpl parseParallelGateway(Element parallelGwElement, ScopeImpl scope) { ActivityImpl activity = createActivityOnScope(parallelGwElement, scope); activity.setActivityBehavior(new ParallelGatewayActivityBehavior()); parseAsynchronousContinuationForActivity(parallelGwElement, activity); parseExecutionListenersOnScope(parallelGwElement, activity); for (BpmnParseListener parseListener : parseListeners) { parseListener.parseParallelGateway(parallelGwElement, scope, activity); } return activity; }
java
public ActivityImpl parseParallelGateway(Element parallelGwElement, ScopeImpl scope) { ActivityImpl activity = createActivityOnScope(parallelGwElement, scope); activity.setActivityBehavior(new ParallelGatewayActivityBehavior()); parseAsynchronousContinuationForActivity(parallelGwElement, activity); parseExecutionListenersOnScope(parallelGwElement, activity); for (BpmnParseListener parseListener : parseListeners) { parseListener.parseParallelGateway(parallelGwElement, scope, activity); } return activity; }
[ "public", "ActivityImpl", "parseParallelGateway", "(", "Element", "parallelGwElement", ",", "ScopeImpl", "scope", ")", "{", "ActivityImpl", "activity", "=", "createActivityOnScope", "(", "parallelGwElement", ",", "scope", ")", ";", "activity", ".", "setActivityBehavior", "(", "new", "ParallelGatewayActivityBehavior", "(", ")", ")", ";", "parseAsynchronousContinuationForActivity", "(", "parallelGwElement", ",", "activity", ")", ";", "parseExecutionListenersOnScope", "(", "parallelGwElement", ",", "activity", ")", ";", "for", "(", "BpmnParseListener", "parseListener", ":", "parseListeners", ")", "{", "parseListener", ".", "parseParallelGateway", "(", "parallelGwElement", ",", "scope", ",", "activity", ")", ";", "}", "return", "activity", ";", "}" ]
Parses a parallel gateway declaration.
[ "Parses", "a", "parallel", "gateway", "declaration", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L2018-L2030
16,455
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseScriptTask
public ActivityImpl parseScriptTask(Element scriptTaskElement, ScopeImpl scope) { ActivityImpl activity = createActivityOnScope(scriptTaskElement, scope); ScriptTaskActivityBehavior activityBehavior = parseScriptTaskElement(scriptTaskElement); if (activityBehavior != null) { parseAsynchronousContinuationForActivity(scriptTaskElement, activity); activity.setActivityBehavior(activityBehavior); parseExecutionListenersOnScope(scriptTaskElement, activity); for (BpmnParseListener parseListener : parseListeners) { parseListener.parseScriptTask(scriptTaskElement, scope, activity); } } return activity; }
java
public ActivityImpl parseScriptTask(Element scriptTaskElement, ScopeImpl scope) { ActivityImpl activity = createActivityOnScope(scriptTaskElement, scope); ScriptTaskActivityBehavior activityBehavior = parseScriptTaskElement(scriptTaskElement); if (activityBehavior != null) { parseAsynchronousContinuationForActivity(scriptTaskElement, activity); activity.setActivityBehavior(activityBehavior); parseExecutionListenersOnScope(scriptTaskElement, activity); for (BpmnParseListener parseListener : parseListeners) { parseListener.parseScriptTask(scriptTaskElement, scope, activity); } } return activity; }
[ "public", "ActivityImpl", "parseScriptTask", "(", "Element", "scriptTaskElement", ",", "ScopeImpl", "scope", ")", "{", "ActivityImpl", "activity", "=", "createActivityOnScope", "(", "scriptTaskElement", ",", "scope", ")", ";", "ScriptTaskActivityBehavior", "activityBehavior", "=", "parseScriptTaskElement", "(", "scriptTaskElement", ")", ";", "if", "(", "activityBehavior", "!=", "null", ")", "{", "parseAsynchronousContinuationForActivity", "(", "scriptTaskElement", ",", "activity", ")", ";", "activity", ".", "setActivityBehavior", "(", "activityBehavior", ")", ";", "parseExecutionListenersOnScope", "(", "scriptTaskElement", ",", "activity", ")", ";", "for", "(", "BpmnParseListener", "parseListener", ":", "parseListeners", ")", "{", "parseListener", ".", "parseScriptTask", "(", "scriptTaskElement", ",", "scope", ",", "activity", ")", ";", "}", "}", "return", "activity", ";", "}" ]
Parses a scriptTask declaration.
[ "Parses", "a", "scriptTask", "declaration", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L2035-L2053
16,456
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseBusinessRuleTask
public ActivityImpl parseBusinessRuleTask(Element businessRuleTaskElement, ScopeImpl scope) { String decisionRef = businessRuleTaskElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "decisionRef"); if (decisionRef != null) { return parseDmnBusinessRuleTask(businessRuleTaskElement, scope); } else { return parseServiceTaskLike("businessRuleTask", businessRuleTaskElement, scope); } }
java
public ActivityImpl parseBusinessRuleTask(Element businessRuleTaskElement, ScopeImpl scope) { String decisionRef = businessRuleTaskElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "decisionRef"); if (decisionRef != null) { return parseDmnBusinessRuleTask(businessRuleTaskElement, scope); } else { return parseServiceTaskLike("businessRuleTask", businessRuleTaskElement, scope); } }
[ "public", "ActivityImpl", "parseBusinessRuleTask", "(", "Element", "businessRuleTaskElement", ",", "ScopeImpl", "scope", ")", "{", "String", "decisionRef", "=", "businessRuleTaskElement", ".", "attributeNS", "(", "CAMUNDA_BPMN_EXTENSIONS_NS", ",", "\"decisionRef\"", ")", ";", "if", "(", "decisionRef", "!=", "null", ")", "{", "return", "parseDmnBusinessRuleTask", "(", "businessRuleTaskElement", ",", "scope", ")", ";", "}", "else", "{", "return", "parseServiceTaskLike", "(", "\"businessRuleTask\"", ",", "businessRuleTaskElement", ",", "scope", ")", ";", "}", "}" ]
Parses a businessRuleTask declaration.
[ "Parses", "a", "businessRuleTask", "declaration", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L2162-L2170
16,457
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseDmnBusinessRuleTask
protected ActivityImpl parseDmnBusinessRuleTask(Element businessRuleTaskElement, ScopeImpl scope) { ActivityImpl activity = createActivityOnScope(businessRuleTaskElement, scope); // the activity is a scope since the result variable is stored as local variable activity.setScope(true); parseAsynchronousContinuationForActivity(businessRuleTaskElement, activity); String decisionRef = businessRuleTaskElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "decisionRef"); BaseCallableElement callableElement = new BaseCallableElement(); callableElement.setDeploymentId(deployment.getId()); ParameterValueProvider definitionKeyProvider = createParameterValueProvider(decisionRef, expressionManager); callableElement.setDefinitionKeyValueProvider(definitionKeyProvider); parseBinding(businessRuleTaskElement, activity, callableElement, "decisionRefBinding"); parseVersion(businessRuleTaskElement, activity, callableElement, "decisionRefBinding", "decisionRefVersion"); parseVersionTag(businessRuleTaskElement, activity, callableElement, "decisionRefBinding", "decisionRefVersionTag"); parseTenantId(businessRuleTaskElement, activity, callableElement, "decisionRefTenantId"); String resultVariable = parseResultVariable(businessRuleTaskElement); DecisionResultMapper decisionResultMapper = parseDecisionResultMapper(businessRuleTaskElement); DmnBusinessRuleTaskActivityBehavior behavior = new DmnBusinessRuleTaskActivityBehavior(callableElement, resultVariable, decisionResultMapper); activity.setActivityBehavior(behavior); parseExecutionListenersOnScope(businessRuleTaskElement, activity); for (BpmnParseListener parseListener : parseListeners) { parseListener.parseBusinessRuleTask(businessRuleTaskElement, scope, activity); } return activity; }
java
protected ActivityImpl parseDmnBusinessRuleTask(Element businessRuleTaskElement, ScopeImpl scope) { ActivityImpl activity = createActivityOnScope(businessRuleTaskElement, scope); // the activity is a scope since the result variable is stored as local variable activity.setScope(true); parseAsynchronousContinuationForActivity(businessRuleTaskElement, activity); String decisionRef = businessRuleTaskElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "decisionRef"); BaseCallableElement callableElement = new BaseCallableElement(); callableElement.setDeploymentId(deployment.getId()); ParameterValueProvider definitionKeyProvider = createParameterValueProvider(decisionRef, expressionManager); callableElement.setDefinitionKeyValueProvider(definitionKeyProvider); parseBinding(businessRuleTaskElement, activity, callableElement, "decisionRefBinding"); parseVersion(businessRuleTaskElement, activity, callableElement, "decisionRefBinding", "decisionRefVersion"); parseVersionTag(businessRuleTaskElement, activity, callableElement, "decisionRefBinding", "decisionRefVersionTag"); parseTenantId(businessRuleTaskElement, activity, callableElement, "decisionRefTenantId"); String resultVariable = parseResultVariable(businessRuleTaskElement); DecisionResultMapper decisionResultMapper = parseDecisionResultMapper(businessRuleTaskElement); DmnBusinessRuleTaskActivityBehavior behavior = new DmnBusinessRuleTaskActivityBehavior(callableElement, resultVariable, decisionResultMapper); activity.setActivityBehavior(behavior); parseExecutionListenersOnScope(businessRuleTaskElement, activity); for (BpmnParseListener parseListener : parseListeners) { parseListener.parseBusinessRuleTask(businessRuleTaskElement, scope, activity); } return activity; }
[ "protected", "ActivityImpl", "parseDmnBusinessRuleTask", "(", "Element", "businessRuleTaskElement", ",", "ScopeImpl", "scope", ")", "{", "ActivityImpl", "activity", "=", "createActivityOnScope", "(", "businessRuleTaskElement", ",", "scope", ")", ";", "// the activity is a scope since the result variable is stored as local variable", "activity", ".", "setScope", "(", "true", ")", ";", "parseAsynchronousContinuationForActivity", "(", "businessRuleTaskElement", ",", "activity", ")", ";", "String", "decisionRef", "=", "businessRuleTaskElement", ".", "attributeNS", "(", "CAMUNDA_BPMN_EXTENSIONS_NS", ",", "\"decisionRef\"", ")", ";", "BaseCallableElement", "callableElement", "=", "new", "BaseCallableElement", "(", ")", ";", "callableElement", ".", "setDeploymentId", "(", "deployment", ".", "getId", "(", ")", ")", ";", "ParameterValueProvider", "definitionKeyProvider", "=", "createParameterValueProvider", "(", "decisionRef", ",", "expressionManager", ")", ";", "callableElement", ".", "setDefinitionKeyValueProvider", "(", "definitionKeyProvider", ")", ";", "parseBinding", "(", "businessRuleTaskElement", ",", "activity", ",", "callableElement", ",", "\"decisionRefBinding\"", ")", ";", "parseVersion", "(", "businessRuleTaskElement", ",", "activity", ",", "callableElement", ",", "\"decisionRefBinding\"", ",", "\"decisionRefVersion\"", ")", ";", "parseVersionTag", "(", "businessRuleTaskElement", ",", "activity", ",", "callableElement", ",", "\"decisionRefBinding\"", ",", "\"decisionRefVersionTag\"", ")", ";", "parseTenantId", "(", "businessRuleTaskElement", ",", "activity", ",", "callableElement", ",", "\"decisionRefTenantId\"", ")", ";", "String", "resultVariable", "=", "parseResultVariable", "(", "businessRuleTaskElement", ")", ";", "DecisionResultMapper", "decisionResultMapper", "=", "parseDecisionResultMapper", "(", "businessRuleTaskElement", ")", ";", "DmnBusinessRuleTaskActivityBehavior", "behavior", "=", "new", "DmnBusinessRuleTaskActivityBehavior", "(", "callableElement", ",", "resultVariable", ",", "decisionResultMapper", ")", ";", "activity", ".", "setActivityBehavior", "(", "behavior", ")", ";", "parseExecutionListenersOnScope", "(", "businessRuleTaskElement", ",", "activity", ")", ";", "for", "(", "BpmnParseListener", "parseListener", ":", "parseListeners", ")", "{", "parseListener", ".", "parseBusinessRuleTask", "(", "businessRuleTaskElement", ",", "scope", ",", "activity", ")", ";", "}", "return", "activity", ";", "}" ]
Parse a Business Rule Task which references a decision.
[ "Parse", "a", "Business", "Rule", "Task", "which", "references", "a", "decision", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L2175-L2208
16,458
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseAsynchronousContinuation
protected void parseAsynchronousContinuation(Element element, ActivityImpl activity) { boolean isAsyncBefore = isAsyncBefore(element); boolean isAsyncAfter = isAsyncAfter(element); boolean exclusive = isExclusive(element); // set properties on activity activity.setAsyncBefore(isAsyncBefore, exclusive); activity.setAsyncAfter(isAsyncAfter, exclusive); }
java
protected void parseAsynchronousContinuation(Element element, ActivityImpl activity) { boolean isAsyncBefore = isAsyncBefore(element); boolean isAsyncAfter = isAsyncAfter(element); boolean exclusive = isExclusive(element); // set properties on activity activity.setAsyncBefore(isAsyncBefore, exclusive); activity.setAsyncAfter(isAsyncAfter, exclusive); }
[ "protected", "void", "parseAsynchronousContinuation", "(", "Element", "element", ",", "ActivityImpl", "activity", ")", "{", "boolean", "isAsyncBefore", "=", "isAsyncBefore", "(", "element", ")", ";", "boolean", "isAsyncAfter", "=", "isAsyncAfter", "(", "element", ")", ";", "boolean", "exclusive", "=", "isExclusive", "(", "element", ")", ";", "// set properties on activity", "activity", ".", "setAsyncBefore", "(", "isAsyncBefore", ",", "exclusive", ")", ";", "activity", ".", "setAsyncAfter", "(", "isAsyncAfter", ",", "exclusive", ")", ";", "}" ]
Parse async continuation of the given element and create async jobs for the activity. @param element with async characteristics @param activity
[ "Parse", "async", "continuation", "of", "the", "given", "element", "and", "create", "async", "jobs", "for", "the", "activity", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L2253-L2262
16,459
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseSendTask
public ActivityImpl parseSendTask(Element sendTaskElement, ScopeImpl scope) { if (isServiceTaskLike(sendTaskElement)) { // CAM-942: If expression or class is set on a SendTask it behaves like a service task // to allow implementing the send handling yourself return parseServiceTaskLike("sendTask", sendTaskElement, scope); } else { ActivityImpl activity = createActivityOnScope(sendTaskElement, scope); parseAsynchronousContinuationForActivity(sendTaskElement, activity); parseExecutionListenersOnScope(sendTaskElement, activity); for (BpmnParseListener parseListener : parseListeners) { parseListener.parseSendTask(sendTaskElement, scope, activity); } // activity behavior could be set by a listener; thus, check is after listener invocation if (activity.getActivityBehavior() == null) { addError("One of the attributes 'class', 'delegateExpression', 'type', or 'expression' is mandatory on sendTask.", sendTaskElement); } return activity; } }
java
public ActivityImpl parseSendTask(Element sendTaskElement, ScopeImpl scope) { if (isServiceTaskLike(sendTaskElement)) { // CAM-942: If expression or class is set on a SendTask it behaves like a service task // to allow implementing the send handling yourself return parseServiceTaskLike("sendTask", sendTaskElement, scope); } else { ActivityImpl activity = createActivityOnScope(sendTaskElement, scope); parseAsynchronousContinuationForActivity(sendTaskElement, activity); parseExecutionListenersOnScope(sendTaskElement, activity); for (BpmnParseListener parseListener : parseListeners) { parseListener.parseSendTask(sendTaskElement, scope, activity); } // activity behavior could be set by a listener; thus, check is after listener invocation if (activity.getActivityBehavior() == null) { addError("One of the attributes 'class', 'delegateExpression', 'type', or 'expression' is mandatory on sendTask.", sendTaskElement); } return activity; } }
[ "public", "ActivityImpl", "parseSendTask", "(", "Element", "sendTaskElement", ",", "ScopeImpl", "scope", ")", "{", "if", "(", "isServiceTaskLike", "(", "sendTaskElement", ")", ")", "{", "// CAM-942: If expression or class is set on a SendTask it behaves like a service task", "// to allow implementing the send handling yourself", "return", "parseServiceTaskLike", "(", "\"sendTask\"", ",", "sendTaskElement", ",", "scope", ")", ";", "}", "else", "{", "ActivityImpl", "activity", "=", "createActivityOnScope", "(", "sendTaskElement", ",", "scope", ")", ";", "parseAsynchronousContinuationForActivity", "(", "sendTaskElement", ",", "activity", ")", ";", "parseExecutionListenersOnScope", "(", "sendTaskElement", ",", "activity", ")", ";", "for", "(", "BpmnParseListener", "parseListener", ":", "parseListeners", ")", "{", "parseListener", ".", "parseSendTask", "(", "sendTaskElement", ",", "scope", ",", "activity", ")", ";", "}", "// activity behavior could be set by a listener; thus, check is after listener invocation", "if", "(", "activity", ".", "getActivityBehavior", "(", ")", "==", "null", ")", "{", "addError", "(", "\"One of the attributes 'class', 'delegateExpression', 'type', or 'expression' is mandatory on sendTask.\"", ",", "sendTaskElement", ")", ";", "}", "return", "activity", ";", "}", "}" ]
Parses a sendTask declaration.
[ "Parses", "a", "sendTask", "declaration", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L2323-L2345
16,460
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseManualTask
public ActivityImpl parseManualTask(Element manualTaskElement, ScopeImpl scope) { ActivityImpl activity = createActivityOnScope(manualTaskElement, scope); activity.setActivityBehavior(new ManualTaskActivityBehavior()); parseAsynchronousContinuationForActivity(manualTaskElement, activity); parseExecutionListenersOnScope(manualTaskElement, activity); for (BpmnParseListener parseListener : parseListeners) { parseListener.parseManualTask(manualTaskElement, scope, activity); } return activity; }
java
public ActivityImpl parseManualTask(Element manualTaskElement, ScopeImpl scope) { ActivityImpl activity = createActivityOnScope(manualTaskElement, scope); activity.setActivityBehavior(new ManualTaskActivityBehavior()); parseAsynchronousContinuationForActivity(manualTaskElement, activity); parseExecutionListenersOnScope(manualTaskElement, activity); for (BpmnParseListener parseListener : parseListeners) { parseListener.parseManualTask(manualTaskElement, scope, activity); } return activity; }
[ "public", "ActivityImpl", "parseManualTask", "(", "Element", "manualTaskElement", ",", "ScopeImpl", "scope", ")", "{", "ActivityImpl", "activity", "=", "createActivityOnScope", "(", "manualTaskElement", ",", "scope", ")", ";", "activity", ".", "setActivityBehavior", "(", "new", "ManualTaskActivityBehavior", "(", ")", ")", ";", "parseAsynchronousContinuationForActivity", "(", "manualTaskElement", ",", "activity", ")", ";", "parseExecutionListenersOnScope", "(", "manualTaskElement", ",", "activity", ")", ";", "for", "(", "BpmnParseListener", "parseListener", ":", "parseListeners", ")", "{", "parseListener", ".", "parseManualTask", "(", "manualTaskElement", ",", "scope", ",", "activity", ")", ";", "}", "return", "activity", ";", "}" ]
Parses a manual task.
[ "Parses", "a", "manual", "task", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L2527-L2539
16,461
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseReceiveTask
public ActivityImpl parseReceiveTask(Element receiveTaskElement, ScopeImpl scope) { ActivityImpl activity = createActivityOnScope(receiveTaskElement, scope); activity.setActivityBehavior(new ReceiveTaskActivityBehavior()); parseAsynchronousContinuationForActivity(receiveTaskElement, activity); parseExecutionListenersOnScope(receiveTaskElement, activity); if (receiveTaskElement.attribute("messageRef") != null) { activity.setScope(true); activity.setEventScope(activity); EventSubscriptionDeclaration declaration = parseMessageEventDefinition(receiveTaskElement); declaration.setActivityId(activity.getActivityId()); declaration.setEventScopeActivityId(activity.getActivityId()); addEventSubscriptionDeclaration(declaration, activity, receiveTaskElement); } for (BpmnParseListener parseListener : parseListeners) { parseListener.parseReceiveTask(receiveTaskElement, scope, activity); } return activity; }
java
public ActivityImpl parseReceiveTask(Element receiveTaskElement, ScopeImpl scope) { ActivityImpl activity = createActivityOnScope(receiveTaskElement, scope); activity.setActivityBehavior(new ReceiveTaskActivityBehavior()); parseAsynchronousContinuationForActivity(receiveTaskElement, activity); parseExecutionListenersOnScope(receiveTaskElement, activity); if (receiveTaskElement.attribute("messageRef") != null) { activity.setScope(true); activity.setEventScope(activity); EventSubscriptionDeclaration declaration = parseMessageEventDefinition(receiveTaskElement); declaration.setActivityId(activity.getActivityId()); declaration.setEventScopeActivityId(activity.getActivityId()); addEventSubscriptionDeclaration(declaration, activity, receiveTaskElement); } for (BpmnParseListener parseListener : parseListeners) { parseListener.parseReceiveTask(receiveTaskElement, scope, activity); } return activity; }
[ "public", "ActivityImpl", "parseReceiveTask", "(", "Element", "receiveTaskElement", ",", "ScopeImpl", "scope", ")", "{", "ActivityImpl", "activity", "=", "createActivityOnScope", "(", "receiveTaskElement", ",", "scope", ")", ";", "activity", ".", "setActivityBehavior", "(", "new", "ReceiveTaskActivityBehavior", "(", ")", ")", ";", "parseAsynchronousContinuationForActivity", "(", "receiveTaskElement", ",", "activity", ")", ";", "parseExecutionListenersOnScope", "(", "receiveTaskElement", ",", "activity", ")", ";", "if", "(", "receiveTaskElement", ".", "attribute", "(", "\"messageRef\"", ")", "!=", "null", ")", "{", "activity", ".", "setScope", "(", "true", ")", ";", "activity", ".", "setEventScope", "(", "activity", ")", ";", "EventSubscriptionDeclaration", "declaration", "=", "parseMessageEventDefinition", "(", "receiveTaskElement", ")", ";", "declaration", ".", "setActivityId", "(", "activity", ".", "getActivityId", "(", ")", ")", ";", "declaration", ".", "setEventScopeActivityId", "(", "activity", ".", "getActivityId", "(", ")", ")", ";", "addEventSubscriptionDeclaration", "(", "declaration", ",", "activity", ",", "receiveTaskElement", ")", ";", "}", "for", "(", "BpmnParseListener", "parseListener", ":", "parseListeners", ")", "{", "parseListener", ".", "parseReceiveTask", "(", "receiveTaskElement", ",", "scope", ",", "activity", ")", ";", "}", "return", "activity", ";", "}" ]
Parses a receive task.
[ "Parses", "a", "receive", "task", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L2544-L2565
16,462
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseUserTask
public ActivityImpl parseUserTask(Element userTaskElement, ScopeImpl scope) { ActivityImpl activity = createActivityOnScope(userTaskElement, scope); parseAsynchronousContinuationForActivity(userTaskElement, activity); TaskDefinition taskDefinition = parseTaskDefinition(userTaskElement, activity.getId(), (ProcessDefinitionEntity) scope.getProcessDefinition()); TaskDecorator taskDecorator = new TaskDecorator(taskDefinition, expressionManager); UserTaskActivityBehavior userTaskActivity = new UserTaskActivityBehavior(taskDecorator); activity.setActivityBehavior(userTaskActivity); parseProperties(userTaskElement, activity); parseExecutionListenersOnScope(userTaskElement, activity); for (BpmnParseListener parseListener : parseListeners) { parseListener.parseUserTask(userTaskElement, scope, activity); } return activity; }
java
public ActivityImpl parseUserTask(Element userTaskElement, ScopeImpl scope) { ActivityImpl activity = createActivityOnScope(userTaskElement, scope); parseAsynchronousContinuationForActivity(userTaskElement, activity); TaskDefinition taskDefinition = parseTaskDefinition(userTaskElement, activity.getId(), (ProcessDefinitionEntity) scope.getProcessDefinition()); TaskDecorator taskDecorator = new TaskDecorator(taskDefinition, expressionManager); UserTaskActivityBehavior userTaskActivity = new UserTaskActivityBehavior(taskDecorator); activity.setActivityBehavior(userTaskActivity); parseProperties(userTaskElement, activity); parseExecutionListenersOnScope(userTaskElement, activity); for (BpmnParseListener parseListener : parseListeners) { parseListener.parseUserTask(userTaskElement, scope, activity); } return activity; }
[ "public", "ActivityImpl", "parseUserTask", "(", "Element", "userTaskElement", ",", "ScopeImpl", "scope", ")", "{", "ActivityImpl", "activity", "=", "createActivityOnScope", "(", "userTaskElement", ",", "scope", ")", ";", "parseAsynchronousContinuationForActivity", "(", "userTaskElement", ",", "activity", ")", ";", "TaskDefinition", "taskDefinition", "=", "parseTaskDefinition", "(", "userTaskElement", ",", "activity", ".", "getId", "(", ")", ",", "(", "ProcessDefinitionEntity", ")", "scope", ".", "getProcessDefinition", "(", ")", ")", ";", "TaskDecorator", "taskDecorator", "=", "new", "TaskDecorator", "(", "taskDefinition", ",", "expressionManager", ")", ";", "UserTaskActivityBehavior", "userTaskActivity", "=", "new", "UserTaskActivityBehavior", "(", "taskDecorator", ")", ";", "activity", ".", "setActivityBehavior", "(", "userTaskActivity", ")", ";", "parseProperties", "(", "userTaskElement", ",", "activity", ")", ";", "parseExecutionListenersOnScope", "(", "userTaskElement", ",", "activity", ")", ";", "for", "(", "BpmnParseListener", "parseListener", ":", "parseListeners", ")", "{", "parseListener", ".", "parseUserTask", "(", "userTaskElement", ",", "scope", ",", "activity", ")", ";", "}", "return", "activity", ";", "}" ]
Parses a userTask declaration.
[ "Parses", "a", "userTask", "declaration", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L2588-L2606
16,463
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseCommaSeparatedList
protected List<String> parseCommaSeparatedList(String s) { List<String> result = new ArrayList<String>(); if (s != null && !"".equals(s)) { StringCharacterIterator iterator = new StringCharacterIterator(s); char c = iterator.first(); StringBuilder strb = new StringBuilder(); boolean insideExpression = false; while (c != StringCharacterIterator.DONE) { if (c == '{' || c == '$') { insideExpression = true; } else if (c == '}') { insideExpression = false; } else if (c == ',' && !insideExpression) { result.add(strb.toString().trim()); strb.delete(0, strb.length()); } if (c != ',' || (insideExpression)) { strb.append(c); } c = iterator.next(); } if (strb.length() > 0) { result.add(strb.toString().trim()); } } return result; }
java
protected List<String> parseCommaSeparatedList(String s) { List<String> result = new ArrayList<String>(); if (s != null && !"".equals(s)) { StringCharacterIterator iterator = new StringCharacterIterator(s); char c = iterator.first(); StringBuilder strb = new StringBuilder(); boolean insideExpression = false; while (c != StringCharacterIterator.DONE) { if (c == '{' || c == '$') { insideExpression = true; } else if (c == '}') { insideExpression = false; } else if (c == ',' && !insideExpression) { result.add(strb.toString().trim()); strb.delete(0, strb.length()); } if (c != ',' || (insideExpression)) { strb.append(c); } c = iterator.next(); } if (strb.length() > 0) { result.add(strb.toString().trim()); } } return result; }
[ "protected", "List", "<", "String", ">", "parseCommaSeparatedList", "(", "String", "s", ")", "{", "List", "<", "String", ">", "result", "=", "new", "ArrayList", "<", "String", ">", "(", ")", ";", "if", "(", "s", "!=", "null", "&&", "!", "\"\"", ".", "equals", "(", "s", ")", ")", "{", "StringCharacterIterator", "iterator", "=", "new", "StringCharacterIterator", "(", "s", ")", ";", "char", "c", "=", "iterator", ".", "first", "(", ")", ";", "StringBuilder", "strb", "=", "new", "StringBuilder", "(", ")", ";", "boolean", "insideExpression", "=", "false", ";", "while", "(", "c", "!=", "StringCharacterIterator", ".", "DONE", ")", "{", "if", "(", "c", "==", "'", "'", "||", "c", "==", "'", "'", ")", "{", "insideExpression", "=", "true", ";", "}", "else", "if", "(", "c", "==", "'", "'", ")", "{", "insideExpression", "=", "false", ";", "}", "else", "if", "(", "c", "==", "'", "'", "&&", "!", "insideExpression", ")", "{", "result", ".", "add", "(", "strb", ".", "toString", "(", ")", ".", "trim", "(", ")", ")", ";", "strb", ".", "delete", "(", "0", ",", "strb", ".", "length", "(", ")", ")", ";", "}", "if", "(", "c", "!=", "'", "'", "||", "(", "insideExpression", ")", ")", "{", "strb", ".", "append", "(", "c", ")", ";", "}", "c", "=", "iterator", ".", "next", "(", ")", ";", "}", "if", "(", "strb", ".", "length", "(", ")", ">", "0", ")", "{", "result", ".", "add", "(", "strb", ".", "toString", "(", ")", ".", "trim", "(", ")", ")", ";", "}", "}", "return", "result", ";", "}" ]
Parses the given String as a list of comma separated entries, where an entry can possibly be an expression that has comma's. If somebody is smart enough to write a regex for this, please let us know. @return the entries of the comma separated list, trimmed.
[ "Parses", "the", "given", "String", "as", "a", "list", "of", "comma", "separated", "entries", "where", "an", "entry", "can", "possibly", "be", "an", "expression", "that", "has", "comma", "s", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L2764-L2797
16,464
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseSignalEventDefinition
protected EventSubscriptionDeclaration parseSignalEventDefinition(Element signalEventDefinitionElement, boolean isThrowing) { String signalRef = signalEventDefinitionElement.attribute("signalRef"); if (signalRef == null) { addError("signalEventDefinition does not have required property 'signalRef'", signalEventDefinitionElement); return null; } else { SignalDefinition signalDefinition = signals.get(resolveName(signalRef)); if (signalDefinition == null) { addError("Could not find signal with id '" + signalRef + "'", signalEventDefinitionElement); } EventSubscriptionDeclaration signalEventDefinition; if (isThrowing) { CallableElement payload = new CallableElement(); parseInputParameter(signalEventDefinitionElement, payload); signalEventDefinition = new EventSubscriptionDeclaration(signalDefinition.getExpression(), EventType.SIGNAL, payload); } else { signalEventDefinition = new EventSubscriptionDeclaration(signalDefinition.getExpression(), EventType.SIGNAL); } boolean throwingAsync = TRUE.equals(signalEventDefinitionElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "async", "false")); signalEventDefinition.setAsync(throwingAsync); return signalEventDefinition; } }
java
protected EventSubscriptionDeclaration parseSignalEventDefinition(Element signalEventDefinitionElement, boolean isThrowing) { String signalRef = signalEventDefinitionElement.attribute("signalRef"); if (signalRef == null) { addError("signalEventDefinition does not have required property 'signalRef'", signalEventDefinitionElement); return null; } else { SignalDefinition signalDefinition = signals.get(resolveName(signalRef)); if (signalDefinition == null) { addError("Could not find signal with id '" + signalRef + "'", signalEventDefinitionElement); } EventSubscriptionDeclaration signalEventDefinition; if (isThrowing) { CallableElement payload = new CallableElement(); parseInputParameter(signalEventDefinitionElement, payload); signalEventDefinition = new EventSubscriptionDeclaration(signalDefinition.getExpression(), EventType.SIGNAL, payload); } else { signalEventDefinition = new EventSubscriptionDeclaration(signalDefinition.getExpression(), EventType.SIGNAL); } boolean throwingAsync = TRUE.equals(signalEventDefinitionElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "async", "false")); signalEventDefinition.setAsync(throwingAsync); return signalEventDefinition; } }
[ "protected", "EventSubscriptionDeclaration", "parseSignalEventDefinition", "(", "Element", "signalEventDefinitionElement", ",", "boolean", "isThrowing", ")", "{", "String", "signalRef", "=", "signalEventDefinitionElement", ".", "attribute", "(", "\"signalRef\"", ")", ";", "if", "(", "signalRef", "==", "null", ")", "{", "addError", "(", "\"signalEventDefinition does not have required property 'signalRef'\"", ",", "signalEventDefinitionElement", ")", ";", "return", "null", ";", "}", "else", "{", "SignalDefinition", "signalDefinition", "=", "signals", ".", "get", "(", "resolveName", "(", "signalRef", ")", ")", ";", "if", "(", "signalDefinition", "==", "null", ")", "{", "addError", "(", "\"Could not find signal with id '\"", "+", "signalRef", "+", "\"'\"", ",", "signalEventDefinitionElement", ")", ";", "}", "EventSubscriptionDeclaration", "signalEventDefinition", ";", "if", "(", "isThrowing", ")", "{", "CallableElement", "payload", "=", "new", "CallableElement", "(", ")", ";", "parseInputParameter", "(", "signalEventDefinitionElement", ",", "payload", ")", ";", "signalEventDefinition", "=", "new", "EventSubscriptionDeclaration", "(", "signalDefinition", ".", "getExpression", "(", ")", ",", "EventType", ".", "SIGNAL", ",", "payload", ")", ";", "}", "else", "{", "signalEventDefinition", "=", "new", "EventSubscriptionDeclaration", "(", "signalDefinition", ".", "getExpression", "(", ")", ",", "EventType", ".", "SIGNAL", ")", ";", "}", "boolean", "throwingAsync", "=", "TRUE", ".", "equals", "(", "signalEventDefinitionElement", ".", "attributeNS", "(", "CAMUNDA_BPMN_EXTENSIONS_NS", ",", "\"async\"", ",", "\"false\"", ")", ")", ";", "signalEventDefinition", ".", "setAsync", "(", "throwingAsync", ")", ";", "return", "signalEventDefinition", ";", "}", "}" ]
Parses the Signal Event Definition XML including payload definition. @param signalEventDefinitionElement the Signal Event Definition element @param isThrowing true if a Throwing signal event is being parsed @return
[ "Parses", "the", "Signal", "Event", "Definition", "XML", "including", "payload", "definition", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L3232-L3257
16,465
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.findEscalationForEscalationEventDefinition
protected Escalation findEscalationForEscalationEventDefinition(Element escalationEventDefinition) { String escalationRef = escalationEventDefinition.attribute("escalationRef"); if (escalationRef == null) { addError("escalationEventDefinition does not have required attribute 'escalationRef'", escalationEventDefinition); } else if (!escalations.containsKey(escalationRef)) { addError("could not find escalation with id '" + escalationRef + "'", escalationEventDefinition); } else { return escalations.get(escalationRef); } return null; }
java
protected Escalation findEscalationForEscalationEventDefinition(Element escalationEventDefinition) { String escalationRef = escalationEventDefinition.attribute("escalationRef"); if (escalationRef == null) { addError("escalationEventDefinition does not have required attribute 'escalationRef'", escalationEventDefinition); } else if (!escalations.containsKey(escalationRef)) { addError("could not find escalation with id '" + escalationRef + "'", escalationEventDefinition); } else { return escalations.get(escalationRef); } return null; }
[ "protected", "Escalation", "findEscalationForEscalationEventDefinition", "(", "Element", "escalationEventDefinition", ")", "{", "String", "escalationRef", "=", "escalationEventDefinition", ".", "attribute", "(", "\"escalationRef\"", ")", ";", "if", "(", "escalationRef", "==", "null", ")", "{", "addError", "(", "\"escalationEventDefinition does not have required attribute 'escalationRef'\"", ",", "escalationEventDefinition", ")", ";", "}", "else", "if", "(", "!", "escalations", ".", "containsKey", "(", "escalationRef", ")", ")", "{", "addError", "(", "\"could not find escalation with id '\"", "+", "escalationRef", "+", "\"'\"", ",", "escalationEventDefinition", ")", ";", "}", "else", "{", "return", "escalations", ".", "get", "(", "escalationRef", ")", ";", "}", "return", "null", ";", "}" ]
Find the referenced escalation of the given escalation event definition. Add errors if the referenced escalation not found. @return referenced escalation or <code>null</code>, if referenced escalation not found
[ "Find", "the", "referenced", "escalation", "of", "the", "given", "escalation", "event", "definition", ".", "Add", "errors", "if", "the", "referenced", "escalation", "not", "found", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L3365-L3375
16,466
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseBoundaryConditionalEventDefinition
public BoundaryConditionalEventActivityBehavior parseBoundaryConditionalEventDefinition(Element element, boolean interrupting, ActivityImpl conditionalActivity) { conditionalActivity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.BOUNDARY_CONDITIONAL); ConditionalEventDefinition conditionalEventDefinition = parseConditionalEventDefinition(element, conditionalActivity); conditionalEventDefinition.setInterrupting(interrupting); addEventSubscriptionDeclaration(conditionalEventDefinition, conditionalActivity.getEventScope(), element); for (BpmnParseListener parseListener : parseListeners) { parseListener.parseBoundaryConditionalEventDefinition(element, interrupting, conditionalActivity); } return new BoundaryConditionalEventActivityBehavior(conditionalEventDefinition); }
java
public BoundaryConditionalEventActivityBehavior parseBoundaryConditionalEventDefinition(Element element, boolean interrupting, ActivityImpl conditionalActivity) { conditionalActivity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.BOUNDARY_CONDITIONAL); ConditionalEventDefinition conditionalEventDefinition = parseConditionalEventDefinition(element, conditionalActivity); conditionalEventDefinition.setInterrupting(interrupting); addEventSubscriptionDeclaration(conditionalEventDefinition, conditionalActivity.getEventScope(), element); for (BpmnParseListener parseListener : parseListeners) { parseListener.parseBoundaryConditionalEventDefinition(element, interrupting, conditionalActivity); } return new BoundaryConditionalEventActivityBehavior(conditionalEventDefinition); }
[ "public", "BoundaryConditionalEventActivityBehavior", "parseBoundaryConditionalEventDefinition", "(", "Element", "element", ",", "boolean", "interrupting", ",", "ActivityImpl", "conditionalActivity", ")", "{", "conditionalActivity", ".", "getProperties", "(", ")", ".", "set", "(", "BpmnProperties", ".", "TYPE", ",", "ActivityTypes", ".", "BOUNDARY_CONDITIONAL", ")", ";", "ConditionalEventDefinition", "conditionalEventDefinition", "=", "parseConditionalEventDefinition", "(", "element", ",", "conditionalActivity", ")", ";", "conditionalEventDefinition", ".", "setInterrupting", "(", "interrupting", ")", ";", "addEventSubscriptionDeclaration", "(", "conditionalEventDefinition", ",", "conditionalActivity", ".", "getEventScope", "(", ")", ",", "element", ")", ";", "for", "(", "BpmnParseListener", "parseListener", ":", "parseListeners", ")", "{", "parseListener", ".", "parseBoundaryConditionalEventDefinition", "(", "element", ",", "interrupting", ",", "conditionalActivity", ")", ";", "}", "return", "new", "BoundaryConditionalEventActivityBehavior", "(", "conditionalEventDefinition", ")", ";", "}" ]
Parses the given element as conditional boundary event. @param element the XML element which contains the conditional event information @param interrupting indicates if the event is interrupting or not @param conditionalActivity the conditional event activity @return the boundary conditional event behavior which contains the condition
[ "Parses", "the", "given", "element", "as", "conditional", "boundary", "event", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L3456-L3468
16,467
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseIntermediateConditionalEventDefinition
public ConditionalEventDefinition parseIntermediateConditionalEventDefinition(Element element, ActivityImpl conditionalActivity) { conditionalActivity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.INTERMEDIATE_EVENT_CONDITIONAL); ConditionalEventDefinition conditionalEventDefinition = parseConditionalEventDefinition(element, conditionalActivity); addEventSubscriptionDeclaration(conditionalEventDefinition, conditionalActivity.getEventScope(), element); for (BpmnParseListener parseListener : parseListeners) { parseListener.parseIntermediateConditionalEventDefinition(element, conditionalActivity); } return conditionalEventDefinition; }
java
public ConditionalEventDefinition parseIntermediateConditionalEventDefinition(Element element, ActivityImpl conditionalActivity) { conditionalActivity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.INTERMEDIATE_EVENT_CONDITIONAL); ConditionalEventDefinition conditionalEventDefinition = parseConditionalEventDefinition(element, conditionalActivity); addEventSubscriptionDeclaration(conditionalEventDefinition, conditionalActivity.getEventScope(), element); for (BpmnParseListener parseListener : parseListeners) { parseListener.parseIntermediateConditionalEventDefinition(element, conditionalActivity); } return conditionalEventDefinition; }
[ "public", "ConditionalEventDefinition", "parseIntermediateConditionalEventDefinition", "(", "Element", "element", ",", "ActivityImpl", "conditionalActivity", ")", "{", "conditionalActivity", ".", "getProperties", "(", ")", ".", "set", "(", "BpmnProperties", ".", "TYPE", ",", "ActivityTypes", ".", "INTERMEDIATE_EVENT_CONDITIONAL", ")", ";", "ConditionalEventDefinition", "conditionalEventDefinition", "=", "parseConditionalEventDefinition", "(", "element", ",", "conditionalActivity", ")", ";", "addEventSubscriptionDeclaration", "(", "conditionalEventDefinition", ",", "conditionalActivity", ".", "getEventScope", "(", ")", ",", "element", ")", ";", "for", "(", "BpmnParseListener", "parseListener", ":", "parseListeners", ")", "{", "parseListener", ".", "parseIntermediateConditionalEventDefinition", "(", "element", ",", "conditionalActivity", ")", ";", "}", "return", "conditionalEventDefinition", ";", "}" ]
Parses the given element as intermediate conditional event. @param element the XML element which contains the conditional event information @param conditionalActivity the conditional event activity @return returns the conditional activity with the parsed information
[ "Parses", "the", "given", "element", "as", "intermediate", "conditional", "event", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L3477-L3488
16,468
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseConditionalStartEventForEventSubprocess
public ConditionalEventDefinition parseConditionalStartEventForEventSubprocess(Element element, ActivityImpl conditionalActivity, boolean interrupting) { conditionalActivity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.START_EVENT_CONDITIONAL); ConditionalEventDefinition conditionalEventDefinition = parseConditionalEventDefinition(element, conditionalActivity); conditionalEventDefinition.setInterrupting(interrupting); addEventSubscriptionDeclaration(conditionalEventDefinition, conditionalActivity.getEventScope(), element); for (BpmnParseListener parseListener : parseListeners) { parseListener.parseConditionalStartEventForEventSubprocess(element, conditionalActivity, interrupting); } return conditionalEventDefinition; }
java
public ConditionalEventDefinition parseConditionalStartEventForEventSubprocess(Element element, ActivityImpl conditionalActivity, boolean interrupting) { conditionalActivity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.START_EVENT_CONDITIONAL); ConditionalEventDefinition conditionalEventDefinition = parseConditionalEventDefinition(element, conditionalActivity); conditionalEventDefinition.setInterrupting(interrupting); addEventSubscriptionDeclaration(conditionalEventDefinition, conditionalActivity.getEventScope(), element); for (BpmnParseListener parseListener : parseListeners) { parseListener.parseConditionalStartEventForEventSubprocess(element, conditionalActivity, interrupting); } return conditionalEventDefinition; }
[ "public", "ConditionalEventDefinition", "parseConditionalStartEventForEventSubprocess", "(", "Element", "element", ",", "ActivityImpl", "conditionalActivity", ",", "boolean", "interrupting", ")", "{", "conditionalActivity", ".", "getProperties", "(", ")", ".", "set", "(", "BpmnProperties", ".", "TYPE", ",", "ActivityTypes", ".", "START_EVENT_CONDITIONAL", ")", ";", "ConditionalEventDefinition", "conditionalEventDefinition", "=", "parseConditionalEventDefinition", "(", "element", ",", "conditionalActivity", ")", ";", "conditionalEventDefinition", ".", "setInterrupting", "(", "interrupting", ")", ";", "addEventSubscriptionDeclaration", "(", "conditionalEventDefinition", ",", "conditionalActivity", ".", "getEventScope", "(", ")", ",", "element", ")", ";", "for", "(", "BpmnParseListener", "parseListener", ":", "parseListeners", ")", "{", "parseListener", ".", "parseConditionalStartEventForEventSubprocess", "(", "element", ",", "conditionalActivity", ",", "interrupting", ")", ";", "}", "return", "conditionalEventDefinition", ";", "}" ]
Parses the given element as conditional start event of an event subprocess. @param element the XML element which contains the conditional event information @param interrupting indicates if the event is interrupting or not @param conditionalActivity the conditional event activity @return
[ "Parses", "the", "given", "element", "as", "conditional", "start", "event", "of", "an", "event", "subprocess", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L3498-L3510
16,469
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseConditionalEventDefinition
protected ConditionalEventDefinition parseConditionalEventDefinition(Element element, ActivityImpl conditionalActivity) { ConditionalEventDefinition conditionalEventDefinition = null; Element conditionExprElement = element.element(CONDITION); if (conditionExprElement != null) { Condition condition = parseConditionExpression(conditionExprElement); conditionalEventDefinition = new ConditionalEventDefinition(condition, conditionalActivity); String expression = conditionExprElement.getText().trim(); conditionalEventDefinition.setConditionAsString(expression); conditionalActivity.getProcessDefinition().getProperties().set(BpmnProperties.HAS_CONDITIONAL_EVENTS, true); final String variableName = element.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "variableName"); conditionalEventDefinition.setVariableName(variableName); final String variableEvents = element.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "variableEvents"); final List<String> variableEventsList = parseCommaSeparatedList(variableEvents); conditionalEventDefinition.setVariableEvents(new HashSet<String>(variableEventsList)); for (String variableEvent : variableEventsList) { if (!VARIABLE_EVENTS.contains(variableEvent)) { addWarning("Variable event: " + variableEvent + " is not valid. Possible variable change events are: " + Arrays.toString(VARIABLE_EVENTS.toArray()), element); } } } else { addError("Conditional event must contain an expression for evaluation.", element); } return conditionalEventDefinition; }
java
protected ConditionalEventDefinition parseConditionalEventDefinition(Element element, ActivityImpl conditionalActivity) { ConditionalEventDefinition conditionalEventDefinition = null; Element conditionExprElement = element.element(CONDITION); if (conditionExprElement != null) { Condition condition = parseConditionExpression(conditionExprElement); conditionalEventDefinition = new ConditionalEventDefinition(condition, conditionalActivity); String expression = conditionExprElement.getText().trim(); conditionalEventDefinition.setConditionAsString(expression); conditionalActivity.getProcessDefinition().getProperties().set(BpmnProperties.HAS_CONDITIONAL_EVENTS, true); final String variableName = element.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "variableName"); conditionalEventDefinition.setVariableName(variableName); final String variableEvents = element.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "variableEvents"); final List<String> variableEventsList = parseCommaSeparatedList(variableEvents); conditionalEventDefinition.setVariableEvents(new HashSet<String>(variableEventsList)); for (String variableEvent : variableEventsList) { if (!VARIABLE_EVENTS.contains(variableEvent)) { addWarning("Variable event: " + variableEvent + " is not valid. Possible variable change events are: " + Arrays.toString(VARIABLE_EVENTS.toArray()), element); } } } else { addError("Conditional event must contain an expression for evaluation.", element); } return conditionalEventDefinition; }
[ "protected", "ConditionalEventDefinition", "parseConditionalEventDefinition", "(", "Element", "element", ",", "ActivityImpl", "conditionalActivity", ")", "{", "ConditionalEventDefinition", "conditionalEventDefinition", "=", "null", ";", "Element", "conditionExprElement", "=", "element", ".", "element", "(", "CONDITION", ")", ";", "if", "(", "conditionExprElement", "!=", "null", ")", "{", "Condition", "condition", "=", "parseConditionExpression", "(", "conditionExprElement", ")", ";", "conditionalEventDefinition", "=", "new", "ConditionalEventDefinition", "(", "condition", ",", "conditionalActivity", ")", ";", "String", "expression", "=", "conditionExprElement", ".", "getText", "(", ")", ".", "trim", "(", ")", ";", "conditionalEventDefinition", ".", "setConditionAsString", "(", "expression", ")", ";", "conditionalActivity", ".", "getProcessDefinition", "(", ")", ".", "getProperties", "(", ")", ".", "set", "(", "BpmnProperties", ".", "HAS_CONDITIONAL_EVENTS", ",", "true", ")", ";", "final", "String", "variableName", "=", "element", ".", "attributeNS", "(", "CAMUNDA_BPMN_EXTENSIONS_NS", ",", "\"variableName\"", ")", ";", "conditionalEventDefinition", ".", "setVariableName", "(", "variableName", ")", ";", "final", "String", "variableEvents", "=", "element", ".", "attributeNS", "(", "CAMUNDA_BPMN_EXTENSIONS_NS", ",", "\"variableEvents\"", ")", ";", "final", "List", "<", "String", ">", "variableEventsList", "=", "parseCommaSeparatedList", "(", "variableEvents", ")", ";", "conditionalEventDefinition", ".", "setVariableEvents", "(", "new", "HashSet", "<", "String", ">", "(", "variableEventsList", ")", ")", ";", "for", "(", "String", "variableEvent", ":", "variableEventsList", ")", "{", "if", "(", "!", "VARIABLE_EVENTS", ".", "contains", "(", "variableEvent", ")", ")", "{", "addWarning", "(", "\"Variable event: \"", "+", "variableEvent", "+", "\" is not valid. Possible variable change events are: \"", "+", "Arrays", ".", "toString", "(", "VARIABLE_EVENTS", ".", "toArray", "(", ")", ")", ",", "element", ")", ";", "}", "}", "}", "else", "{", "addError", "(", "\"Conditional event must contain an expression for evaluation.\"", ",", "element", ")", ";", "}", "return", "conditionalEventDefinition", ";", "}" ]
Parses the given element and returns an ConditionalEventDefinition object. @param element the XML element which contains the conditional event information @param conditionalActivity the conditional event activity @return the conditional event definition which was parsed
[ "Parses", "the", "given", "element", "and", "returns", "an", "ConditionalEventDefinition", "object", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L3519-L3550
16,470
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseProperty
public void parseProperty(Element propertyElement, ActivityImpl activity) { String id = propertyElement.attribute("id"); String name = propertyElement.attribute("name"); // If name isn't given, use the id as name if (name == null) { if (id == null) { addError("Invalid property usage on line " + propertyElement.getLine() + ": no id or name specified.", propertyElement); } else { name = id; } } String type = null; parsePropertyCustomExtensions(activity, propertyElement, name, type); }
java
public void parseProperty(Element propertyElement, ActivityImpl activity) { String id = propertyElement.attribute("id"); String name = propertyElement.attribute("name"); // If name isn't given, use the id as name if (name == null) { if (id == null) { addError("Invalid property usage on line " + propertyElement.getLine() + ": no id or name specified.", propertyElement); } else { name = id; } } String type = null; parsePropertyCustomExtensions(activity, propertyElement, name, type); }
[ "public", "void", "parseProperty", "(", "Element", "propertyElement", ",", "ActivityImpl", "activity", ")", "{", "String", "id", "=", "propertyElement", ".", "attribute", "(", "\"id\"", ")", ";", "String", "name", "=", "propertyElement", ".", "attribute", "(", "\"name\"", ")", ";", "// If name isn't given, use the id as name", "if", "(", "name", "==", "null", ")", "{", "if", "(", "id", "==", "null", ")", "{", "addError", "(", "\"Invalid property usage on line \"", "+", "propertyElement", ".", "getLine", "(", ")", "+", "\": no id or name specified.\"", ",", "propertyElement", ")", ";", "}", "else", "{", "name", "=", "id", ";", "}", "}", "String", "type", "=", "null", ";", "parsePropertyCustomExtensions", "(", "activity", ",", "propertyElement", ",", "name", ",", "type", ")", ";", "}" ]
Parses one property definition. @param propertyElement The 'property' element that defines how a property looks like and is handled.
[ "Parses", "one", "property", "definition", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L3895-L3910
16,471
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parsePropertyCustomExtensions
public void parsePropertyCustomExtensions(ActivityImpl activity, Element propertyElement, String propertyName, String propertyType) { if (propertyType == null) { String type = propertyElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, TYPE); propertyType = type != null ? type : "string"; // default is string } VariableDeclaration variableDeclaration = new VariableDeclaration(propertyName, propertyType); addVariableDeclaration(activity, variableDeclaration); activity.setScope(true); String src = propertyElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "src"); if (src != null) { variableDeclaration.setSourceVariableName(src); } String srcExpr = propertyElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "srcExpr"); if (srcExpr != null) { Expression sourceExpression = expressionManager.createExpression(srcExpr); variableDeclaration.setSourceExpression(sourceExpression); } String dst = propertyElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "dst"); if (dst != null) { variableDeclaration.setDestinationVariableName(dst); } String destExpr = propertyElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "dstExpr"); if (destExpr != null) { Expression destinationExpression = expressionManager.createExpression(destExpr); variableDeclaration.setDestinationExpression(destinationExpression); } String link = propertyElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "link"); if (link != null) { variableDeclaration.setLink(link); } String linkExpr = propertyElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "linkExpr"); if (linkExpr != null) { Expression linkExpression = expressionManager.createExpression(linkExpr); variableDeclaration.setLinkExpression(linkExpression); } for (BpmnParseListener parseListener : parseListeners) { parseListener.parseProperty(propertyElement, variableDeclaration, activity); } }
java
public void parsePropertyCustomExtensions(ActivityImpl activity, Element propertyElement, String propertyName, String propertyType) { if (propertyType == null) { String type = propertyElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, TYPE); propertyType = type != null ? type : "string"; // default is string } VariableDeclaration variableDeclaration = new VariableDeclaration(propertyName, propertyType); addVariableDeclaration(activity, variableDeclaration); activity.setScope(true); String src = propertyElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "src"); if (src != null) { variableDeclaration.setSourceVariableName(src); } String srcExpr = propertyElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "srcExpr"); if (srcExpr != null) { Expression sourceExpression = expressionManager.createExpression(srcExpr); variableDeclaration.setSourceExpression(sourceExpression); } String dst = propertyElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "dst"); if (dst != null) { variableDeclaration.setDestinationVariableName(dst); } String destExpr = propertyElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "dstExpr"); if (destExpr != null) { Expression destinationExpression = expressionManager.createExpression(destExpr); variableDeclaration.setDestinationExpression(destinationExpression); } String link = propertyElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "link"); if (link != null) { variableDeclaration.setLink(link); } String linkExpr = propertyElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "linkExpr"); if (linkExpr != null) { Expression linkExpression = expressionManager.createExpression(linkExpr); variableDeclaration.setLinkExpression(linkExpression); } for (BpmnParseListener parseListener : parseListeners) { parseListener.parseProperty(propertyElement, variableDeclaration, activity); } }
[ "public", "void", "parsePropertyCustomExtensions", "(", "ActivityImpl", "activity", ",", "Element", "propertyElement", ",", "String", "propertyName", ",", "String", "propertyType", ")", "{", "if", "(", "propertyType", "==", "null", ")", "{", "String", "type", "=", "propertyElement", ".", "attributeNS", "(", "CAMUNDA_BPMN_EXTENSIONS_NS", ",", "TYPE", ")", ";", "propertyType", "=", "type", "!=", "null", "?", "type", ":", "\"string\"", ";", "// default is string", "}", "VariableDeclaration", "variableDeclaration", "=", "new", "VariableDeclaration", "(", "propertyName", ",", "propertyType", ")", ";", "addVariableDeclaration", "(", "activity", ",", "variableDeclaration", ")", ";", "activity", ".", "setScope", "(", "true", ")", ";", "String", "src", "=", "propertyElement", ".", "attributeNS", "(", "CAMUNDA_BPMN_EXTENSIONS_NS", ",", "\"src\"", ")", ";", "if", "(", "src", "!=", "null", ")", "{", "variableDeclaration", ".", "setSourceVariableName", "(", "src", ")", ";", "}", "String", "srcExpr", "=", "propertyElement", ".", "attributeNS", "(", "CAMUNDA_BPMN_EXTENSIONS_NS", ",", "\"srcExpr\"", ")", ";", "if", "(", "srcExpr", "!=", "null", ")", "{", "Expression", "sourceExpression", "=", "expressionManager", ".", "createExpression", "(", "srcExpr", ")", ";", "variableDeclaration", ".", "setSourceExpression", "(", "sourceExpression", ")", ";", "}", "String", "dst", "=", "propertyElement", ".", "attributeNS", "(", "CAMUNDA_BPMN_EXTENSIONS_NS", ",", "\"dst\"", ")", ";", "if", "(", "dst", "!=", "null", ")", "{", "variableDeclaration", ".", "setDestinationVariableName", "(", "dst", ")", ";", "}", "String", "destExpr", "=", "propertyElement", ".", "attributeNS", "(", "CAMUNDA_BPMN_EXTENSIONS_NS", ",", "\"dstExpr\"", ")", ";", "if", "(", "destExpr", "!=", "null", ")", "{", "Expression", "destinationExpression", "=", "expressionManager", ".", "createExpression", "(", "destExpr", ")", ";", "variableDeclaration", ".", "setDestinationExpression", "(", "destinationExpression", ")", ";", "}", "String", "link", "=", "propertyElement", ".", "attributeNS", "(", "CAMUNDA_BPMN_EXTENSIONS_NS", ",", "\"link\"", ")", ";", "if", "(", "link", "!=", "null", ")", "{", "variableDeclaration", ".", "setLink", "(", "link", ")", ";", "}", "String", "linkExpr", "=", "propertyElement", ".", "attributeNS", "(", "CAMUNDA_BPMN_EXTENSIONS_NS", ",", "\"linkExpr\"", ")", ";", "if", "(", "linkExpr", "!=", "null", ")", "{", "Expression", "linkExpression", "=", "expressionManager", ".", "createExpression", "(", "linkExpr", ")", ";", "variableDeclaration", ".", "setLinkExpression", "(", "linkExpression", ")", ";", "}", "for", "(", "BpmnParseListener", "parseListener", ":", "parseListeners", ")", "{", "parseListener", ".", "parseProperty", "(", "propertyElement", ",", "variableDeclaration", ",", "activity", ")", ";", "}", "}" ]
Parses the custom extensions for properties. @param activity The activity where the property declaration is done. @param propertyElement The 'property' element defining the property. @param propertyName The name of the property. @param propertyType The type of the property.
[ "Parses", "the", "custom", "extensions", "for", "properties", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L3924-L3971
16,472
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseSequenceFlowConditionExpression
public void parseSequenceFlowConditionExpression(Element seqFlowElement, TransitionImpl seqFlow) { Element conditionExprElement = seqFlowElement.element(CONDITION_EXPRESSION); if (conditionExprElement != null) { Condition condition = parseConditionExpression(conditionExprElement); seqFlow.setProperty(PROPERTYNAME_CONDITION_TEXT, conditionExprElement.getText().trim()); seqFlow.setProperty(PROPERTYNAME_CONDITION, condition); } }
java
public void parseSequenceFlowConditionExpression(Element seqFlowElement, TransitionImpl seqFlow) { Element conditionExprElement = seqFlowElement.element(CONDITION_EXPRESSION); if (conditionExprElement != null) { Condition condition = parseConditionExpression(conditionExprElement); seqFlow.setProperty(PROPERTYNAME_CONDITION_TEXT, conditionExprElement.getText().trim()); seqFlow.setProperty(PROPERTYNAME_CONDITION, condition); } }
[ "public", "void", "parseSequenceFlowConditionExpression", "(", "Element", "seqFlowElement", ",", "TransitionImpl", "seqFlow", ")", "{", "Element", "conditionExprElement", "=", "seqFlowElement", ".", "element", "(", "CONDITION_EXPRESSION", ")", ";", "if", "(", "conditionExprElement", "!=", "null", ")", "{", "Condition", "condition", "=", "parseConditionExpression", "(", "conditionExprElement", ")", ";", "seqFlow", ".", "setProperty", "(", "PROPERTYNAME_CONDITION_TEXT", ",", "conditionExprElement", ".", "getText", "(", ")", ".", "trim", "(", ")", ")", ";", "seqFlow", ".", "setProperty", "(", "PROPERTYNAME_CONDITION", ",", "condition", ")", ";", "}", "}" ]
Parses a condition expression on a sequence flow. @param seqFlowElement The 'sequenceFlow' element that can contain a condition. @param seqFlow The sequenceFlow object representation to which the condition must be added.
[ "Parses", "a", "condition", "expression", "on", "a", "sequence", "flow", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L4070-L4077
16,473
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.parseExecutionListenersOnScope
public void parseExecutionListenersOnScope(Element scopeElement, ScopeImpl scope) { Element extentionsElement = scopeElement.element("extensionElements"); if (extentionsElement != null) { List<Element> listenerElements = extentionsElement.elementsNS(CAMUNDA_BPMN_EXTENSIONS_NS, "executionListener"); for (Element listenerElement : listenerElements) { String eventName = listenerElement.attribute("event"); if (isValidEventNameForScope(eventName, listenerElement)) { ExecutionListener listener = parseExecutionListener(listenerElement); if (listener != null) { scope.addExecutionListener(eventName, listener); } } } } }
java
public void parseExecutionListenersOnScope(Element scopeElement, ScopeImpl scope) { Element extentionsElement = scopeElement.element("extensionElements"); if (extentionsElement != null) { List<Element> listenerElements = extentionsElement.elementsNS(CAMUNDA_BPMN_EXTENSIONS_NS, "executionListener"); for (Element listenerElement : listenerElements) { String eventName = listenerElement.attribute("event"); if (isValidEventNameForScope(eventName, listenerElement)) { ExecutionListener listener = parseExecutionListener(listenerElement); if (listener != null) { scope.addExecutionListener(eventName, listener); } } } } }
[ "public", "void", "parseExecutionListenersOnScope", "(", "Element", "scopeElement", ",", "ScopeImpl", "scope", ")", "{", "Element", "extentionsElement", "=", "scopeElement", ".", "element", "(", "\"extensionElements\"", ")", ";", "if", "(", "extentionsElement", "!=", "null", ")", "{", "List", "<", "Element", ">", "listenerElements", "=", "extentionsElement", ".", "elementsNS", "(", "CAMUNDA_BPMN_EXTENSIONS_NS", ",", "\"executionListener\"", ")", ";", "for", "(", "Element", "listenerElement", ":", "listenerElements", ")", "{", "String", "eventName", "=", "listenerElement", ".", "attribute", "(", "\"event\"", ")", ";", "if", "(", "isValidEventNameForScope", "(", "eventName", ",", "listenerElement", ")", ")", "{", "ExecutionListener", "listener", "=", "parseExecutionListener", "(", "listenerElement", ")", ";", "if", "(", "listener", "!=", "null", ")", "{", "scope", ".", "addExecutionListener", "(", "eventName", ",", "listener", ")", ";", "}", "}", "}", "}", "}" ]
Parses all execution-listeners on a scope. @param scopeElement the XML element containing the scope definition. @param scope the scope to add the executionListeners to.
[ "Parses", "all", "execution", "-", "listeners", "on", "a", "scope", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L4112-L4126
16,474
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java
BpmnParse.isValidEventNameForScope
protected boolean isValidEventNameForScope(String eventName, Element listenerElement) { if (eventName != null && eventName.trim().length() > 0) { if ("start".equals(eventName) || "end".equals(eventName)) { return true; } else { addError("Attribute 'event' must be one of {start|end}", listenerElement); } } else { addError("Attribute 'event' is mandatory on listener", listenerElement); } return false; }
java
protected boolean isValidEventNameForScope(String eventName, Element listenerElement) { if (eventName != null && eventName.trim().length() > 0) { if ("start".equals(eventName) || "end".equals(eventName)) { return true; } else { addError("Attribute 'event' must be one of {start|end}", listenerElement); } } else { addError("Attribute 'event' is mandatory on listener", listenerElement); } return false; }
[ "protected", "boolean", "isValidEventNameForScope", "(", "String", "eventName", ",", "Element", "listenerElement", ")", "{", "if", "(", "eventName", "!=", "null", "&&", "eventName", ".", "trim", "(", ")", ".", "length", "(", ")", ">", "0", ")", "{", "if", "(", "\"start\"", ".", "equals", "(", "eventName", ")", "||", "\"end\"", ".", "equals", "(", "eventName", ")", ")", "{", "return", "true", ";", "}", "else", "{", "addError", "(", "\"Attribute 'event' must be one of {start|end}\"", ",", "listenerElement", ")", ";", "}", "}", "else", "{", "addError", "(", "\"Attribute 'event' is mandatory on listener\"", ",", "listenerElement", ")", ";", "}", "return", "false", ";", "}" ]
Check if the given event name is valid. If not, an appropriate error is added.
[ "Check", "if", "the", "given", "event", "name", "is", "valid", ".", "If", "not", "an", "appropriate", "error", "is", "added", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/parser/BpmnParse.java#L4132-L4143
16,475
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/scripting/env/ScriptingEnvironment.java
ScriptingEnvironment.execute
public Object execute(ExecutableScript script, VariableScope scope) { // get script engine ScriptEngine scriptEngine = scriptingEngines.getScriptEngineForLanguage(script.getLanguage()); // create bindings Bindings bindings = scriptingEngines.createBindings(scriptEngine, scope); return execute(script, scope, bindings, scriptEngine); }
java
public Object execute(ExecutableScript script, VariableScope scope) { // get script engine ScriptEngine scriptEngine = scriptingEngines.getScriptEngineForLanguage(script.getLanguage()); // create bindings Bindings bindings = scriptingEngines.createBindings(scriptEngine, scope); return execute(script, scope, bindings, scriptEngine); }
[ "public", "Object", "execute", "(", "ExecutableScript", "script", ",", "VariableScope", "scope", ")", "{", "// get script engine", "ScriptEngine", "scriptEngine", "=", "scriptingEngines", ".", "getScriptEngineForLanguage", "(", "script", ".", "getLanguage", "(", ")", ")", ";", "// create bindings", "Bindings", "bindings", "=", "scriptingEngines", ".", "createBindings", "(", "scriptEngine", ",", "scope", ")", ";", "return", "execute", "(", "script", ",", "scope", ",", "bindings", ",", "scriptEngine", ")", ";", "}" ]
execute a given script in the environment @param script the {@link ExecutableScript} to execute @param scope the scope in which to execute the script @return the result of the script evaluation
[ "execute", "a", "given", "script", "in", "the", "environment" ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/scripting/env/ScriptingEnvironment.java#L79-L88
16,476
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/scripting/env/ScriptingEnvironment.java
ScriptingEnvironment.getEnvScripts
protected List<ExecutableScript> getEnvScripts(String scriptLanguage) { Map<String, List<ExecutableScript>> environment = getEnv(scriptLanguage); List<ExecutableScript> envScripts = environment.get(scriptLanguage); if(envScripts == null) { synchronized (this) { envScripts = environment.get(scriptLanguage); if(envScripts == null) { envScripts = initEnvForLanguage(scriptLanguage); environment.put(scriptLanguage, envScripts); } } } return envScripts; }
java
protected List<ExecutableScript> getEnvScripts(String scriptLanguage) { Map<String, List<ExecutableScript>> environment = getEnv(scriptLanguage); List<ExecutableScript> envScripts = environment.get(scriptLanguage); if(envScripts == null) { synchronized (this) { envScripts = environment.get(scriptLanguage); if(envScripts == null) { envScripts = initEnvForLanguage(scriptLanguage); environment.put(scriptLanguage, envScripts); } } } return envScripts; }
[ "protected", "List", "<", "ExecutableScript", ">", "getEnvScripts", "(", "String", "scriptLanguage", ")", "{", "Map", "<", "String", ",", "List", "<", "ExecutableScript", ">", ">", "environment", "=", "getEnv", "(", "scriptLanguage", ")", ";", "List", "<", "ExecutableScript", ">", "envScripts", "=", "environment", ".", "get", "(", "scriptLanguage", ")", ";", "if", "(", "envScripts", "==", "null", ")", "{", "synchronized", "(", "this", ")", "{", "envScripts", "=", "environment", ".", "get", "(", "scriptLanguage", ")", ";", "if", "(", "envScripts", "==", "null", ")", "{", "envScripts", "=", "initEnvForLanguage", "(", "scriptLanguage", ")", ";", "environment", ".", "put", "(", "scriptLanguage", ",", "envScripts", ")", ";", "}", "}", "}", "return", "envScripts", ";", "}" ]
Returns the env scripts for the given language. Performs lazy initialization of the env scripts. @param scriptLanguage the language @return a list of executable environment scripts. Never null.
[ "Returns", "the", "env", "scripts", "for", "the", "given", "language", ".", "Performs", "lazy", "initialization", "of", "the", "env", "scripts", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/scripting/env/ScriptingEnvironment.java#L140-L153
16,477
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/scripting/env/ScriptingEnvironment.java
ScriptingEnvironment.initEnvForLanguage
protected List<ExecutableScript> initEnvForLanguage(String language) { List<ExecutableScript> scripts = new ArrayList<ExecutableScript>(); for (ScriptEnvResolver resolver : envResolvers) { String[] resolvedScripts = resolver.resolve(language); if(resolvedScripts != null) { for (String resolvedScript : resolvedScripts) { scripts.add(scriptFactory.createScriptFromSource(language, resolvedScript)); } } } return scripts; }
java
protected List<ExecutableScript> initEnvForLanguage(String language) { List<ExecutableScript> scripts = new ArrayList<ExecutableScript>(); for (ScriptEnvResolver resolver : envResolvers) { String[] resolvedScripts = resolver.resolve(language); if(resolvedScripts != null) { for (String resolvedScript : resolvedScripts) { scripts.add(scriptFactory.createScriptFromSource(language, resolvedScript)); } } } return scripts; }
[ "protected", "List", "<", "ExecutableScript", ">", "initEnvForLanguage", "(", "String", "language", ")", "{", "List", "<", "ExecutableScript", ">", "scripts", "=", "new", "ArrayList", "<", "ExecutableScript", ">", "(", ")", ";", "for", "(", "ScriptEnvResolver", "resolver", ":", "envResolvers", ")", "{", "String", "[", "]", "resolvedScripts", "=", "resolver", ".", "resolve", "(", "language", ")", ";", "if", "(", "resolvedScripts", "!=", "null", ")", "{", "for", "(", "String", "resolvedScript", ":", "resolvedScripts", ")", "{", "scripts", ".", "add", "(", "scriptFactory", ".", "createScriptFromSource", "(", "language", ",", "resolvedScript", ")", ")", ";", "}", "}", "}", "return", "scripts", ";", "}" ]
Initializes the env scripts for a given language. @param language the language @return the list of env scripts. Never null.
[ "Initializes", "the", "env", "scripts", "for", "a", "given", "language", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/scripting/env/ScriptingEnvironment.java#L161-L174
16,478
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/container/impl/jmx/MBeanServiceContainer.java
MBeanServiceContainer.getService
@SuppressWarnings("unchecked") public <S> S getService(ObjectName name) { return (S) servicesByName.get(name); }
java
@SuppressWarnings("unchecked") public <S> S getService(ObjectName name) { return (S) servicesByName.get(name); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "S", ">", "S", "getService", "(", "ObjectName", "name", ")", "{", "return", "(", "S", ")", "servicesByName", ".", "get", "(", "name", ")", ";", "}" ]
get a specific service by name or null if no such Service exists.
[ "get", "a", "specific", "service", "by", "name", "or", "null", "if", "no", "such", "Service", "exists", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/container/impl/jmx/MBeanServiceContainer.java#L184-L187
16,479
camunda/camunda-bpm-platform
distro/wildfly8/subsystem/src/main/java/org/camunda/bpm/container/impl/jboss/deployment/marker/ProcessApplicationAttachments.java
ProcessApplicationAttachments.isPartOfProcessApplication
public static boolean isPartOfProcessApplication(DeploymentUnit unit) { if(isProcessApplication(unit)) { return true; } if(unit.getParent() != null && unit.getParent() != unit) { return unit.getParent().hasAttachment(PART_OF_MARKER); } return false; }
java
public static boolean isPartOfProcessApplication(DeploymentUnit unit) { if(isProcessApplication(unit)) { return true; } if(unit.getParent() != null && unit.getParent() != unit) { return unit.getParent().hasAttachment(PART_OF_MARKER); } return false; }
[ "public", "static", "boolean", "isPartOfProcessApplication", "(", "DeploymentUnit", "unit", ")", "{", "if", "(", "isProcessApplication", "(", "unit", ")", ")", "{", "return", "true", ";", "}", "if", "(", "unit", ".", "getParent", "(", ")", "!=", "null", "&&", "unit", ".", "getParent", "(", ")", "!=", "unit", ")", "{", "return", "unit", ".", "getParent", "(", ")", ".", "hasAttachment", "(", "PART_OF_MARKER", ")", ";", "}", "return", "false", ";", "}" ]
return true if the deployment unit is either itself a process application or part of a process application.
[ "return", "true", "if", "the", "deployment", "unit", "is", "either", "itself", "a", "process", "application", "or", "part", "of", "a", "process", "application", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/distro/wildfly8/subsystem/src/main/java/org/camunda/bpm/container/impl/jboss/deployment/marker/ProcessApplicationAttachments.java#L81-L89
16,480
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/javax/el/ListELResolver.java
ListELResolver.getValue
@Override public Object getValue(ELContext context, Object base, Object property) { if (context == null) { throw new NullPointerException("context is null"); } Object result = null; if (isResolvable(base)) { int index = toIndex(null, property); List<?> list = (List<?>) base; result = index < 0 || index >= list.size() ? null : list.get(index); context.setPropertyResolved(true); } return result; }
java
@Override public Object getValue(ELContext context, Object base, Object property) { if (context == null) { throw new NullPointerException("context is null"); } Object result = null; if (isResolvable(base)) { int index = toIndex(null, property); List<?> list = (List<?>) base; result = index < 0 || index >= list.size() ? null : list.get(index); context.setPropertyResolved(true); } return result; }
[ "@", "Override", "public", "Object", "getValue", "(", "ELContext", "context", ",", "Object", "base", ",", "Object", "property", ")", "{", "if", "(", "context", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"context is null\"", ")", ";", "}", "Object", "result", "=", "null", ";", "if", "(", "isResolvable", "(", "base", ")", ")", "{", "int", "index", "=", "toIndex", "(", "null", ",", "property", ")", ";", "List", "<", "?", ">", "list", "=", "(", "List", "<", "?", ">", ")", "base", ";", "result", "=", "index", "<", "0", "||", "index", ">=", "list", ".", "size", "(", ")", "?", "null", ":", "list", ".", "get", "(", "index", ")", ";", "context", ".", "setPropertyResolved", "(", "true", ")", ";", "}", "return", "result", ";", "}" ]
If the base object is a list, returns the value at the given index. The index is specified by the property argument, and coerced into an integer. If the coercion could not be performed, an IllegalArgumentException is thrown. If the index is out of bounds, null is returned. If the base is a List, the propertyResolved property of the ELContext object must be set to true by this resolver, before returning. If this property is not true after this method is called, the caller should ignore the return value. @param context The context of this evaluation. @param base The list to analyze. Only bases of type List are handled by this resolver. @param property The index of the element in the list to return the acceptable type for. Will be coerced into an integer, but otherwise ignored by this resolver. @return If the propertyResolved property of ELContext was set to true, then the value at the given index or null if the index was out of bounds. Otherwise, undefined. @throws PropertyNotFoundException if the given index is out of bounds for this list. @throws IllegalArgumentException if the property could not be coerced into an integer. @throws NullPointerException if context is null @throws ELException if an exception was thrown while performing the property or variable resolution. The thrown exception must be included as the cause property of this exception, if available.
[ "If", "the", "base", "object", "is", "a", "list", "returns", "the", "value", "at", "the", "given", "index", ".", "The", "index", "is", "specified", "by", "the", "property", "argument", "and", "coerced", "into", "an", "integer", ".", "If", "the", "coercion", "could", "not", "be", "performed", "an", "IllegalArgumentException", "is", "thrown", ".", "If", "the", "index", "is", "out", "of", "bounds", "null", "is", "returned", ".", "If", "the", "base", "is", "a", "List", "the", "propertyResolved", "property", "of", "the", "ELContext", "object", "must", "be", "set", "to", "true", "by", "this", "resolver", "before", "returning", ".", "If", "this", "property", "is", "not", "true", "after", "this", "method", "is", "called", "the", "caller", "should", "ignore", "the", "return", "value", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/javax/el/ListELResolver.java#L152-L165
16,481
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/CompensationBehavior.java
CompensationBehavior.executesNonScopeCompensationHandler
public static boolean executesNonScopeCompensationHandler(PvmExecutionImpl execution) { ActivityImpl activity = execution.getActivity(); return execution.isScope() && activity != null && activity.isCompensationHandler() && !activity.isScope(); }
java
public static boolean executesNonScopeCompensationHandler(PvmExecutionImpl execution) { ActivityImpl activity = execution.getActivity(); return execution.isScope() && activity != null && activity.isCompensationHandler() && !activity.isScope(); }
[ "public", "static", "boolean", "executesNonScopeCompensationHandler", "(", "PvmExecutionImpl", "execution", ")", "{", "ActivityImpl", "activity", "=", "execution", ".", "getActivity", "(", ")", ";", "return", "execution", ".", "isScope", "(", ")", "&&", "activity", "!=", "null", "&&", "activity", ".", "isCompensationHandler", "(", ")", "&&", "!", "activity", ".", "isScope", "(", ")", ";", "}" ]
With compensation, we have a dedicated scope execution for every handler, even if the handler is not a scope activity; this must be respected when invoking end listeners, etc.
[ "With", "compensation", "we", "have", "a", "dedicated", "scope", "execution", "for", "every", "handler", "even", "if", "the", "handler", "is", "not", "a", "scope", "activity", ";", "this", "must", "be", "respected", "when", "invoking", "end", "listeners", "etc", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/CompensationBehavior.java#L37-L41
16,482
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/CompensationBehavior.java
CompensationBehavior.executesDefaultCompensationHandler
public static boolean executesDefaultCompensationHandler(PvmExecutionImpl scopeExecution) { ActivityImpl currentActivity = scopeExecution.getActivity(); if (currentActivity != null) { return scopeExecution.isScope() && currentActivity.isScope() && !scopeExecution.getNonEventScopeExecutions().isEmpty() && !isCompensationThrowing(scopeExecution); } else { return false; } }
java
public static boolean executesDefaultCompensationHandler(PvmExecutionImpl scopeExecution) { ActivityImpl currentActivity = scopeExecution.getActivity(); if (currentActivity != null) { return scopeExecution.isScope() && currentActivity.isScope() && !scopeExecution.getNonEventScopeExecutions().isEmpty() && !isCompensationThrowing(scopeExecution); } else { return false; } }
[ "public", "static", "boolean", "executesDefaultCompensationHandler", "(", "PvmExecutionImpl", "scopeExecution", ")", "{", "ActivityImpl", "currentActivity", "=", "scopeExecution", ".", "getActivity", "(", ")", ";", "if", "(", "currentActivity", "!=", "null", ")", "{", "return", "scopeExecution", ".", "isScope", "(", ")", "&&", "currentActivity", ".", "isScope", "(", ")", "&&", "!", "scopeExecution", ".", "getNonEventScopeExecutions", "(", ")", ".", "isEmpty", "(", ")", "&&", "!", "isCompensationThrowing", "(", "scopeExecution", ")", ";", "}", "else", "{", "return", "false", ";", "}", "}" ]
Determines whether an execution is responsible for default compensation handling. This is the case if <ul> <li>the execution has an activity <li>the execution is a scope <li>the activity is a scope <li>the execution has children <li>the execution does not throw compensation </ul>
[ "Determines", "whether", "an", "execution", "is", "responsible", "for", "default", "compensation", "handling", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/pvm/runtime/CompensationBehavior.java#L67-L79
16,483
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/dmn/configuration/DmnEngineConfigurationBuilder.java
DmnEngineConfigurationBuilder.build
public DefaultDmnEngineConfiguration build() { List<DmnDecisionEvaluationListener> decisionEvaluationListeners = createCustomPostDecisionEvaluationListeners(); dmnEngineConfiguration.setCustomPostDecisionEvaluationListeners(decisionEvaluationListeners); // override the decision table handler DmnTransformer dmnTransformer = dmnEngineConfiguration.getTransformer(); dmnTransformer.getElementTransformHandlerRegistry().addHandler(Definitions.class, new DecisionRequirementsDefinitionTransformHandler()); dmnTransformer.getElementTransformHandlerRegistry().addHandler(Decision.class, new DecisionDefinitionHandler()); // do not override the script engine resolver if set if (dmnEngineConfiguration.getScriptEngineResolver() == null) { ensureNotNull("scriptEngineResolver", scriptEngineResolver); dmnEngineConfiguration.setScriptEngineResolver(scriptEngineResolver); } // do not override the el provider if set if (dmnEngineConfiguration.getElProvider() == null) { ensureNotNull("expressionManager", expressionManager); ProcessEngineElProvider elProvider = new ProcessEngineElProvider(expressionManager); dmnEngineConfiguration.setElProvider(elProvider); } return dmnEngineConfiguration; }
java
public DefaultDmnEngineConfiguration build() { List<DmnDecisionEvaluationListener> decisionEvaluationListeners = createCustomPostDecisionEvaluationListeners(); dmnEngineConfiguration.setCustomPostDecisionEvaluationListeners(decisionEvaluationListeners); // override the decision table handler DmnTransformer dmnTransformer = dmnEngineConfiguration.getTransformer(); dmnTransformer.getElementTransformHandlerRegistry().addHandler(Definitions.class, new DecisionRequirementsDefinitionTransformHandler()); dmnTransformer.getElementTransformHandlerRegistry().addHandler(Decision.class, new DecisionDefinitionHandler()); // do not override the script engine resolver if set if (dmnEngineConfiguration.getScriptEngineResolver() == null) { ensureNotNull("scriptEngineResolver", scriptEngineResolver); dmnEngineConfiguration.setScriptEngineResolver(scriptEngineResolver); } // do not override the el provider if set if (dmnEngineConfiguration.getElProvider() == null) { ensureNotNull("expressionManager", expressionManager); ProcessEngineElProvider elProvider = new ProcessEngineElProvider(expressionManager); dmnEngineConfiguration.setElProvider(elProvider); } return dmnEngineConfiguration; }
[ "public", "DefaultDmnEngineConfiguration", "build", "(", ")", "{", "List", "<", "DmnDecisionEvaluationListener", ">", "decisionEvaluationListeners", "=", "createCustomPostDecisionEvaluationListeners", "(", ")", ";", "dmnEngineConfiguration", ".", "setCustomPostDecisionEvaluationListeners", "(", "decisionEvaluationListeners", ")", ";", "// override the decision table handler", "DmnTransformer", "dmnTransformer", "=", "dmnEngineConfiguration", ".", "getTransformer", "(", ")", ";", "dmnTransformer", ".", "getElementTransformHandlerRegistry", "(", ")", ".", "addHandler", "(", "Definitions", ".", "class", ",", "new", "DecisionRequirementsDefinitionTransformHandler", "(", ")", ")", ";", "dmnTransformer", ".", "getElementTransformHandlerRegistry", "(", ")", ".", "addHandler", "(", "Decision", ".", "class", ",", "new", "DecisionDefinitionHandler", "(", ")", ")", ";", "// do not override the script engine resolver if set", "if", "(", "dmnEngineConfiguration", ".", "getScriptEngineResolver", "(", ")", "==", "null", ")", "{", "ensureNotNull", "(", "\"scriptEngineResolver\"", ",", "scriptEngineResolver", ")", ";", "dmnEngineConfiguration", ".", "setScriptEngineResolver", "(", "scriptEngineResolver", ")", ";", "}", "// do not override the el provider if set", "if", "(", "dmnEngineConfiguration", ".", "getElProvider", "(", ")", "==", "null", ")", "{", "ensureNotNull", "(", "\"expressionManager\"", ",", "expressionManager", ")", ";", "ProcessEngineElProvider", "elProvider", "=", "new", "ProcessEngineElProvider", "(", "expressionManager", ")", ";", "dmnEngineConfiguration", ".", "setElProvider", "(", "elProvider", ")", ";", "}", "return", "dmnEngineConfiguration", ";", "}" ]
Modify the given DMN engine configuration and return it.
[ "Modify", "the", "given", "DMN", "engine", "configuration", "and", "return", "it", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/dmn/configuration/DmnEngineConfigurationBuilder.java#L90-L116
16,484
camunda/camunda-bpm-platform
distro/wildfly/subsystem/src/main/java/org/camunda/bpm/container/impl/jboss/deployment/processor/ProcessesXmlProcessor.java
ProcessesXmlProcessor.deploy
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if(!ProcessApplicationAttachments.isProcessApplication(deploymentUnit)) { return; } final Module module = deploymentUnit.getAttachment(MODULE); // read @ProcessApplication annotation of PA-component String[] deploymentDescriptors = getDeploymentDescriptors(deploymentUnit); // load all processes.xml files List<URL> deploymentDescriptorURLs = getDeploymentDescriptorUrls(module, deploymentDescriptors); for (URL processesXmlResource : deploymentDescriptorURLs) { VirtualFile processesXmlFile = getFile(processesXmlResource); // parse processes.xml metadata. ProcessesXml processesXml = null; if(isEmptyFile(processesXmlResource)) { processesXml = ProcessesXml.EMPTY_PROCESSES_XML; } else { processesXml = parseProcessesXml(processesXmlResource); } // add the parsed metadata to the attachment list ProcessApplicationAttachments.addProcessesXml(deploymentUnit, new ProcessesXmlWrapper(processesXml, processesXmlFile)); } }
java
public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException { DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit(); if(!ProcessApplicationAttachments.isProcessApplication(deploymentUnit)) { return; } final Module module = deploymentUnit.getAttachment(MODULE); // read @ProcessApplication annotation of PA-component String[] deploymentDescriptors = getDeploymentDescriptors(deploymentUnit); // load all processes.xml files List<URL> deploymentDescriptorURLs = getDeploymentDescriptorUrls(module, deploymentDescriptors); for (URL processesXmlResource : deploymentDescriptorURLs) { VirtualFile processesXmlFile = getFile(processesXmlResource); // parse processes.xml metadata. ProcessesXml processesXml = null; if(isEmptyFile(processesXmlResource)) { processesXml = ProcessesXml.EMPTY_PROCESSES_XML; } else { processesXml = parseProcessesXml(processesXmlResource); } // add the parsed metadata to the attachment list ProcessApplicationAttachments.addProcessesXml(deploymentUnit, new ProcessesXmlWrapper(processesXml, processesXmlFile)); } }
[ "public", "void", "deploy", "(", "DeploymentPhaseContext", "phaseContext", ")", "throws", "DeploymentUnitProcessingException", "{", "DeploymentUnit", "deploymentUnit", "=", "phaseContext", ".", "getDeploymentUnit", "(", ")", ";", "if", "(", "!", "ProcessApplicationAttachments", ".", "isProcessApplication", "(", "deploymentUnit", ")", ")", "{", "return", ";", "}", "final", "Module", "module", "=", "deploymentUnit", ".", "getAttachment", "(", "MODULE", ")", ";", "// read @ProcessApplication annotation of PA-component", "String", "[", "]", "deploymentDescriptors", "=", "getDeploymentDescriptors", "(", "deploymentUnit", ")", ";", "// load all processes.xml files", "List", "<", "URL", ">", "deploymentDescriptorURLs", "=", "getDeploymentDescriptorUrls", "(", "module", ",", "deploymentDescriptors", ")", ";", "for", "(", "URL", "processesXmlResource", ":", "deploymentDescriptorURLs", ")", "{", "VirtualFile", "processesXmlFile", "=", "getFile", "(", "processesXmlResource", ")", ";", "// parse processes.xml metadata.", "ProcessesXml", "processesXml", "=", "null", ";", "if", "(", "isEmptyFile", "(", "processesXmlResource", ")", ")", "{", "processesXml", "=", "ProcessesXml", ".", "EMPTY_PROCESSES_XML", ";", "}", "else", "{", "processesXml", "=", "parseProcessesXml", "(", "processesXmlResource", ")", ";", "}", "// add the parsed metadata to the attachment list", "ProcessApplicationAttachments", ".", "addProcessesXml", "(", "deploymentUnit", ",", "new", "ProcessesXmlWrapper", "(", "processesXml", ",", "processesXmlFile", ")", ")", ";", "}", "}" ]
this can happen ASAP in the POST_MODULE Phase
[ "this", "can", "happen", "ASAP", "in", "the", "POST_MODULE", "Phase" ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/distro/wildfly/subsystem/src/main/java/org/camunda/bpm/container/impl/jboss/deployment/processor/ProcessesXmlProcessor.java#L61-L91
16,485
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/scripting/engine/ScriptEngineResolver.java
ScriptEngineResolver.getScriptEngine
public ScriptEngine getScriptEngine(String language, boolean resolveFromCache) { ScriptEngine scriptEngine = null; if (resolveFromCache) { scriptEngine = cachedEngines.get(language); if(scriptEngine == null) { scriptEngine = scriptEngineManager.getEngineByName(language); if(scriptEngine != null) { if(ScriptingEngines.GROOVY_SCRIPTING_LANGUAGE.equals(language)) { configureGroovyScriptEngine(scriptEngine); } if(isCachable(scriptEngine)) { cachedEngines.put(language, scriptEngine); } } } } else { scriptEngine = scriptEngineManager.getEngineByName(language); } return scriptEngine; }
java
public ScriptEngine getScriptEngine(String language, boolean resolveFromCache) { ScriptEngine scriptEngine = null; if (resolveFromCache) { scriptEngine = cachedEngines.get(language); if(scriptEngine == null) { scriptEngine = scriptEngineManager.getEngineByName(language); if(scriptEngine != null) { if(ScriptingEngines.GROOVY_SCRIPTING_LANGUAGE.equals(language)) { configureGroovyScriptEngine(scriptEngine); } if(isCachable(scriptEngine)) { cachedEngines.put(language, scriptEngine); } } } } else { scriptEngine = scriptEngineManager.getEngineByName(language); } return scriptEngine; }
[ "public", "ScriptEngine", "getScriptEngine", "(", "String", "language", ",", "boolean", "resolveFromCache", ")", "{", "ScriptEngine", "scriptEngine", "=", "null", ";", "if", "(", "resolveFromCache", ")", "{", "scriptEngine", "=", "cachedEngines", ".", "get", "(", "language", ")", ";", "if", "(", "scriptEngine", "==", "null", ")", "{", "scriptEngine", "=", "scriptEngineManager", ".", "getEngineByName", "(", "language", ")", ";", "if", "(", "scriptEngine", "!=", "null", ")", "{", "if", "(", "ScriptingEngines", ".", "GROOVY_SCRIPTING_LANGUAGE", ".", "equals", "(", "language", ")", ")", "{", "configureGroovyScriptEngine", "(", "scriptEngine", ")", ";", "}", "if", "(", "isCachable", "(", "scriptEngine", ")", ")", "{", "cachedEngines", ".", "put", "(", "language", ",", "scriptEngine", ")", ";", "}", "}", "}", "}", "else", "{", "scriptEngine", "=", "scriptEngineManager", ".", "getEngineByName", "(", "language", ")", ";", "}", "return", "scriptEngine", ";", "}" ]
Returns a cached script engine or creates a new script engine if no such engine is currently cached. @param language the language (such as 'groovy' for the script engine) @return the cached engine or null if no script engine can be created for the given language
[ "Returns", "a", "cached", "script", "engine", "or", "creates", "a", "new", "script", "engine", "if", "no", "such", "engine", "is", "currently", "cached", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/scripting/engine/ScriptEngineResolver.java#L56-L85
16,486
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/scripting/engine/ScriptEngineResolver.java
ScriptEngineResolver.isCachable
protected boolean isCachable(ScriptEngine scriptEngine) { // Check if script-engine supports multithreading. If true it can be cached. Object threadingParameter = scriptEngine.getFactory().getParameter("THREADING"); return threadingParameter != null; }
java
protected boolean isCachable(ScriptEngine scriptEngine) { // Check if script-engine supports multithreading. If true it can be cached. Object threadingParameter = scriptEngine.getFactory().getParameter("THREADING"); return threadingParameter != null; }
[ "protected", "boolean", "isCachable", "(", "ScriptEngine", "scriptEngine", ")", "{", "// Check if script-engine supports multithreading. If true it can be cached.", "Object", "threadingParameter", "=", "scriptEngine", ".", "getFactory", "(", ")", ".", "getParameter", "(", "\"THREADING\"", ")", ";", "return", "threadingParameter", "!=", "null", ";", "}" ]
Allows checking whether the script engine can be cached. @param scriptEngine the script engine to check. @return true if the script engine may be cached.
[ "Allows", "checking", "whether", "the", "script", "engine", "can", "be", "cached", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/scripting/engine/ScriptEngineResolver.java#L93-L97
16,487
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/TaskEntity.java
TaskEntity.createAndInsert
public static TaskEntity createAndInsert(VariableScope execution) { TaskEntity task = create(); if (execution instanceof ExecutionEntity) { ExecutionEntity executionEntity = (ExecutionEntity) execution; task.setExecution(executionEntity); task.skipCustomListeners = executionEntity.isSkipCustomListeners(); task.insert(executionEntity); return task; } else if (execution instanceof CaseExecutionEntity) { task.setCaseExecution((DelegateCaseExecution) execution); } task.insert(null); return task; }
java
public static TaskEntity createAndInsert(VariableScope execution) { TaskEntity task = create(); if (execution instanceof ExecutionEntity) { ExecutionEntity executionEntity = (ExecutionEntity) execution; task.setExecution(executionEntity); task.skipCustomListeners = executionEntity.isSkipCustomListeners(); task.insert(executionEntity); return task; } else if (execution instanceof CaseExecutionEntity) { task.setCaseExecution((DelegateCaseExecution) execution); } task.insert(null); return task; }
[ "public", "static", "TaskEntity", "createAndInsert", "(", "VariableScope", "execution", ")", "{", "TaskEntity", "task", "=", "create", "(", ")", ";", "if", "(", "execution", "instanceof", "ExecutionEntity", ")", "{", "ExecutionEntity", "executionEntity", "=", "(", "ExecutionEntity", ")", "execution", ";", "task", ".", "setExecution", "(", "executionEntity", ")", ";", "task", ".", "skipCustomListeners", "=", "executionEntity", ".", "isSkipCustomListeners", "(", ")", ";", "task", ".", "insert", "(", "executionEntity", ")", ";", "return", "task", ";", "}", "else", "if", "(", "execution", "instanceof", "CaseExecutionEntity", ")", "{", "task", ".", "setCaseExecution", "(", "(", "DelegateCaseExecution", ")", "execution", ")", ";", "}", "task", ".", "insert", "(", "null", ")", ";", "return", "task", ";", "}" ]
creates and initializes a new persistent task.
[ "creates", "and", "initializes", "a", "new", "persistent", "task", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/TaskEntity.java#L178-L195
16,488
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/TaskEntity.java
TaskEntity.propertyChanged
protected void propertyChanged(String propertyName, Object orgValue, Object newValue) { if (propertyChanges.containsKey(propertyName)) { // update an existing change to save the original value Object oldOrgValue = propertyChanges.get(propertyName).getOrgValue(); if ((oldOrgValue == null && newValue == null) // change back to null || (oldOrgValue != null && oldOrgValue.equals(newValue))) { // remove this change propertyChanges.remove(propertyName); } else { propertyChanges.get(propertyName).setNewValue(newValue); } } else { // save this change if ((orgValue == null && newValue != null) // null to value || (orgValue != null && newValue == null) // value to null || (orgValue != null && !orgValue.equals(newValue))) // value change propertyChanges.put(propertyName, new PropertyChange(propertyName, orgValue, newValue)); } }
java
protected void propertyChanged(String propertyName, Object orgValue, Object newValue) { if (propertyChanges.containsKey(propertyName)) { // update an existing change to save the original value Object oldOrgValue = propertyChanges.get(propertyName).getOrgValue(); if ((oldOrgValue == null && newValue == null) // change back to null || (oldOrgValue != null && oldOrgValue.equals(newValue))) { // remove this change propertyChanges.remove(propertyName); } else { propertyChanges.get(propertyName).setNewValue(newValue); } } else { // save this change if ((orgValue == null && newValue != null) // null to value || (orgValue != null && newValue == null) // value to null || (orgValue != null && !orgValue.equals(newValue))) // value change propertyChanges.put(propertyName, new PropertyChange(propertyName, orgValue, newValue)); } }
[ "protected", "void", "propertyChanged", "(", "String", "propertyName", ",", "Object", "orgValue", ",", "Object", "newValue", ")", "{", "if", "(", "propertyChanges", ".", "containsKey", "(", "propertyName", ")", ")", "{", "// update an existing change to save the original value", "Object", "oldOrgValue", "=", "propertyChanges", ".", "get", "(", "propertyName", ")", ".", "getOrgValue", "(", ")", ";", "if", "(", "(", "oldOrgValue", "==", "null", "&&", "newValue", "==", "null", ")", "// change back to null", "||", "(", "oldOrgValue", "!=", "null", "&&", "oldOrgValue", ".", "equals", "(", "newValue", ")", ")", ")", "{", "// remove this change", "propertyChanges", ".", "remove", "(", "propertyName", ")", ";", "}", "else", "{", "propertyChanges", ".", "get", "(", "propertyName", ")", ".", "setNewValue", "(", "newValue", ")", ";", "}", "}", "else", "{", "// save this change", "if", "(", "(", "orgValue", "==", "null", "&&", "newValue", "!=", "null", ")", "// null to value", "||", "(", "orgValue", "!=", "null", "&&", "newValue", "==", "null", ")", "// value to null", "||", "(", "orgValue", "!=", "null", "&&", "!", "orgValue", ".", "equals", "(", "newValue", ")", ")", ")", "// value change", "propertyChanges", ".", "put", "(", "propertyName", ",", "new", "PropertyChange", "(", "propertyName", ",", "orgValue", ",", "newValue", ")", ")", ";", "}", "}" ]
Tracks a property change. Therefore the original and new value are stored in a map. It tracks multiple changes and if a property finally is changed back to the original value, then the change is removed. @param propertyName @param orgValue @param newValue
[ "Tracks", "a", "property", "change", ".", "Therefore", "the", "original", "and", "new", "value", "are", "stored", "in", "a", "map", ".", "It", "tracks", "multiple", "changes", "and", "if", "a", "property", "finally", "is", "changed", "back", "to", "the", "original", "value", "then", "the", "change", "is", "removed", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/TaskEntity.java#L995-L1010
16,489
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/TaskEntity.java
TaskEntity.setDelegationStateString
public void setDelegationStateString(String delegationState) { if (delegationState == null) { setDelegationStateWithoutCascade(null); } else { setDelegationStateWithoutCascade(DelegationState.valueOf(delegationState)); } }
java
public void setDelegationStateString(String delegationState) { if (delegationState == null) { setDelegationStateWithoutCascade(null); } else { setDelegationStateWithoutCascade(DelegationState.valueOf(delegationState)); } }
[ "public", "void", "setDelegationStateString", "(", "String", "delegationState", ")", "{", "if", "(", "delegationState", "==", "null", ")", "{", "setDelegationStateWithoutCascade", "(", "null", ")", ";", "}", "else", "{", "setDelegationStateWithoutCascade", "(", "DelegationState", ".", "valueOf", "(", "delegationState", ")", ")", ";", "}", "}" ]
Setter for mybatis mapper. @param delegationState the delegation state as string
[ "Setter", "for", "mybatis", "mapper", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/persistence/entity/TaskEntity.java#L1326-L1332
16,490
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/util/CollectionUtil.java
CollectionUtil.asArrayList
public static <T> List<T> asArrayList(T[] values) { ArrayList<T> result = new ArrayList<T>(); Collections.addAll(result, values); return result; }
java
public static <T> List<T> asArrayList(T[] values) { ArrayList<T> result = new ArrayList<T>(); Collections.addAll(result, values); return result; }
[ "public", "static", "<", "T", ">", "List", "<", "T", ">", "asArrayList", "(", "T", "[", "]", "values", ")", "{", "ArrayList", "<", "T", ">", "result", "=", "new", "ArrayList", "<", "T", ">", "(", ")", ";", "Collections", ".", "addAll", "(", "result", ",", "values", ")", ";", "return", "result", ";", "}" ]
Arrays.asList cannot be reliably used for SQL parameters on MyBatis < 3.3.0
[ "Arrays", ".", "asList", "cannot", "be", "reliably", "used", "for", "SQL", "parameters", "on", "MyBatis", "<", "3", ".", "3", ".", "0" ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/util/CollectionUtil.java#L54-L59
16,491
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/util/CollectionUtil.java
CollectionUtil.partition
public static <T> List<List<T>> partition(List<T> list, final int partitionSize) { List<List<T>> parts = new ArrayList<List<T>>(); final int listSize = list.size(); for (int i = 0; i < listSize; i += partitionSize) { parts.add(new ArrayList<T>(list.subList(i, Math.min(listSize, i + partitionSize)))); } return parts; }
java
public static <T> List<List<T>> partition(List<T> list, final int partitionSize) { List<List<T>> parts = new ArrayList<List<T>>(); final int listSize = list.size(); for (int i = 0; i < listSize; i += partitionSize) { parts.add(new ArrayList<T>(list.subList(i, Math.min(listSize, i + partitionSize)))); } return parts; }
[ "public", "static", "<", "T", ">", "List", "<", "List", "<", "T", ">", ">", "partition", "(", "List", "<", "T", ">", "list", ",", "final", "int", "partitionSize", ")", "{", "List", "<", "List", "<", "T", ">>", "parts", "=", "new", "ArrayList", "<", "List", "<", "T", ">", ">", "(", ")", ";", "final", "int", "listSize", "=", "list", ".", "size", "(", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "listSize", ";", "i", "+=", "partitionSize", ")", "{", "parts", ".", "add", "(", "new", "ArrayList", "<", "T", ">", "(", "list", ".", "subList", "(", "i", ",", "Math", ".", "min", "(", "listSize", ",", "i", "+", "partitionSize", ")", ")", ")", ")", ";", "}", "return", "parts", ";", "}" ]
Chops a list into non-view sublists of length partitionSize.
[ "Chops", "a", "list", "into", "non", "-", "view", "sublists", "of", "length", "partitionSize", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/util/CollectionUtil.java#L98-L105
16,492
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/util/ClockUtil.java
ClockUtil.offset
public static Date offset(Long offsetInMillis) { DateTimeUtils.setCurrentMillisOffset(offsetInMillis); return new Date(DateTimeUtils.currentTimeMillis()); }
java
public static Date offset(Long offsetInMillis) { DateTimeUtils.setCurrentMillisOffset(offsetInMillis); return new Date(DateTimeUtils.currentTimeMillis()); }
[ "public", "static", "Date", "offset", "(", "Long", "offsetInMillis", ")", "{", "DateTimeUtils", ".", "setCurrentMillisOffset", "(", "offsetInMillis", ")", ";", "return", "new", "Date", "(", "DateTimeUtils", ".", "currentTimeMillis", "(", ")", ")", ";", "}" ]
Moves the clock by the given offset and keeps it running from that point on. @param offsetInMillis the offset to move the clock by @return the new 'now'
[ "Moves", "the", "clock", "by", "the", "given", "offset", "and", "keeps", "it", "running", "from", "that", "point", "on", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/util/ClockUtil.java#L60-L63
16,493
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/cfg/auth/DefaultAuthorizationProvider.java
DefaultAuthorizationProvider.updateAuthorizationBasedOnCacheEntries
protected void updateAuthorizationBasedOnCacheEntries(AuthorizationEntity authorization, String userId, String groupId, Resource resource, String resourceId) { DbEntityManager dbManager = Context.getCommandContext().getDbEntityManager(); List<AuthorizationEntity> list = dbManager.getCachedEntitiesByType(AuthorizationEntity.class); for (AuthorizationEntity authEntity : list) { boolean hasSameAuthRights = hasEntitySameAuthorizationRights(authEntity, userId, groupId, resource, resourceId); if (hasSameAuthRights) { int previousPermissions = authEntity.getPermissions(); authorization.setPermissions(previousPermissions); dbManager.getDbEntityCache().remove(authEntity); return; } } }
java
protected void updateAuthorizationBasedOnCacheEntries(AuthorizationEntity authorization, String userId, String groupId, Resource resource, String resourceId) { DbEntityManager dbManager = Context.getCommandContext().getDbEntityManager(); List<AuthorizationEntity> list = dbManager.getCachedEntitiesByType(AuthorizationEntity.class); for (AuthorizationEntity authEntity : list) { boolean hasSameAuthRights = hasEntitySameAuthorizationRights(authEntity, userId, groupId, resource, resourceId); if (hasSameAuthRights) { int previousPermissions = authEntity.getPermissions(); authorization.setPermissions(previousPermissions); dbManager.getDbEntityCache().remove(authEntity); return; } } }
[ "protected", "void", "updateAuthorizationBasedOnCacheEntries", "(", "AuthorizationEntity", "authorization", ",", "String", "userId", ",", "String", "groupId", ",", "Resource", "resource", ",", "String", "resourceId", ")", "{", "DbEntityManager", "dbManager", "=", "Context", ".", "getCommandContext", "(", ")", ".", "getDbEntityManager", "(", ")", ";", "List", "<", "AuthorizationEntity", ">", "list", "=", "dbManager", ".", "getCachedEntitiesByType", "(", "AuthorizationEntity", ".", "class", ")", ";", "for", "(", "AuthorizationEntity", "authEntity", ":", "list", ")", "{", "boolean", "hasSameAuthRights", "=", "hasEntitySameAuthorizationRights", "(", "authEntity", ",", "userId", ",", "groupId", ",", "resource", ",", "resourceId", ")", ";", "if", "(", "hasSameAuthRights", ")", "{", "int", "previousPermissions", "=", "authEntity", ".", "getPermissions", "(", ")", ";", "authorization", ".", "setPermissions", "(", "previousPermissions", ")", ";", "dbManager", ".", "getDbEntityCache", "(", ")", ".", "remove", "(", "authEntity", ")", ";", "return", ";", "}", "}", "}" ]
Searches through the cache, if there is already an authorization with same rights. If that's the case update the given authorization with the permissions and remove the old one from the cache.
[ "Searches", "through", "the", "cache", "if", "there", "is", "already", "an", "authorization", "with", "same", "rights", ".", "If", "that", "s", "the", "case", "update", "the", "given", "authorization", "with", "the", "permissions", "and", "remove", "the", "old", "one", "from", "the", "cache", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/cfg/auth/DefaultAuthorizationProvider.java#L363-L376
16,494
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/history/handler/DbHistoryEventHandler.java
DbHistoryEventHandler.insertOrUpdate
protected void insertOrUpdate(HistoryEvent historyEvent) { final DbEntityManager dbEntityManager = getDbEntityManager(); if(isInitialEvent(historyEvent)) { dbEntityManager.insert(historyEvent); } else { if(dbEntityManager.getCachedEntity(historyEvent.getClass(), historyEvent.getId()) == null) { if (historyEvent instanceof HistoricScopeInstanceEvent) { // if this is a scope, get start time from existing event in DB HistoricScopeInstanceEvent existingEvent = (HistoricScopeInstanceEvent) dbEntityManager.selectById(historyEvent.getClass(), historyEvent.getId()); if(existingEvent != null) { HistoricScopeInstanceEvent historicScopeInstanceEvent = (HistoricScopeInstanceEvent) historyEvent; historicScopeInstanceEvent.setStartTime(existingEvent.getStartTime()); } } if(historyEvent.getId() == null) { // dbSqlSession.insert(historyEvent); } else { dbEntityManager.merge(historyEvent); } } } }
java
protected void insertOrUpdate(HistoryEvent historyEvent) { final DbEntityManager dbEntityManager = getDbEntityManager(); if(isInitialEvent(historyEvent)) { dbEntityManager.insert(historyEvent); } else { if(dbEntityManager.getCachedEntity(historyEvent.getClass(), historyEvent.getId()) == null) { if (historyEvent instanceof HistoricScopeInstanceEvent) { // if this is a scope, get start time from existing event in DB HistoricScopeInstanceEvent existingEvent = (HistoricScopeInstanceEvent) dbEntityManager.selectById(historyEvent.getClass(), historyEvent.getId()); if(existingEvent != null) { HistoricScopeInstanceEvent historicScopeInstanceEvent = (HistoricScopeInstanceEvent) historyEvent; historicScopeInstanceEvent.setStartTime(existingEvent.getStartTime()); } } if(historyEvent.getId() == null) { // dbSqlSession.insert(historyEvent); } else { dbEntityManager.merge(historyEvent); } } } }
[ "protected", "void", "insertOrUpdate", "(", "HistoryEvent", "historyEvent", ")", "{", "final", "DbEntityManager", "dbEntityManager", "=", "getDbEntityManager", "(", ")", ";", "if", "(", "isInitialEvent", "(", "historyEvent", ")", ")", "{", "dbEntityManager", ".", "insert", "(", "historyEvent", ")", ";", "}", "else", "{", "if", "(", "dbEntityManager", ".", "getCachedEntity", "(", "historyEvent", ".", "getClass", "(", ")", ",", "historyEvent", ".", "getId", "(", ")", ")", "==", "null", ")", "{", "if", "(", "historyEvent", "instanceof", "HistoricScopeInstanceEvent", ")", "{", "// if this is a scope, get start time from existing event in DB", "HistoricScopeInstanceEvent", "existingEvent", "=", "(", "HistoricScopeInstanceEvent", ")", "dbEntityManager", ".", "selectById", "(", "historyEvent", ".", "getClass", "(", ")", ",", "historyEvent", ".", "getId", "(", ")", ")", ";", "if", "(", "existingEvent", "!=", "null", ")", "{", "HistoricScopeInstanceEvent", "historicScopeInstanceEvent", "=", "(", "HistoricScopeInstanceEvent", ")", "historyEvent", ";", "historicScopeInstanceEvent", ".", "setStartTime", "(", "existingEvent", ".", "getStartTime", "(", ")", ")", ";", "}", "}", "if", "(", "historyEvent", ".", "getId", "(", ")", "==", "null", ")", "{", "// dbSqlSession.insert(historyEvent);", "}", "else", "{", "dbEntityManager", ".", "merge", "(", "historyEvent", ")", ";", "}", "}", "}", "}" ]
general history event insert behavior
[ "general", "history", "event", "insert", "behavior" ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/history/handler/DbHistoryEventHandler.java#L61-L84
16,495
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/history/handler/DbHistoryEventHandler.java
DbHistoryEventHandler.insertHistoricVariableUpdateEntity
protected void insertHistoricVariableUpdateEntity(HistoricVariableUpdateEventEntity historyEvent) { DbEntityManager dbEntityManager = getDbEntityManager(); // insert update only if history level = FULL if(shouldWriteHistoricDetail(historyEvent)) { // insert byte array entity (if applicable) byte[] byteValue = historyEvent.getByteValue(); if(byteValue != null) { ByteArrayEntity byteArrayEntity = new ByteArrayEntity(historyEvent.getVariableName(), byteValue, ResourceTypes.HISTORY); byteArrayEntity.setRootProcessInstanceId(historyEvent.getRootProcessInstanceId()); byteArrayEntity.setRemovalTime(historyEvent.getRemovalTime()); Context .getCommandContext() .getByteArrayManager() .insertByteArray(byteArrayEntity); historyEvent.setByteArrayId(byteArrayEntity.getId()); } dbEntityManager.insert(historyEvent); } // always insert/update HistoricProcessVariableInstance if (historyEvent.isEventOfType(HistoryEventTypes.VARIABLE_INSTANCE_CREATE)) { HistoricVariableInstanceEntity persistentObject = new HistoricVariableInstanceEntity(historyEvent); dbEntityManager.insert(persistentObject); } else if (historyEvent.isEventOfType(HistoryEventTypes.VARIABLE_INSTANCE_UPDATE) || historyEvent.isEventOfType(HistoryEventTypes.VARIABLE_INSTANCE_MIGRATE)) { HistoricVariableInstanceEntity historicVariableInstanceEntity = dbEntityManager.selectById(HistoricVariableInstanceEntity.class, historyEvent.getVariableInstanceId()); if(historicVariableInstanceEntity != null) { historicVariableInstanceEntity.updateFromEvent(historyEvent); historicVariableInstanceEntity.setState(HistoricVariableInstance.STATE_CREATED); } else { // #CAM-1344 / #SUPPORT-688 // this is a FIX for process instances which were started in camunda fox 6.1 and migrated to camunda BPM 7.0. // in fox 6.1 the HistoricVariable instances were flushed to the DB when the process instance completed. // Since fox 6.2 we populate the HistoricVariable table as we go. HistoricVariableInstanceEntity persistentObject = new HistoricVariableInstanceEntity(historyEvent); dbEntityManager.insert(persistentObject); } } else if(historyEvent.isEventOfType(HistoryEventTypes.VARIABLE_INSTANCE_DELETE)) { HistoricVariableInstanceEntity historicVariableInstanceEntity = dbEntityManager.selectById(HistoricVariableInstanceEntity.class, historyEvent.getVariableInstanceId()); if(historicVariableInstanceEntity != null) { historicVariableInstanceEntity.setState(HistoricVariableInstance.STATE_DELETED); } } }
java
protected void insertHistoricVariableUpdateEntity(HistoricVariableUpdateEventEntity historyEvent) { DbEntityManager dbEntityManager = getDbEntityManager(); // insert update only if history level = FULL if(shouldWriteHistoricDetail(historyEvent)) { // insert byte array entity (if applicable) byte[] byteValue = historyEvent.getByteValue(); if(byteValue != null) { ByteArrayEntity byteArrayEntity = new ByteArrayEntity(historyEvent.getVariableName(), byteValue, ResourceTypes.HISTORY); byteArrayEntity.setRootProcessInstanceId(historyEvent.getRootProcessInstanceId()); byteArrayEntity.setRemovalTime(historyEvent.getRemovalTime()); Context .getCommandContext() .getByteArrayManager() .insertByteArray(byteArrayEntity); historyEvent.setByteArrayId(byteArrayEntity.getId()); } dbEntityManager.insert(historyEvent); } // always insert/update HistoricProcessVariableInstance if (historyEvent.isEventOfType(HistoryEventTypes.VARIABLE_INSTANCE_CREATE)) { HistoricVariableInstanceEntity persistentObject = new HistoricVariableInstanceEntity(historyEvent); dbEntityManager.insert(persistentObject); } else if (historyEvent.isEventOfType(HistoryEventTypes.VARIABLE_INSTANCE_UPDATE) || historyEvent.isEventOfType(HistoryEventTypes.VARIABLE_INSTANCE_MIGRATE)) { HistoricVariableInstanceEntity historicVariableInstanceEntity = dbEntityManager.selectById(HistoricVariableInstanceEntity.class, historyEvent.getVariableInstanceId()); if(historicVariableInstanceEntity != null) { historicVariableInstanceEntity.updateFromEvent(historyEvent); historicVariableInstanceEntity.setState(HistoricVariableInstance.STATE_CREATED); } else { // #CAM-1344 / #SUPPORT-688 // this is a FIX for process instances which were started in camunda fox 6.1 and migrated to camunda BPM 7.0. // in fox 6.1 the HistoricVariable instances were flushed to the DB when the process instance completed. // Since fox 6.2 we populate the HistoricVariable table as we go. HistoricVariableInstanceEntity persistentObject = new HistoricVariableInstanceEntity(historyEvent); dbEntityManager.insert(persistentObject); } } else if(historyEvent.isEventOfType(HistoryEventTypes.VARIABLE_INSTANCE_DELETE)) { HistoricVariableInstanceEntity historicVariableInstanceEntity = dbEntityManager.selectById(HistoricVariableInstanceEntity.class, historyEvent.getVariableInstanceId()); if(historicVariableInstanceEntity != null) { historicVariableInstanceEntity.setState(HistoricVariableInstance.STATE_DELETED); } } }
[ "protected", "void", "insertHistoricVariableUpdateEntity", "(", "HistoricVariableUpdateEventEntity", "historyEvent", ")", "{", "DbEntityManager", "dbEntityManager", "=", "getDbEntityManager", "(", ")", ";", "// insert update only if history level = FULL", "if", "(", "shouldWriteHistoricDetail", "(", "historyEvent", ")", ")", "{", "// insert byte array entity (if applicable)", "byte", "[", "]", "byteValue", "=", "historyEvent", ".", "getByteValue", "(", ")", ";", "if", "(", "byteValue", "!=", "null", ")", "{", "ByteArrayEntity", "byteArrayEntity", "=", "new", "ByteArrayEntity", "(", "historyEvent", ".", "getVariableName", "(", ")", ",", "byteValue", ",", "ResourceTypes", ".", "HISTORY", ")", ";", "byteArrayEntity", ".", "setRootProcessInstanceId", "(", "historyEvent", ".", "getRootProcessInstanceId", "(", ")", ")", ";", "byteArrayEntity", ".", "setRemovalTime", "(", "historyEvent", ".", "getRemovalTime", "(", ")", ")", ";", "Context", ".", "getCommandContext", "(", ")", ".", "getByteArrayManager", "(", ")", ".", "insertByteArray", "(", "byteArrayEntity", ")", ";", "historyEvent", ".", "setByteArrayId", "(", "byteArrayEntity", ".", "getId", "(", ")", ")", ";", "}", "dbEntityManager", ".", "insert", "(", "historyEvent", ")", ";", "}", "// always insert/update HistoricProcessVariableInstance", "if", "(", "historyEvent", ".", "isEventOfType", "(", "HistoryEventTypes", ".", "VARIABLE_INSTANCE_CREATE", ")", ")", "{", "HistoricVariableInstanceEntity", "persistentObject", "=", "new", "HistoricVariableInstanceEntity", "(", "historyEvent", ")", ";", "dbEntityManager", ".", "insert", "(", "persistentObject", ")", ";", "}", "else", "if", "(", "historyEvent", ".", "isEventOfType", "(", "HistoryEventTypes", ".", "VARIABLE_INSTANCE_UPDATE", ")", "||", "historyEvent", ".", "isEventOfType", "(", "HistoryEventTypes", ".", "VARIABLE_INSTANCE_MIGRATE", ")", ")", "{", "HistoricVariableInstanceEntity", "historicVariableInstanceEntity", "=", "dbEntityManager", ".", "selectById", "(", "HistoricVariableInstanceEntity", ".", "class", ",", "historyEvent", ".", "getVariableInstanceId", "(", ")", ")", ";", "if", "(", "historicVariableInstanceEntity", "!=", "null", ")", "{", "historicVariableInstanceEntity", ".", "updateFromEvent", "(", "historyEvent", ")", ";", "historicVariableInstanceEntity", ".", "setState", "(", "HistoricVariableInstance", ".", "STATE_CREATED", ")", ";", "}", "else", "{", "// #CAM-1344 / #SUPPORT-688", "// this is a FIX for process instances which were started in camunda fox 6.1 and migrated to camunda BPM 7.0.", "// in fox 6.1 the HistoricVariable instances were flushed to the DB when the process instance completed.", "// Since fox 6.2 we populate the HistoricVariable table as we go.", "HistoricVariableInstanceEntity", "persistentObject", "=", "new", "HistoricVariableInstanceEntity", "(", "historyEvent", ")", ";", "dbEntityManager", ".", "insert", "(", "persistentObject", ")", ";", "}", "}", "else", "if", "(", "historyEvent", ".", "isEventOfType", "(", "HistoryEventTypes", ".", "VARIABLE_INSTANCE_DELETE", ")", ")", "{", "HistoricVariableInstanceEntity", "historicVariableInstanceEntity", "=", "dbEntityManager", ".", "selectById", "(", "HistoricVariableInstanceEntity", ".", "class", ",", "historyEvent", ".", "getVariableInstanceId", "(", ")", ")", ";", "if", "(", "historicVariableInstanceEntity", "!=", "null", ")", "{", "historicVariableInstanceEntity", ".", "setState", "(", "HistoricVariableInstance", ".", "STATE_DELETED", ")", ";", "}", "}", "}" ]
customized insert behavior for HistoricVariableUpdateEventEntity
[ "customized", "insert", "behavior", "for", "HistoricVariableUpdateEventEntity" ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/history/handler/DbHistoryEventHandler.java#L88-L138
16,496
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/juel/Scanner.java
Scanner.nextEval
protected Token nextEval() throws ScanException { char c1 = input.charAt(position); char c2 = position < input.length()-1 ? input.charAt(position+1) : (char)0; switch (c1) { case '*': return fixed(Symbol.MUL); case '/': return fixed(Symbol.DIV); case '%': return fixed(Symbol.MOD); case '+': return fixed(Symbol.PLUS); case '-': return fixed(Symbol.MINUS); case '?': return fixed(Symbol.QUESTION); case ':': return fixed(Symbol.COLON); case '[': return fixed(Symbol.LBRACK); case ']': return fixed(Symbol.RBRACK); case '(': return fixed(Symbol.LPAREN); case ')': return fixed(Symbol.RPAREN); case ',': return fixed(Symbol.COMMA); case '.': if (!isDigit(c2)) { return fixed(Symbol.DOT); } break; case '=': if (c2 == '=') { return fixed(Symbol.EQ); } break; case '&': if (c2 == '&') { return fixed(Symbol.AND); } break; case '|': if (c2 == '|') { return fixed(Symbol.OR); } break; case '!': if (c2 == '=') { return fixed(Symbol.NE); } return fixed(Symbol.NOT); case '<': if (c2 == '=') { return fixed(Symbol.LE); } return fixed(Symbol.LT); case '>': if (c2 == '=') { return fixed(Symbol.GE); } return fixed(Symbol.GT); case '"': case '\'': return nextString(); } if (isDigit(c1) || c1 == '.') { return nextNumber(); } if (Character.isJavaIdentifierStart(c1)) { int i = position+1; int l = input.length(); while (i < l && Character.isJavaIdentifierPart(input.charAt(i))) { i++; } String name = input.substring(position, i); Token keyword = keyword(name); return keyword == null ? token(Symbol.IDENTIFIER, name, i - position) : keyword; } throw new ScanException(position, "invalid character '" + c1 + "'", "expression token"); }
java
protected Token nextEval() throws ScanException { char c1 = input.charAt(position); char c2 = position < input.length()-1 ? input.charAt(position+1) : (char)0; switch (c1) { case '*': return fixed(Symbol.MUL); case '/': return fixed(Symbol.DIV); case '%': return fixed(Symbol.MOD); case '+': return fixed(Symbol.PLUS); case '-': return fixed(Symbol.MINUS); case '?': return fixed(Symbol.QUESTION); case ':': return fixed(Symbol.COLON); case '[': return fixed(Symbol.LBRACK); case ']': return fixed(Symbol.RBRACK); case '(': return fixed(Symbol.LPAREN); case ')': return fixed(Symbol.RPAREN); case ',': return fixed(Symbol.COMMA); case '.': if (!isDigit(c2)) { return fixed(Symbol.DOT); } break; case '=': if (c2 == '=') { return fixed(Symbol.EQ); } break; case '&': if (c2 == '&') { return fixed(Symbol.AND); } break; case '|': if (c2 == '|') { return fixed(Symbol.OR); } break; case '!': if (c2 == '=') { return fixed(Symbol.NE); } return fixed(Symbol.NOT); case '<': if (c2 == '=') { return fixed(Symbol.LE); } return fixed(Symbol.LT); case '>': if (c2 == '=') { return fixed(Symbol.GE); } return fixed(Symbol.GT); case '"': case '\'': return nextString(); } if (isDigit(c1) || c1 == '.') { return nextNumber(); } if (Character.isJavaIdentifierStart(c1)) { int i = position+1; int l = input.length(); while (i < l && Character.isJavaIdentifierPart(input.charAt(i))) { i++; } String name = input.substring(position, i); Token keyword = keyword(name); return keyword == null ? token(Symbol.IDENTIFIER, name, i - position) : keyword; } throw new ScanException(position, "invalid character '" + c1 + "'", "expression token"); }
[ "protected", "Token", "nextEval", "(", ")", "throws", "ScanException", "{", "char", "c1", "=", "input", ".", "charAt", "(", "position", ")", ";", "char", "c2", "=", "position", "<", "input", ".", "length", "(", ")", "-", "1", "?", "input", ".", "charAt", "(", "position", "+", "1", ")", ":", "(", "char", ")", "0", ";", "switch", "(", "c1", ")", "{", "case", "'", "'", ":", "return", "fixed", "(", "Symbol", ".", "MUL", ")", ";", "case", "'", "'", ":", "return", "fixed", "(", "Symbol", ".", "DIV", ")", ";", "case", "'", "'", ":", "return", "fixed", "(", "Symbol", ".", "MOD", ")", ";", "case", "'", "'", ":", "return", "fixed", "(", "Symbol", ".", "PLUS", ")", ";", "case", "'", "'", ":", "return", "fixed", "(", "Symbol", ".", "MINUS", ")", ";", "case", "'", "'", ":", "return", "fixed", "(", "Symbol", ".", "QUESTION", ")", ";", "case", "'", "'", ":", "return", "fixed", "(", "Symbol", ".", "COLON", ")", ";", "case", "'", "'", ":", "return", "fixed", "(", "Symbol", ".", "LBRACK", ")", ";", "case", "'", "'", ":", "return", "fixed", "(", "Symbol", ".", "RBRACK", ")", ";", "case", "'", "'", ":", "return", "fixed", "(", "Symbol", ".", "LPAREN", ")", ";", "case", "'", "'", ":", "return", "fixed", "(", "Symbol", ".", "RPAREN", ")", ";", "case", "'", "'", ":", "return", "fixed", "(", "Symbol", ".", "COMMA", ")", ";", "case", "'", "'", ":", "if", "(", "!", "isDigit", "(", "c2", ")", ")", "{", "return", "fixed", "(", "Symbol", ".", "DOT", ")", ";", "}", "break", ";", "case", "'", "'", ":", "if", "(", "c2", "==", "'", "'", ")", "{", "return", "fixed", "(", "Symbol", ".", "EQ", ")", ";", "}", "break", ";", "case", "'", "'", ":", "if", "(", "c2", "==", "'", "'", ")", "{", "return", "fixed", "(", "Symbol", ".", "AND", ")", ";", "}", "break", ";", "case", "'", "'", ":", "if", "(", "c2", "==", "'", "'", ")", "{", "return", "fixed", "(", "Symbol", ".", "OR", ")", ";", "}", "break", ";", "case", "'", "'", ":", "if", "(", "c2", "==", "'", "'", ")", "{", "return", "fixed", "(", "Symbol", ".", "NE", ")", ";", "}", "return", "fixed", "(", "Symbol", ".", "NOT", ")", ";", "case", "'", "'", ":", "if", "(", "c2", "==", "'", "'", ")", "{", "return", "fixed", "(", "Symbol", ".", "LE", ")", ";", "}", "return", "fixed", "(", "Symbol", ".", "LT", ")", ";", "case", "'", "'", ":", "if", "(", "c2", "==", "'", "'", ")", "{", "return", "fixed", "(", "Symbol", ".", "GE", ")", ";", "}", "return", "fixed", "(", "Symbol", ".", "GT", ")", ";", "case", "'", "'", ":", "case", "'", "'", ":", "return", "nextString", "(", ")", ";", "}", "if", "(", "isDigit", "(", "c1", ")", "||", "c1", "==", "'", "'", ")", "{", "return", "nextNumber", "(", ")", ";", "}", "if", "(", "Character", ".", "isJavaIdentifierStart", "(", "c1", ")", ")", "{", "int", "i", "=", "position", "+", "1", ";", "int", "l", "=", "input", ".", "length", "(", ")", ";", "while", "(", "i", "<", "l", "&&", "Character", ".", "isJavaIdentifierPart", "(", "input", ".", "charAt", "(", "i", ")", ")", ")", "{", "i", "++", ";", "}", "String", "name", "=", "input", ".", "substring", "(", "position", ",", "i", ")", ";", "Token", "keyword", "=", "keyword", "(", "name", ")", ";", "return", "keyword", "==", "null", "?", "token", "(", "Symbol", ".", "IDENTIFIER", ",", "name", ",", "i", "-", "position", ")", ":", "keyword", ";", "}", "throw", "new", "ScanException", "(", "position", ",", "\"invalid character '\"", "+", "c1", "+", "\"'\"", ",", "\"expression token\"", ")", ";", "}" ]
token inside an eval expression
[ "token", "inside", "an", "eval", "expression" ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/juel/Scanner.java#L348-L420
16,497
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/engine/impl/juel/Builder.java
Builder.main
public static void main(String[] args) { if (args.length != 1) { System.err.println("usage: java " + Builder.class.getName() + " <expression string>"); System.exit(1); } PrintWriter out = new PrintWriter(System.out); Tree tree = null; try { tree = new Builder(Feature.METHOD_INVOCATIONS).build(args[0]); } catch (TreeBuilderException e) { System.out.println(e.getMessage()); System.exit(0); } NodePrinter.dump(out, tree.getRoot()); if (!tree.getFunctionNodes().iterator().hasNext() && !tree.getIdentifierNodes().iterator().hasNext()) { ELContext context = new ELContext() { @Override public VariableMapper getVariableMapper() { return null; } @Override public FunctionMapper getFunctionMapper() { return null; } @Override public ELResolver getELResolver() { return null; } }; out.print(">> "); try { out.println(tree.getRoot().getValue(new Bindings(null, null), context, null)); } catch (ELException e) { out.println(e.getMessage()); } } out.flush(); }
java
public static void main(String[] args) { if (args.length != 1) { System.err.println("usage: java " + Builder.class.getName() + " <expression string>"); System.exit(1); } PrintWriter out = new PrintWriter(System.out); Tree tree = null; try { tree = new Builder(Feature.METHOD_INVOCATIONS).build(args[0]); } catch (TreeBuilderException e) { System.out.println(e.getMessage()); System.exit(0); } NodePrinter.dump(out, tree.getRoot()); if (!tree.getFunctionNodes().iterator().hasNext() && !tree.getIdentifierNodes().iterator().hasNext()) { ELContext context = new ELContext() { @Override public VariableMapper getVariableMapper() { return null; } @Override public FunctionMapper getFunctionMapper() { return null; } @Override public ELResolver getELResolver() { return null; } }; out.print(">> "); try { out.println(tree.getRoot().getValue(new Bindings(null, null), context, null)); } catch (ELException e) { out.println(e.getMessage()); } } out.flush(); }
[ "public", "static", "void", "main", "(", "String", "[", "]", "args", ")", "{", "if", "(", "args", ".", "length", "!=", "1", ")", "{", "System", ".", "err", ".", "println", "(", "\"usage: java \"", "+", "Builder", ".", "class", ".", "getName", "(", ")", "+", "\" <expression string>\"", ")", ";", "System", ".", "exit", "(", "1", ")", ";", "}", "PrintWriter", "out", "=", "new", "PrintWriter", "(", "System", ".", "out", ")", ";", "Tree", "tree", "=", "null", ";", "try", "{", "tree", "=", "new", "Builder", "(", "Feature", ".", "METHOD_INVOCATIONS", ")", ".", "build", "(", "args", "[", "0", "]", ")", ";", "}", "catch", "(", "TreeBuilderException", "e", ")", "{", "System", ".", "out", ".", "println", "(", "e", ".", "getMessage", "(", ")", ")", ";", "System", ".", "exit", "(", "0", ")", ";", "}", "NodePrinter", ".", "dump", "(", "out", ",", "tree", ".", "getRoot", "(", ")", ")", ";", "if", "(", "!", "tree", ".", "getFunctionNodes", "(", ")", ".", "iterator", "(", ")", ".", "hasNext", "(", ")", "&&", "!", "tree", ".", "getIdentifierNodes", "(", ")", ".", "iterator", "(", ")", ".", "hasNext", "(", ")", ")", "{", "ELContext", "context", "=", "new", "ELContext", "(", ")", "{", "@", "Override", "public", "VariableMapper", "getVariableMapper", "(", ")", "{", "return", "null", ";", "}", "@", "Override", "public", "FunctionMapper", "getFunctionMapper", "(", ")", "{", "return", "null", ";", "}", "@", "Override", "public", "ELResolver", "getELResolver", "(", ")", "{", "return", "null", ";", "}", "}", ";", "out", ".", "print", "(", "\">> \"", ")", ";", "try", "{", "out", ".", "println", "(", "tree", ".", "getRoot", "(", ")", ".", "getValue", "(", "new", "Bindings", "(", "null", ",", "null", ")", ",", "context", ",", "null", ")", ")", ";", "}", "catch", "(", "ELException", "e", ")", "{", "out", ".", "println", "(", "e", ".", "getMessage", "(", ")", ")", ";", "}", "}", "out", ".", "flush", "(", ")", ";", "}" ]
Dump out abstract syntax tree for a given expression @param args array with one element, containing the expression string
[ "Dump", "out", "abstract", "syntax", "tree", "for", "a", "given", "expression" ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/juel/Builder.java#L125-L162
16,498
camunda/camunda-bpm-platform
javaee/ejb-service/src/main/java/org/camunda/bpm/container/impl/ejb/deployment/StartJcaExecutorServiceStep.java
StartJcaExecutorServiceStep.checkConfiguration
private void checkConfiguration(JobExecutorXml jobExecutorXml) { Map<String, String> properties = jobExecutorXml.getProperties(); for (Entry<String, String> entry : properties.entrySet()) { LOGGER.warning("Property " + entry.getKey() + " with value " + entry.getValue() + " from bpm-platform.xml will be ignored for JobExecutor."); } }
java
private void checkConfiguration(JobExecutorXml jobExecutorXml) { Map<String, String> properties = jobExecutorXml.getProperties(); for (Entry<String, String> entry : properties.entrySet()) { LOGGER.warning("Property " + entry.getKey() + " with value " + entry.getValue() + " from bpm-platform.xml will be ignored for JobExecutor."); } }
[ "private", "void", "checkConfiguration", "(", "JobExecutorXml", "jobExecutorXml", ")", "{", "Map", "<", "String", ",", "String", ">", "properties", "=", "jobExecutorXml", ".", "getProperties", "(", ")", ";", "for", "(", "Entry", "<", "String", ",", "String", ">", "entry", ":", "properties", ".", "entrySet", "(", ")", ")", "{", "LOGGER", ".", "warning", "(", "\"Property \"", "+", "entry", ".", "getKey", "(", ")", "+", "\" with value \"", "+", "entry", ".", "getValue", "(", ")", "+", "\" from bpm-platform.xml will be ignored for JobExecutor.\"", ")", ";", "}", "}" ]
Checks the validation to see if properties are present, which will be ignored in this environment so we can log a warning.
[ "Checks", "the", "validation", "to", "see", "if", "properties", "are", "present", "which", "will", "be", "ignored", "in", "this", "environment", "so", "we", "can", "log", "a", "warning", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/javaee/ejb-service/src/main/java/org/camunda/bpm/container/impl/ejb/deployment/StartJcaExecutorServiceStep.java#L68-L73
16,499
camunda/camunda-bpm-platform
engine/src/main/java/org/camunda/bpm/container/impl/deployment/StopProcessEnginesStep.java
StopProcessEnginesStep.stopProcessEngine
private void stopProcessEngine(String serviceName, PlatformServiceContainer serviceContainer) { try { serviceContainer.stopService(serviceName); } catch(Exception e) { LOG.exceptionWhileStopping("Process Engine", serviceName, e); } }
java
private void stopProcessEngine(String serviceName, PlatformServiceContainer serviceContainer) { try { serviceContainer.stopService(serviceName); } catch(Exception e) { LOG.exceptionWhileStopping("Process Engine", serviceName, e); } }
[ "private", "void", "stopProcessEngine", "(", "String", "serviceName", ",", "PlatformServiceContainer", "serviceContainer", ")", "{", "try", "{", "serviceContainer", ".", "stopService", "(", "serviceName", ")", ";", "}", "catch", "(", "Exception", "e", ")", "{", "LOG", ".", "exceptionWhileStopping", "(", "\"Process Engine\"", ",", "serviceName", ",", "e", ")", ";", "}", "}" ]
Stops a process engine, failures are logged but no exceptions are thrown.
[ "Stops", "a", "process", "engine", "failures", "are", "logged", "but", "no", "exceptions", "are", "thrown", "." ]
1a464fc887ef3760e53d6f91b9e5b871a0d77cc0
https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/container/impl/deployment/StopProcessEnginesStep.java#L56-L65