Search in sources :

Example 11 with Element

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);
}
Also used : Element(org.camunda.bpm.engine.impl.util.xml.Element)

Example 12 with Element

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);
            }
        }
    }
}
Also used : ParameterValueProvider(org.camunda.bpm.engine.impl.core.variable.mapping.value.ParameterValueProvider) Element(org.camunda.bpm.engine.impl.util.xml.Element)

Example 13 with Element

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;
}
Also used : Element(org.camunda.bpm.engine.impl.util.xml.Element)

Example 14 with Element

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);
    }
}
Also used : Element(org.camunda.bpm.engine.impl.util.xml.Element)

Example 15 with Element

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);
    }
}
Also used : Element(org.camunda.bpm.engine.impl.util.xml.Element)

Aggregations

Element (org.camunda.bpm.engine.impl.util.xml.Element)60 ArrayList (java.util.ArrayList)6 HashMap (java.util.HashMap)5 BpmnParseException (org.camunda.bpm.engine.BpmnParseException)4 ExecutableScript (org.camunda.bpm.engine.impl.scripting.ExecutableScript)4 ProcessDefinitionEntity (org.camunda.bpm.engine.impl.persistence.entity.ProcessDefinitionEntity)3 ProcessEngineXml (org.camunda.bpm.container.impl.metadata.spi.ProcessEngineXml)2 TaskListener (org.camunda.bpm.engine.delegate.TaskListener)2 Condition (org.camunda.bpm.engine.impl.Condition)2 IoMapping (org.camunda.bpm.engine.impl.core.variable.mapping.IoMapping)2 ParameterValueProvider (org.camunda.bpm.engine.impl.core.variable.mapping.value.ParameterValueProvider)2 ActivityBehavior (org.camunda.bpm.engine.impl.pvm.delegate.ActivityBehavior)2 ScriptCondition (org.camunda.bpm.engine.impl.scripting.ScriptCondition)2 ClassDelegateTaskListener (org.camunda.bpm.engine.impl.task.listener.ClassDelegateTaskListener)2 DelegateExpressionTaskListener (org.camunda.bpm.engine.impl.task.listener.DelegateExpressionTaskListener)2 ExpressionTaskListener (org.camunda.bpm.engine.impl.task.listener.ExpressionTaskListener)2 ScriptTaskListener (org.camunda.bpm.engine.impl.task.listener.ScriptTaskListener)2 LinkedHashMap (java.util.LinkedHashMap)1 TreeMap (java.util.TreeMap)1 ProcessArchiveXml (org.camunda.bpm.application.impl.metadata.spi.ProcessArchiveXml)1