Package jadex.bpmn.model.io
Class SBpmnModelReader
java.lang.Object
jadex.bpmn.model.io.SBpmnModelReader
-
Field Summary
FieldsModifier and TypeFieldDescriptionActivity type mapping.static final String
Key for alternative visual object bounds.static final String
Key for visual object bounds.static final String
Key for visual internalized parameters.Tag aliases.static final String
Key for alternative visual object bounds. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected static final void
connectActivityEdges
(MActivity act, Map<String, Object> buffer, Map<String, MIdElement> emap) Connects activity edges.protected static final void
handleElement
(MBpmnModel model, Map<String, MIdElement> emap, Map<String, MLane> lanemap, Map<String, String> laneparents, XmlTag tag, LinkedList<XmlTag> tagstack, Map<String, String> attrs, String content, Map<String, Object> buffer, List<Runnable> sempostprocesstasks, IBpmnVisualModelReader vreader) Handles XML elements.protected static final void
handleJadexElement
(MBpmnModel model, XmlTag tag, LinkedList<XmlTag> tagstack, Map<String, String> attrs, String content, Map<String, Object> buffer, Map<String, MIdElement> emap) Handles a Jadex model extension.protected static final void
handlePool
(MBpmnModel model, Map<String, String> attrs, Map<String, MIdElement> emap, Map<String, Object> buffer) Handles a pool.protected static final void
handleSemanticElement
(MBpmnModel model, Map<String, MIdElement> emap, Map<String, MLane> lanemap, Map<String, String> laneparents, XmlTag tag, LinkedList<XmlTag> tagstack, Map<String, String> attrs, String content, Map<String, Object> buffer, List<Runnable> postprocesstasks) Handles a semantic section.protected static final void
handleVisualElement
(IBpmnVisualModelReader vreader, XmlTag tag, Map<String, String> attrs, String content, Map<String, String> laneparents, Map<String, MIdElement> emap, Map<String, Object> buffer) Handles a visual element.protected static final void
insertActivity
(MActivity act, Map<String, Object> buffer, Map<String, MLane> lanemap, Map<String, MIdElement> emap) Inserts an activity into the model and maps.protected static final boolean
Matches local part of the tag.protected static final jadex.common.UnparsedExpression
parseExp
(jadex.common.UnparsedExpression exp, String[] imports, ClassLoader cl) Parses the expression if possible.static final MBpmnModel
readModel
(File file, IBpmnVisualModelReader vreader) Loads the model from a file without parsing expressions.static final MBpmnModel
readModel
(InputStream in, String filename, IBpmnVisualModelReader vreader) Loads the model from a file without parsing expressions.static final MBpmnModel
readModel
(InputStream in, String filename, IBpmnVisualModelReader vreader, ClassLoader cl) Loads the model from a file.
-
Field Details
-
BOUNDS_KEY
Key for visual object bounds.- See Also:
-
ALT_BOUNDS_KEY
Key for alternative visual object bounds.- See Also:
-
WAYPOINTS_KEY
Key for alternative visual object bounds.- See Also:
-
INTERNAL_PARAMETERS_KEY
Key for visual internalized parameters.- See Also:
-
TAG_ALIASES
Tag aliases. -
ACT_TYPE_MAPPING
Activity type mapping.
-
-
Constructor Details
-
SBpmnModelReader
public SBpmnModelReader()
-
-
Method Details
-
readModel
public static final MBpmnModel readModel(File file, IBpmnVisualModelReader vreader) throws Exception Loads the model from a file without parsing expressions.- Parameters:
file
- The model file.vreader
- The visual model reader, may be null.- Throws:
Exception
-
readModel
public static final MBpmnModel readModel(InputStream in, String filename, IBpmnVisualModelReader vreader) throws Exception Loads the model from a file without parsing expressions.- Parameters:
vreader
- The visual model reader, may be null.file
- The model file.- Throws:
Exception
-
readModel
public static final MBpmnModel readModel(InputStream in, String filename, IBpmnVisualModelReader vreader, ClassLoader cl) throws Exception Loads the model from a file.- Parameters:
vreader
- The visual model reader, may be null.cl
- The class loader for parsing expressions, may be null.file
- The model file.- Throws:
Exception
-
handlePool
protected static final void handlePool(MBpmnModel model, Map<String, String> attrs, Map<String, MIdElement> emap, Map<String, Object> buffer) Handles a pool.- Parameters:
model
- The model.attrs
- Current attributes.buffer
- Buffered information.lastobject
- The last object.tag
- The current tag.tagstack
- The tag stack.content
- The tag content.
-
handleElement
protected static final void handleElement(MBpmnModel model, Map<String, MIdElement> emap, Map<String, MLane> lanemap, Map<String, String> laneparents, XmlTag tag, LinkedList<XmlTag> tagstack, Map<String, String> attrs, String content, Map<String, Object> buffer, List<Runnable> sempostprocesstasks, IBpmnVisualModelReader vreader) Handles XML elements. -
handleSemanticElement
protected static final void handleSemanticElement(MBpmnModel model, Map<String, MIdElement> emap, Map<String, MLane> lanemap, Map<String, String> laneparents, XmlTag tag, LinkedList<XmlTag> tagstack, Map<String, String> attrs, String content, Map<String, Object> buffer, List<Runnable> postprocesstasks) Handles a semantic section.- Parameters:
model
- The model.tag
- The current tag.tagstack
- The tag stack.attrs
- Current attributes.content
- The tag content.buffer
- Buffered information.lastobject
- The last object.
-
handleJadexElement
protected static final void handleJadexElement(MBpmnModel model, XmlTag tag, LinkedList<XmlTag> tagstack, Map<String, String> attrs, String content, Map<String, Object> buffer, Map<String, MIdElement> emap) Handles a Jadex model extension.- Parameters:
model
- The model.tag
- The current tag.tagstack
- The tag stack.attrs
- Current attributes.content
- The tag content.buffer
- Buffered information.lastobject
- The last object.
-
handleVisualElement
protected static final void handleVisualElement(IBpmnVisualModelReader vreader, XmlTag tag, Map<String, String> attrs, String content, Map<String, String> laneparents, Map<String, MIdElement> emap, Map<String, Object> buffer) Handles a visual element.- Parameters:
vreader
- The visual reader.tag
- The XML tag.attrs
- The XML attributes.emap
- The element map.buffer
- The buffer.
-
insertActivity
protected static final void insertActivity(MActivity act, Map<String, Object> buffer, Map<String, MLane> lanemap, Map<String, MIdElement> emap) Inserts an activity into the model and maps.- Parameters:
act
- The activity.buffer
- The buffer.lanemap
- The lane map.emap
- The element map.
-
connectActivityEdges
protected static final void connectActivityEdges(MActivity act, Map<String, Object> buffer, Map<String, MIdElement> emap) Connects activity edges. -
parseExp
protected static final jadex.common.UnparsedExpression parseExp(jadex.common.UnparsedExpression exp, String[] imports, ClassLoader cl) Parses the expression if possible.- Parameters:
exp
- The expression.imports
- The imports.cl
- The class loader.- Returns:
- Parsed expression or unparsed if class loader is unavailable.
-
matchLTag
Matches local part of the tag. TODO: Do this for all tags.
-