本文整理汇总了Java中org.camunda.bpm.engine.impl.util.xml.Element.attributeNS方法的典型用法代码示例。如果您正苦于以下问题:Java Element.attributeNS方法的具体用法?Java Element.attributeNS怎么用?Java Element.attributeNS使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.camunda.bpm.engine.impl.util.xml.Element
的用法示例。
在下文中一共展示了Element.attributeNS方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: parseConfiguration
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
@Override
public void parseConfiguration(Element activityElement, DeploymentEntity deployment, ProcessDefinitionEntity processDefinition, BpmnParse bpmnParse) {
super.parseConfiguration(activityElement, deployment, processDefinition, bpmnParse);
ExpressionManager expressionManager = Context
.getProcessEngineConfiguration()
.getExpressionManager();
String formKeyAttribute = activityElement.attributeNS(BpmnParse.CAMUNDA_BPMN_EXTENSIONS_NS, "formKey");
if (formKeyAttribute != null) {
this.formKey = expressionManager.createExpression(formKeyAttribute);
}
if (formKey != null) {
processDefinition.setStartFormKey(true);
}
}
示例2: parseStartFormHandlers
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected void parseStartFormHandlers(List<Element> startEventElements, ProcessDefinitionEntity processDefinition) {
if (processDefinition.getInitial() != null) {
for (Element startEventElement : startEventElements) {
if (startEventElement.attribute("id").equals(processDefinition.getInitial().getId())) {
StartFormHandler startFormHandler;
String startFormHandlerClassName = startEventElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "formHandlerClass");
if (startFormHandlerClassName != null) {
startFormHandler = (StartFormHandler) ReflectUtil.instantiate(startFormHandlerClassName);
} else {
startFormHandler = new DefaultStartFormHandler();
}
startFormHandler.parseConfiguration(startEventElement, deployment, processDefinition, this);
processDefinition.setStartFormHandler(new DelegateStartFormHandler(startFormHandler, deployment));
}
}
}
}
示例3: 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;
}
}
示例4: parseConditionExpression
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected Condition parseConditionExpression(Element conditionExprElement) {
String expression = conditionExprElement.getText().trim();
String type = conditionExprElement.attributeNS(XSI_NS, TYPE);
String language = conditionExprElement.attribute(PROPERTYNAME_LANGUAGE);
String resource = conditionExprElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, PROPERTYNAME_RESOURCE);
if (type != null) {
String value = type.contains(":") ? resolveName(type) : BpmnParser.BPMN20_NS + ":" + type;
if (!value.equals(ATTRIBUTEVALUE_T_FORMAL_EXPRESSION)) {
addError("Invalid type, only tFormalExpression is currently supported", conditionExprElement);
}
}
Condition condition = null;
if (language == null) {
condition = new UelExpressionCondition(expressionManager.createExpression(expression));
} else {
try {
ExecutableScript script = ScriptUtil.getScript(language, expression, resource, expressionManager);
condition = new ScriptCondition(script);
} catch (ProcessEngineException e) {
addError("Unable to process condition expression:" + e.getMessage(), conditionExprElement);
}
}
return condition;
}
示例5: parsePriority
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected ParameterValueProvider parsePriority(Element element, String priorityAttribute) {
String priorityAttributeValue = element.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, priorityAttribute);
if (priorityAttributeValue == null) {
return null;
} else {
Object value = priorityAttributeValue;
if (!StringUtil.isExpression(priorityAttributeValue)) {
// constant values must be valid integers
try {
value = Integer.parseInt(priorityAttributeValue);
} catch (NumberFormatException e) {
addError("Value '" + priorityAttributeValue + "' for attribute '" + priorityAttribute + "' is not a valid number", element);
}
}
return createParameterValueProvider(value, expressionManager);
}
}
示例6: createEscalationEventDefinitionForEscalationHandler
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected EscalationEventDefinition createEscalationEventDefinitionForEscalationHandler(Element escalationEventDefinitionElement, ActivityImpl escalationHandler, boolean cancelActivity) {
EscalationEventDefinition escalationEventDefinition = new EscalationEventDefinition(escalationHandler, cancelActivity);
String escalationRef = escalationEventDefinitionElement.attribute("escalationRef");
if (escalationRef != null) {
if (!escalations.containsKey(escalationRef)) {
addError("could not find escalation with id '" + escalationRef + "'", escalationEventDefinitionElement);
} else {
Escalation escalation = escalations.get(escalationRef);
escalationEventDefinition.setEscalationCode(escalation.getEscalationCode());
}
}
String escalationCodeVariable = escalationEventDefinitionElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "escalationCodeVariable");
if(escalationCodeVariable != null) {
escalationEventDefinition.setEscalationCodeVariable(escalationCodeVariable);
}
return escalationEventDefinition;
}
示例7: 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()));
}
}
}
示例8: parseTenantId
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected void parseTenantId(Element callingActivityElement, ActivityImpl activity, BaseCallableElement callableElement, String attrName) {
ParameterValueProvider tenantIdValueProvider;
String tenantId = callingActivityElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, attrName);
if (tenantId != null && tenantId.length() > 0) {
tenantIdValueProvider = createParameterValueProvider(tenantId, expressionManager);
} else {
tenantIdValueProvider = new DefaultCallableElementTenantIdProvider();
}
callableElement.setTenantIdProvider(tenantIdValueProvider);
}
示例9: parseResultVariable
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected String parseResultVariable(Element element) {
// determine if result variable exists
String resultVariableName = element.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "resultVariable");
if (resultVariableName == null) {
// for backwards compatible reasons
resultVariableName = element.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "resultVariableName");
}
return resultVariableName;
}
示例10: parseBusinessRuleTask
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
/**
* Parses a businessRuleTask declaration.
*/
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);
}
}
示例11: parseDecisionResultMapper
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected DecisionResultMapper parseDecisionResultMapper(Element businessRuleTaskElement) {
// default mapper is 'resultList'
String decisionResultMapper = businessRuleTaskElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "mapDecisionResult");
DecisionResultMapper mapper = DecisionEvaluationUtil.getDecisionResultMapperForName(decisionResultMapper);
if (mapper == null) {
addError("No decision result mapper found for name '" + decisionResultMapper
+ "'. Supported mappers are 'singleEntry', 'singleResult', 'collectEntries' and 'resultList'.", businessRuleTaskElement);
}
return mapper;
}
示例12: parseTopic
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected ParameterValueProvider parseTopic(Element element, String topicAttribute) {
String topicAttributeValue = element.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, topicAttribute);
if (topicAttributeValue == null) {
addError("External tasks must specify a 'topic' attribute in the camunda namespace", element);
return null;
} else {
return createParameterValueProvider(topicAttributeValue, expressionManager);
}
}
示例13: parseTaskDefinition
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
public TaskDefinition parseTaskDefinition(Element taskElement, String taskDefinitionKey, ProcessDefinitionEntity processDefinition) {
TaskFormHandler taskFormHandler;
String taskFormHandlerClassName = taskElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "formHandlerClass");
if (taskFormHandlerClassName != null) {
taskFormHandler = (TaskFormHandler) ReflectUtil.instantiate(taskFormHandlerClassName);
} else {
taskFormHandler = new DefaultTaskFormHandler();
}
taskFormHandler.parseConfiguration(taskElement, deployment, processDefinition, this);
TaskDefinition taskDefinition = new TaskDefinition(new DelegateTaskFormHandler(taskFormHandler, deployment));
taskDefinition.setKey(taskDefinitionKey);
processDefinition.getTaskDefinitions().put(taskDefinitionKey, taskDefinition);
String formKeyAttribute = taskElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, "formKey");
if (formKeyAttribute != null) {
taskDefinition.setFormKey(expressionManager.createExpression(formKeyAttribute));
}
String name = taskElement.attribute("name");
if (name != null) {
taskDefinition.setNameExpression(expressionManager.createExpression(name));
}
String descriptionStr = parseDocumentation(taskElement);
if (descriptionStr != null) {
taskDefinition.setDescriptionExpression(expressionManager.createExpression(descriptionStr));
}
parseHumanPerformer(taskElement, taskDefinition);
parsePotentialOwner(taskElement, taskDefinition);
// Activiti custom extension
parseUserTaskCustomExtensions(taskElement, taskDefinition);
return taskDefinition;
}
示例14: isServiceTaskLike
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected boolean isServiceTaskLike(Element element) {
return element.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, PROPERTYNAME_CLASS) != null
|| element.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, PROPERTYNAME_EXPRESSION) != null
|| element.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, PROPERTYNAME_DELEGATE_EXPRESSION) != null
|| element.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, TYPE) != null
|| hasConnector(element);
}
示例15: parseBinding
import org.camunda.bpm.engine.impl.util.xml.Element; //导入方法依赖的package包/类
protected void parseBinding(Element callActivityElement, ActivityImpl activity, BaseCallableElement callableElement, String bindingAttributeName) {
String binding = callActivityElement.attributeNS(CAMUNDA_BPMN_EXTENSIONS_NS, bindingAttributeName);
if (CallableElementBinding.DEPLOYMENT.getValue().equals(binding)) {
callableElement.setBinding(CallableElementBinding.DEPLOYMENT);
} else if (CallableElementBinding.LATEST.getValue().equals(binding)) {
callableElement.setBinding(CallableElementBinding.LATEST);
} else if (CallableElementBinding.VERSION.getValue().equals(binding)) {
callableElement.setBinding(CallableElementBinding.VERSION);
}
}