use of org.camunda.bpm.engine.impl.util.xml.Element 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));
}
}
use of org.camunda.bpm.engine.impl.util.xml.Element in project camunda-bpm-platform by camunda.
the class BpmPlatformXmlParse method parseJobAcquisition.
/**
* parse a <code><job-acquisition .../></code> element and add it to the
* list of parsed elements
*/
protected void parseJobAcquisition(Element element, List<JobAcquisitionXml> jobAcquisitions) {
JobAcquisitionXmlImpl jobAcquisition = new JobAcquisitionXmlImpl();
// set name
jobAcquisition.setName(element.attribute(NAME));
Map<String, String> properties = new HashMap<String, String>();
for (Element childElement : element.elements()) {
if (JOB_EXECUTOR_CLASS_NAME.equals(childElement.getTagName())) {
jobAcquisition.setJobExecutorClassName(childElement.getText());
} else if (PROPERTIES.equals(childElement.getTagName())) {
parseProperties(childElement, properties);
}
}
// set collected properties
jobAcquisition.setProperties(properties);
// add to list
jobAcquisitions.add(jobAcquisition);
}
use of org.camunda.bpm.engine.impl.util.xml.Element in project camunda-bpm-platform by camunda.
the class BpmPlatformXmlParse method parseRootElement.
/**
* We know this is a <code><bpm-platform ../></code> element
*/
protected void parseRootElement() {
JobExecutorXmlImpl jobExecutor = new JobExecutorXmlImpl();
List<ProcessEngineXml> processEngines = new ArrayList<ProcessEngineXml>();
for (Element element : rootElement.elements()) {
if (JOB_EXECUTOR.equals(element.getTagName())) {
parseJobExecutor(element, jobExecutor);
} else if (PROCESS_ENGINE.equals(element.getTagName())) {
parseProcessEngine(element, processEngines);
}
}
bpmPlatformXml = new BpmPlatformXmlImpl(jobExecutor, processEngines);
}
use of org.camunda.bpm.engine.impl.util.xml.Element in project camunda-bpm-platform by camunda.
the class BpmPlatformXmlParse method parseJobExecutor.
/**
* parse a <code><job-executor .../></code> element and add it to the list of parsed elements
*/
protected void parseJobExecutor(Element element, JobExecutorXmlImpl jobExecutorXml) {
List<JobAcquisitionXml> jobAcquisitions = new ArrayList<JobAcquisitionXml>();
Map<String, String> properties = new HashMap<String, String>();
for (Element childElement : element.elements()) {
if (JOB_ACQUISITION.equals(childElement.getTagName())) {
parseJobAcquisition(childElement, jobAcquisitions);
} else if (PROPERTIES.equals(childElement.getTagName())) {
parseProperties(childElement, properties);
}
}
jobExecutorXml.setJobAcquisitions(jobAcquisitions);
jobExecutorXml.setProperties(properties);
}
use of org.camunda.bpm.engine.impl.util.xml.Element in project camunda-bpm-platform by camunda.
the class DeploymentMetadataParse method parseProperties.
/**
* Transform a
* <pre>
* <properties>
* <property name="name">value</property>
* </properties>
* </pre>
* structure into a properties {@link Map}
*
* Supports resolution of Ant-style placeholders against system properties.
*/
protected void parseProperties(Element element, Map<String, String> properties) {
for (Element childElement : element.elements()) {
if (PROPERTY.equals(childElement.getTagName())) {
String resolved = PropertyHelper.resolveProperty(System.getProperties(), childElement.getText());
properties.put(childElement.attribute(NAME), resolved);
}
}
}
Aggregations