protected <T extends BpmnModelElementInstance> T createChild(BpmnModelElementInstance parent, Class<T> typeClass) { T instance = createInstance(typeClass); parent.addChildElement(instance); return instance; }
protected <T extends BpmnModelElementInstance> T getCreateSingleChild(BpmnModelElementInstance parent, Class<T> typeClass) { Collection<T> childrenOfType = parent.getChildElementsByType(typeClass); if (childrenOfType.isEmpty()) { return createChild(parent, typeClass); } else { if (childrenOfType.size() > 1) { throw new BpmnModelException("Element " + parent + " of type " + parent.getElementType().getTypeName() + " has more than one child element of type " + typeClass.getName()); } else { return childrenOfType.iterator().next(); } } }
public boolean add(T t) { getDomElement().appendChild(t.getDomElement()); return true; }
public TransactionBuilder transactionDone() { BpmnModelElementInstance lastTransaction = element.getScope(); if (lastTransaction != null && lastTransaction instanceof Transaction) { return new TransactionBuilder(modelInstance, (Transaction) lastTransaction); } else { throw new BpmnModelException("Unable to find a parent transaction."); } }
String scopeElementId = null; if (scopeElement != null) { scopeElementId = scopeElement.getAttributeValue(BpmnConstants.ATTR_ID);
/** * Finishes the building of an embedded sub-process. * * @return the parent sub-process builder * @throws BpmnModelException if no parent sub-process can be found */ public SubProcessBuilder subProcessDone() { BpmnModelElementInstance lastSubProcess = element.getScope(); if (lastSubProcess != null && lastSubProcess instanceof SubProcess) { return ((SubProcess) lastSubProcess).builder(); } else { throw new BpmnModelException("Unable to find a parent subProcess."); } }
String scopeId = null; if (scopeElement != null) { scopeId = scopeElement.getAttributeValue(BpmnConstants.ATTR_ID);
protected <T extends BaseElement> T createChild(BpmnModelElementInstance parent, Class<T> typeClass, String identifier) { T instance = createInstance(typeClass, identifier); parent.addChildElement(instance); return instance; }
public boolean remove(Object o) { ModelUtil.ensureInstanceOf(o, BpmnModelElementInstance.class); return getDomElement().removeChild(((BpmnModelElementInstance) o).getDomElement()); }
protected <T extends BpmnModelElementInstance> T getCreateSingleChild(BpmnModelElementInstance parent, Class<T> typeClass) { Collection<T> childrenOfType = parent.getChildElementsByType(typeClass); if (childrenOfType.isEmpty()) { return createChild(parent, typeClass); } else { if (childrenOfType.size() > 1) { throw new BpmnModelException("Element " + parent + " of type " + parent.getElementType().getTypeName() + " has more than one child element of type " + typeClass.getName()); } else { return childrenOfType.iterator().next(); } } }
public TransactionBuilder transactionDone() { BpmnModelElementInstance lastTransaction = element.getScope(); if (lastTransaction != null && lastTransaction instanceof Transaction) { return new TransactionBuilder(modelInstance, (Transaction) lastTransaction); } else { throw new BpmnModelException("Unable to find a parent transaction."); } }
String scopeId = null; if (scopeElement != null) { scopeId = scopeElement.getAttributeValue(BpmnConstants.ATTR_ID);
public SubProcessBuilder addSubProcessTo(String parentId) { SubProcess eventSubProcess = modelInstance.newInstance(SubProcess.class); BpmnModelElementInstance parent = getModelElementById(parentId); parent.addChildElement(eventSubProcess); return eventSubProcess.builder(); }
public <T extends BpmnModelElementInstance> void setValue(T value) { removeValue(); getDomElement().appendChild(value.getDomElement()); }
protected <T extends BpmnModelElementInstance> T getCreateSingleChild(BpmnModelElementInstance parent, Class<T> typeClass) { Collection<T> childrenOfType = parent.getChildElementsByType(typeClass); if (childrenOfType.isEmpty()) { return createChild(parent, typeClass); } else { if (childrenOfType.size() > 1) { throw new BpmnModelException("Element " + parent + " of type " + parent.getElementType().getTypeName() + " has more than one child element of type " + typeClass.getName()); } else { return childrenOfType.iterator().next(); } } }
public TransactionBuilder transactionDone() { BpmnModelElementInstance lastTransaction = element.getScope(); if (lastTransaction != null && lastTransaction instanceof Transaction) { return new TransactionBuilder(modelInstance, (Transaction) lastTransaction); } else { throw new BpmnModelException("Unable to find a parent transaction."); } }
scopeElementId = scopeElement.getAttributeValue(BpmnConstants.ATTR_ID);