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.