本文整理汇总了Java中org.camunda.bpm.engine.impl.util.xml.Element.element方法的典型用法代码示例。如果您正苦于以下问题:Java Element.element方法的具体用法?Java Element.element怎么用?Java Element.element使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.camunda.bpm.engine.impl.util.xml.Element
的用法示例。
在下文中一共展示了Element.element方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseConfiguration
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
public void parseConfiguration(Element activityElement, DeploymentEntity deployment, ProcessDefinitionEntity processDefinition, BpmnParse bpmnParse) {
this.deploymentId = deployment.getId();
ExpressionManager expressionManager = Context
.getProcessEngineConfiguration()
.getExpressionManager();
Element extensionElement = activityElement.element("extensionElements");
if (extensionElement != null) {
// provide support for deprecated form properties
parseFormProperties(bpmnParse, expressionManager, extensionElement);
// provide support for new form field metadata
parseFormData(bpmnParse, expressionManager, extensionElement);
}
}
示例2: parseOutputParameter
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected void parseOutputParameter(Element callActivityElement, ActivityImpl activity, CallableElement callableElement) {
Element extensionsElement = callActivityElement.element("extensionElements");
if (extensionsElement != null) {
// output data elements
for (Element outElement : extensionsElement.elementsNS(CAMUNDA_BPMN_EXTENSIONS_NS, "out")) {
CallableElementParameter parameter = parseCallableElementProvider(outElement);
if (attributeValueEquals(outElement, "local", TRUE)) {
callableElement.addOutputLocal(parameter);
}
else {
callableElement.addOutput(parameter);
}
}
}
}
示例3: parseActivity
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected void parseActivity(Element element, ActivityImpl activity) {
if (isMultiInstance(activity)) {
// in case of multi-instance, the extension elements is set according to the async attributes
// the extension for multi-instance body is set on the element of the activity
ActivityImpl miBody = activity.getParentFlowScopeActivity();
if (isAsync(miBody)) {
setFailedJobRetryTimeCycleValue(element, miBody);
}
// the extension for inner activity is set on the multiInstanceLoopCharacteristics element
if (isAsync(activity)) {
Element multiInstanceLoopCharacteristics = element.element(MULTI_INSTANCE_LOOP_CHARACTERISTICS);
setFailedJobRetryTimeCycleValue(multiInstanceLoopCharacteristics, activity);
}
} else if (isAsync(activity)) {
setFailedJobRetryTimeCycleValue(element, activity);
}
}
示例4: setFailedJobRetryTimeCycleValue
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected void setFailedJobRetryTimeCycleValue(Element element, ActivityImpl activity) {
String failedJobRetryTimeCycleConfiguration = null;
Element extensionElements = element.element(EXTENSION_ELEMENTS);
if (extensionElements != null) {
Element failedJobRetryTimeCycleElement = extensionElements.elementNS(FOX_ENGINE_NS, FAILED_JOB_RETRY_TIME_CYCLE);
if (failedJobRetryTimeCycleElement == null) {
// try to get it from the activiti namespace
failedJobRetryTimeCycleElement = extensionElements.elementNS(BpmnParse.CAMUNDA_BPMN_EXTENSIONS_NS, FAILED_JOB_RETRY_TIME_CYCLE);
}
if (failedJobRetryTimeCycleElement != null) {
failedJobRetryTimeCycleConfiguration = failedJobRetryTimeCycleElement.getText();
}
}
if (failedJobRetryTimeCycleConfiguration == null || failedJobRetryTimeCycleConfiguration.isEmpty()) {
failedJobRetryTimeCycleConfiguration = Context.getProcessEngineConfiguration().getFailedJobRetryTimeCycle();
}
if (failedJobRetryTimeCycleConfiguration != null) {
FailedJobRetryConfiguration configuration = ParseUtil.parseRetryIntervals(failedJobRetryTimeCycleConfiguration);
activity.getProperties().set(FAILED_JOB_CONFIGURATION, configuration);
}
}
示例5: parseInputParameter
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected void parseInputParameter(Element callActivityElement, ActivityImpl activity, CallableElement callableElement) {
Element extensionsElement = callActivityElement.element("extensionElements");
if (extensionsElement != null) {
// input data elements
for (Element inElement : extensionsElement.elementsNS(CAMUNDA_BPMN_EXTENSIONS_NS, "in")) {
String businessKey = inElement.attribute("businessKey");
if (businessKey != null && !businessKey.isEmpty()) {
ParameterValueProvider businessKeyValueProvider = createParameterValueProvider(businessKey, expressionManager);
callableElement.setBusinessKeyValueProvider(businessKeyValueProvider);
} else {
CallableElementParameter parameter = parseCallableElementProvider(inElement);
if (attributeValueEquals(inElement, "local", TRUE)) {
parameter.setReadLocal(true);
}
callableElement.addInput(parameter);
}
}
}
}
示例6: parseExecutionListenersOnScope
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
/**
* 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.
*/
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);
}
}
}
}
}
示例7: parseScriptTaskElement
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
/**
* Returns a {@link ScriptTaskActivityBehavior} for the script task element
* corresponding to the script source or resource specified.
*
* @param scriptTaskElement
* the script task element
* @return the corresponding {@link ScriptTaskActivityBehavior}
*/
protected ScriptTaskActivityBehavior parseScriptTaskElement(Element scriptTaskElement) {
// determine script language
String language = scriptTaskElement.attribute("scriptFormat");
if (language == null) {
language = ScriptingEngines.DEFAULT_SCRIPTING_LANGUAGE;
}
String resultVariableName = parseResultVariable(scriptTaskElement);
// determine script source
String scriptSource = null;
Element scriptElement = scriptTaskElement.element("script");
if (scriptElement != null) {
scriptSource = scriptElement.getText();
}
String scriptResource = scriptTaskElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, PROPERTYNAME_RESOURCE);
try {
ExecutableScript script = ScriptUtil.getScript(language, scriptSource, scriptResource, expressionManager);
return new ScriptTaskActivityBehavior(script, resultVariableName);
} catch (ProcessEngineException e) {
addError("Unable to process ScriptTask: " + e.getMessage(), scriptElement);
return null;
}
}
示例8: parseAsynchronousContinuationForActivity
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
/**
* Parse async continuation of an activity and create async jobs for the activity.
* <br/> <br/>
* When the activity is marked as multi instance, then async jobs create instead for the multi instance body.
* When the wrapped activity has async characteristics in 'multiInstanceLoopCharacteristics' element,
* then async jobs create additionally for the wrapped activity.
*/
protected void parseAsynchronousContinuationForActivity(Element activityElement, ActivityImpl activity) {
// can't use #getMultiInstanceScope here to determine whether the task is multi-instance,
// since the property hasn't been set yet (cf parseActivity)
ActivityImpl parentFlowScopeActivity = activity.getParentFlowScopeActivity();
if (parentFlowScopeActivity != null && parentFlowScopeActivity.getActivityBehavior() instanceof MultiInstanceActivityBehavior
&& !activity.isCompensationHandler()) {
parseAsynchronousContinuation(activityElement, parentFlowScopeActivity);
Element miLoopCharacteristics = activityElement.element("multiInstanceLoopCharacteristics");
parseAsynchronousContinuation(miLoopCharacteristics, activity);
} else {
parseAsynchronousContinuation(activityElement, activity);
}
}
示例9: parseFieldDeclarations
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
public List<FieldDeclaration> parseFieldDeclarations(Element element) {
List<FieldDeclaration> fieldDeclarations = new ArrayList<FieldDeclaration>();
Element elementWithFieldInjections = element.element("extensionElements");
if (elementWithFieldInjections == null) { // Custom extensions will just
// have the <field.. as a
// subelement
elementWithFieldInjections = element;
}
List<Element> fieldDeclarationElements = elementWithFieldInjections.elementsNS(CAMUNDA_BPMN_EXTENSIONS_NS, "field");
if (fieldDeclarationElements != null && !fieldDeclarationElements.isEmpty()) {
for (Element fieldDeclarationElement : fieldDeclarationElements) {
FieldDeclaration fieldDeclaration = parseFieldDeclaration(element, fieldDeclarationElement);
if (fieldDeclaration != null) {
fieldDeclarations.add(fieldDeclaration);
}
}
}
return fieldDeclarations;
}
示例10: parsePotentialOwnerResourceAssignment
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected void parsePotentialOwnerResourceAssignment(Element performerElement, TaskDefinition taskDefinition) {
Element raeElement = performerElement.element(RESOURCE_ASSIGNMENT_EXPR);
if (raeElement != null) {
Element feElement = raeElement.element(FORMAL_EXPRESSION);
if (feElement != null) {
List<String> assignmentExpressions = parseCommaSeparatedList(feElement.getText());
for (String assignmentExpression : assignmentExpressions) {
assignmentExpression = assignmentExpression.trim();
if (assignmentExpression.startsWith(USER_PREFIX)) {
String userAssignementId = getAssignmentId(assignmentExpression, USER_PREFIX);
taskDefinition.addCandidateUserIdExpression(expressionManager.createExpression(userAssignementId));
} else if (assignmentExpression.startsWith(GROUP_PREFIX)) {
String groupAssignementId = getAssignmentId(assignmentExpression, GROUP_PREFIX);
taskDefinition.addCandidateGroupIdExpression(expressionManager.createExpression(groupAssignementId));
} else { // default: given string is a goupId, as-is.
taskDefinition.addCandidateGroupIdExpression(expressionManager.createExpression(assignmentExpression));
}
}
}
}
}
示例11: parseTaskListeners
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected void parseTaskListeners(Element userTaskElement, TaskDefinition taskDefinition) {
Element extentionsElement = userTaskElement.element("extensionElements");
if (extentionsElement != null) {
List<Element> taskListenerElements = extentionsElement.elementsNS(CAMUNDA_BPMN_EXTENSIONS_NS, "taskListener");
for (Element taskListenerElement : taskListenerElements) {
String eventName = taskListenerElement.attribute("event");
if (eventName != null) {
if (TaskListener.EVENTNAME_CREATE.equals(eventName) || TaskListener.EVENTNAME_ASSIGNMENT.equals(eventName)
|| TaskListener.EVENTNAME_COMPLETE.equals(eventName) || TaskListener.EVENTNAME_DELETE.equals(eventName)) {
TaskListener taskListener = parseTaskListener(taskListenerElement);
taskDefinition.addTaskListener(eventName, taskListener);
} else {
addError("Attribute 'event' must be one of {create|assignment|complete|delete}", userTaskElement);
}
} else {
addError("Attribute 'event' is mandatory on taskListener", userTaskElement);
}
}
}
}
示例12: parseBoundaryTimerEventDefinition
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
/**
* Parses a boundary timer event. The end-result will be that the given nested
* activity will get the appropriate {@link ActivityBehavior}.
*
* @param timerEventDefinition
* The XML element corresponding with the timer event details
* @param interrupting
* Indicates whether this timer is interrupting.
* @param boundaryActivity
* The activity which maps to the structure of the timer event on the
* boundary of another activity. Note that this is NOT the activity
* onto which the boundary event is attached, but a nested activity
* inside this activity, specifically created for this event.
*/
public void parseBoundaryTimerEventDefinition(Element timerEventDefinition, boolean interrupting, ActivityImpl boundaryActivity) {
boundaryActivity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.BOUNDARY_TIMER);
TimerDeclarationImpl timerDeclaration = parseTimer(timerEventDefinition, boundaryActivity, TimerExecuteNestedActivityJobHandler.TYPE);
// ACT-1427
if (interrupting) {
timerDeclaration.setInterruptingTimer(true);
Element timeCycleElement = timerEventDefinition.element("timeCycle");
if (timeCycleElement != null) {
addTimeCycleWarning(timeCycleElement, "cancelling boundary");
}
}
addTimerDeclaration(boundaryActivity.getEventScope(), timerDeclaration);
for (BpmnParseListener parseListener : parseListeners) {
parseListener.parseBoundaryTimerEventDefinition(timerEventDefinition, interrupting, boundaryActivity);
}
}
示例13: parseStartAuthorization
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected void parseStartAuthorization(Element scopeElement, ProcessDefinition definition) {
ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) definition;
// parse activiti:potentialStarters
Element extentionsElement = scopeElement.element("extensionElements");
if (extentionsElement != null) {
List<Element> potentialStarterElements = extentionsElement.elementsNS(CAMUNDA_BPMN_EXTENSIONS_NS, POTENTIAL_STARTER);
for (Element potentialStarterElement : potentialStarterElements) {
parsePotentialStarterResourceAssignment(potentialStarterElement, processDefinition);
}
}
// parse activiti:candidateStarterUsers
String candidateUsersString = scopeElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, CANDIDATE_STARTER_USERS_EXTENSION);
if (candidateUsersString != null) {
List<String> candidateUsers = parseCommaSeparatedList(candidateUsersString);
for (String candidateUser : candidateUsers) {
processDefinition.addCandidateStarterUserIdExpression(expressionManager.createExpression(candidateUser.trim()));
}
}
// Candidate activiti:candidateStarterGroups
String candidateGroupsString = scopeElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, CANDIDATE_STARTER_GROUPS_EXTENSION);
if (candidateGroupsString != null) {
List<String> candidateGroups = parseCommaSeparatedList(candidateGroupsString);
for (String candidateGroup : candidateGroups) {
processDefinition.addCandidateStarterGroupIdExpression(expressionManager.createExpression(candidateGroup.trim()));
}
}
}
示例14: parseConditionalEventDefinition
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
/**
* 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
*/
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;
}
示例15: parseHumanPerformerResourceAssignment
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected void parseHumanPerformerResourceAssignment(Element performerElement, TaskDefinition taskDefinition) {
Element raeElement = performerElement.element(RESOURCE_ASSIGNMENT_EXPR);
if (raeElement != null) {
Element feElement = raeElement.element(FORMAL_EXPRESSION);
if (feElement != null) {
taskDefinition.setAssigneeExpression(expressionManager.createExpression(feElement.getText()));
}
}
}