Import
Enables the BPMN import process within JointJS. Learn more about the BPMN import plugin.
Functionsβ
findExtensionElements()β
findExtensionElements(xmlElement: Element): Element[];
Finds all extension elements in the given XML element.
fromBPMN()β
fromBPMN(xmlDoc: XMLDocument, options: ImportOptions): ImportResult;
Imports BPMN XML document into JointJS shapes.
Typesβ
DecisiveElementsβ
type DecisiveElements =
'participant' |
'task' |
'serviceTask' |
'sendTask' |
'receiveTask' |
'userTask' |
'manualTask' |
'businessRuleTask' |
'scriptTask' |
'subProcess' |
'startEvent' |
'intermediateThrowEvent' |
'intermediateCatchEvent' |
'boundaryEvent' |
'endEvent' |
'gateway' |
'parallelGateway' |
'inclusiveGateway' |
'complexGateway' |
'eventBasedGateway' |
'exclusiveGateway' |
'sequenceFlow' |
'messageFlow' |
'dataObject' |
'textAnnotation' |
'association' |
'dataStoreReference' |
'line';
DefaultFactoryβ
type DefaultFactory = () => dia.Cell;
ImportOptionsβ
interface ImportOptions {
bpmn2Shapes: {
[name in ShapeName]: new (attributes?: any, opt?: any) => dia.Cell
};
cellFactories?: {
[element in DecisiveElements]?: (
xmlNode: Element,
xmlDoc: XMLDocument,
shapeClass: typeof dia.Cell,
defaultFactory: DefaultFactory
) => dia.Cell | null
};
embedCell?: (parent: dia.Cell, child: dia.Cell) => void;
useLegacyPool?: boolean;
convertXMLId?: (id: string) => void;
}
embedCell()β
Specify how to embed a child cell into a parent cell. By default, the child cell is added to the parent cell's embeds
attribute.
useLegacyPoolβ
Set to false
to use the new bpmn2.CompositePool
shape. Default is true
.
convertXMLId()β
Specify how to convert an XML id to a JointJS cell id. By default, the id_
prefix is removed from the XML id if it is present.
ImportResultβ
interface ImportResult {
cells: dia.Cell[];
errors: string[];
}
ShapeNameβ
type ShapeName =
'Activity' |
'Event' |
'Gateway' |
'DataObject' |
'DataAssociation' |
'Flow' |
'Annotation' |
'AnnotationLink' |
'Group' |
'HeaderedPool' |
'HeaderedHorizontalPool' |
'HeaderedVerticalPool' |
"HorizontalSwimlane" |
"VerticalSwimlane" |
'DataStore';
These shape names should correspond to the keys in the bpmn2Shapes
object in the ImportOptions
.