Search in sources :

Example 1 with IoMapping

use of org.camunda.bpm.engine.impl.core.variable.mapping.IoMapping in project camunda-bpm-platform by camunda.

the class BpmnParseUtil method parseInputOutput.

/**
 * Returns the {@link IoMapping} of an element.
 *
 * @param element the element to parse
 * @return the input output mapping or null if non defined
 * @throws BpmnParseException if a input/output parameter element is malformed
 */
public static IoMapping parseInputOutput(Element element) {
    Element inputOutputElement = element.elementNS(BpmnParse.CAMUNDA_BPMN_EXTENSIONS_NS, "inputOutput");
    if (inputOutputElement != null) {
        IoMapping ioMapping = new IoMapping();
        parseCamundaInputParameters(inputOutputElement, ioMapping);
        parseCamundaOutputParameters(inputOutputElement, ioMapping);
        return ioMapping;
    }
    return null;
}
Also used : IoMapping(org.camunda.bpm.engine.impl.core.variable.mapping.IoMapping) Element(org.camunda.bpm.engine.impl.util.xml.Element)

Example 2 with IoMapping

use of org.camunda.bpm.engine.impl.core.variable.mapping.IoMapping in project camunda-bpm-platform by camunda.

the class ConnectorParseListener method parseServiceTask.

@Override
public void parseServiceTask(Element serviceTaskElement, ScopeImpl scope, ActivityImpl activity) {
    Element connectorDefinition = findCamundaExtensionElement(serviceTaskElement, "connector");
    if (connectorDefinition != null) {
        Element connectorIdElement = connectorDefinition.element("connectorId");
        String connectorId = null;
        if (connectorIdElement != null) {
            connectorId = connectorIdElement.getText().trim();
        }
        if (connectorIdElement == null || connectorId.isEmpty()) {
            throw new BpmnParseException("No 'id' defined for connector.", connectorDefinition);
        }
        IoMapping ioMapping = parseInputOutput(connectorDefinition);
        activity.setActivityBehavior(new ServiceTaskConnectorActivityBehavior(connectorId, ioMapping));
    }
}
Also used : IoMapping(org.camunda.bpm.engine.impl.core.variable.mapping.IoMapping) BpmnParseException(org.camunda.bpm.engine.BpmnParseException) BpmnParseUtil.findCamundaExtensionElement(org.camunda.bpm.engine.impl.bpmn.parser.BpmnParseUtil.findCamundaExtensionElement) Element(org.camunda.bpm.engine.impl.util.xml.Element)

Aggregations

IoMapping (org.camunda.bpm.engine.impl.core.variable.mapping.IoMapping)2 Element (org.camunda.bpm.engine.impl.util.xml.Element)2 BpmnParseException (org.camunda.bpm.engine.BpmnParseException)1 BpmnParseUtil.findCamundaExtensionElement (org.camunda.bpm.engine.impl.bpmn.parser.BpmnParseUtil.findCamundaExtensionElement)1