use of org.camunda.bpm.engine.impl.util.xml.Element in project camunda-bpm-platform by camunda.
the class BpmnParse method parseTimerStartEventDefinitionForEventSubprocess.
protected void parseTimerStartEventDefinitionForEventSubprocess(Element timerEventDefinition, ActivityImpl timerActivity, boolean interrupting) {
timerActivity.getProperties().set(BpmnProperties.TYPE, ActivityTypes.START_EVENT_TIMER);
TimerDeclarationImpl timerDeclaration = parseTimer(timerEventDefinition, timerActivity, TimerStartEventSubprocessJobHandler.TYPE);
timerDeclaration.setActivity(timerActivity);
timerDeclaration.setEventScopeActivityId(timerActivity.getEventScope().getId());
timerDeclaration.setRawJobHandlerConfiguration(timerActivity.getFlowScope().getId());
timerDeclaration.setInterruptingTimer(interrupting);
if (interrupting) {
Element timeCycleElement = timerEventDefinition.element("timeCycle");
if (timeCycleElement != null) {
addTimeCycleWarning(timeCycleElement, "interrupting start");
}
}
addTimerDeclaration(timerActivity.getEventScope(), timerDeclaration);
}
use of org.camunda.bpm.engine.impl.util.xml.Element in project camunda-bpm-platform by camunda.
the class BpmnParse method parseInputParameter.
protected void parseInputParameter(Element elementWithParameters, CallableElement callableElement) {
Element extensionsElement = elementWithParameters.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);
}
}
}
}
use of org.camunda.bpm.engine.impl.util.xml.Element in project camunda-bpm-platform by camunda.
the class BpmnParse method parseFieldDeclarations.
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;
}
use of org.camunda.bpm.engine.impl.util.xml.Element in project camunda-bpm-platform by camunda.
the class BpmnParse method parseBPMNPlane.
public void parseBPMNPlane(Element bpmnPlaneElement) {
String bpmnElement = bpmnPlaneElement.attribute("bpmnElement");
if (bpmnElement != null && !"".equals(bpmnElement)) {
// there seems to be only on process without collaboration
if (getProcessDefinition(bpmnElement) != null) {
getProcessDefinition(bpmnElement).setGraphicalNotationDefined(true);
}
List<Element> shapes = bpmnPlaneElement.elementsNS(BPMN_DI_NS, "BPMNShape");
for (Element shape : shapes) {
parseBPMNShape(shape);
}
List<Element> edges = bpmnPlaneElement.elementsNS(BPMN_DI_NS, "BPMNEdge");
for (Element edge : edges) {
parseBPMNEdge(edge);
}
} else {
addError("'bpmnElement' attribute is required on BPMNPlane ", bpmnPlaneElement);
}
}
use of org.camunda.bpm.engine.impl.util.xml.Element in project camunda-bpm-platform by camunda.
the class DefaultFailedJobParseListener method setFailedJobRetryTimeCycleValue.
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);
}
}
Aggregations