public abstract class BPMN2Parser extends Object implements IProcessModelParser
Modifier and Type | Field and Description |
---|---|
protected Map<Integer,String> |
elementIdMap
Vertice index to label map
|
protected Map<String,Integer> |
elementMap
Activity id to vertex index map
|
protected Map<String,Integer> |
errorHandlerMap
processVertice|subProcessVertice|errorCode to vertice index map for error
handlers
|
protected Map<Integer,EventAction> |
eventActionMap
Vertice index to event action map
|
protected Map<Integer,EventType> |
eventTypeMap
Vertice index to event type map
|
protected Map<Integer,GatewayType> |
gatewayMap
Vertice index to gateway type map
|
protected Graph |
graph
Process graph
|
protected Map<Integer,Integer[]> |
subProcessStartMap
Vertice index to sub process start nodes map
|
protected Set<String> |
tasks
Set of all tasks
|
Constructor and Description |
---|
BPMN2Parser()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
Integer[] |
getAllStartEventIndexes()
Returns start event indexes for the model
|
Collaboration[] |
getCollaborations()
Returns all collaborations between elements in the process model
|
protected List<org.jdom2.Document> |
getDocuments() |
double |
getEdgeProbability(String edgeId)
Returns branching probability for an edge
|
String |
getElementSimpleName(Integer verticeIndex)
Returns a simple (human-friendly) name for element
|
int |
getErrorHandlerActivity(int processIndex,
int subProcessIndex,
String errorCode)
Returns index of error handler event
|
EventAction |
getEventAction(Integer vertex)
Returns action/trigger for event
|
EventType |
getEventType(Integer vertex)
Returns type of the event for element
|
Graph |
getGraph()
Returns process graph
|
String |
getModelElementId(Integer verticeIndex)
Returns id from the model for a vertice index
|
Integer |
getParentBoundaryActivity(Integer boundaryEventIndex)
Returns index of activity to which the boundary event is assigned
|
String |
getProcessId(Integer verticeIndex)
Returns process id for given element
|
protected Map<String,org.jdom2.Element> |
getProcessRootElements() |
Integer[] |
getStartEventIndexesForMainProcess()
Returns start event indexes for the main process id (to be enabled when
simulation is started
|
Integer[] |
getSubProcessStartActivityIndexes(Integer verticeIndex)
Returns indexes of start events for sub-process
|
protected void |
initGraph()
Initializes graph and detects collaborations
|
boolean |
isChoice(Integer verticeIndex)
Returns if element is XOR gateway
|
boolean |
isEventGateway(Integer verticeIndex)
Returns if element is event based gateway
|
boolean |
isInterruptingEvent(Integer verticeIndex)
Returns if given event is an interrupting event
|
protected static boolean |
isKnownElement(String name)
Returns true if element is know.
|
boolean |
isOR(Integer verticeIndex)
Returns if element is an OR gateway
|
boolean |
isParallel(Integer verticeIndex)
Returns if element is parallel gateway
|
boolean |
isSubProcess(Integer verticeIndex)
Returns if element is a sub-process
|
boolean |
isTask(String name)
Returns if element is a task
|
protected void |
loadDocuments() |
void |
parse()
Parse the model
|
protected void |
processAllCallActivities()
Processes all callActivity elements and associates starts events with it
|
protected void |
processElement(org.jdom2.Element el,
Integer fromVertice,
String processId)
Processes a node in the mode and creates entry in the process graph.
|
protected void |
processElement(String id,
org.jdom2.Element elem)
Meant to be overridden by child classes for additional known element parsing
|
void |
setFiles(List<String> fileNames)
Set input file names to parse
|
void |
setInputStreams(List<InputStream> inputStreams)
Set input streams to parse
|
protected boolean |
simulateSubProcessAsTask(String subProcessId) |
protected static String |
uniqueId(String processId,
String elementId) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAllResources, getArrivalRateDistributionInfo, getArrivalRateTimeTable, getElementCostThreshold, getElementDurationInformation, getElementDurationThreshold, getElementFixedCost, getFirstProcessInstanceForStats, getLastProcessInstanceForStats, getStartTime, getTaskResourceId, getTotalProcessInstances, isApplicable
protected Graph graph
protected Map<Integer,GatewayType> gatewayMap
protected Map<Integer,EventAction> eventActionMap
protected Map<Integer,Integer[]> subProcessStartMap
protected Map<String,Integer> errorHandlerMap
public void setInputStreams(List<InputStream> inputStreams)
setInputStreams
in interface IProcessModelParser
inputStreams
- list of input streams to parsepublic void setFiles(List<String> fileNames)
setFiles
in interface IProcessModelParser
fileNames
- list of file names to parsepublic void parse() throws ModelParseException, ProcessValidationException
IProcessModelParser
parse
in interface IProcessModelParser
ProcessValidationException
ModelParseException
protected void loadDocuments() throws ModelParseException
ModelParseException
protected void initGraph() throws ProcessValidationException
ProcessValidationException
protected static boolean isKnownElement(String name)
name
- element nameprotected void processElement(org.jdom2.Element el, Integer fromVertice, String processId) throws ProcessValidationException
ProcessValidationException
protected void processAllCallActivities() throws ProcessValidationException
ProcessValidationException
protected void processElement(String id, org.jdom2.Element elem) throws ProcessValidationException
id
- internal id of the elementelem
- Element node to processProcessValidationException
public Integer[] getAllStartEventIndexes()
getAllStartEventIndexes
in interface IProcessModelParser
public Integer[] getStartEventIndexesForMainProcess() throws ProcessValidationException
getStartEventIndexesForMainProcess
in interface IProcessModelParser
ProcessValidationException
- if main process cannot be determinedpublic String getElementSimpleName(Integer verticeIndex)
getElementSimpleName
in interface IProcessModelParser
verticeIndex
- index of elementpublic String getProcessId(Integer verticeIndex)
getProcessId
in interface IProcessModelParser
verticeIndex
- index of elementpublic Collaboration[] getCollaborations()
getCollaborations
in interface IProcessModelParser
public boolean isInterruptingEvent(Integer verticeIndex)
isInterruptingEvent
in interface IProcessModelParser
verticeIndex
- index of an eventpublic Integer getParentBoundaryActivity(Integer boundaryEventIndex)
getParentBoundaryActivity
in interface IProcessModelParser
boundaryEventIndex
- index of a boundary eventpublic double getEdgeProbability(String edgeId) throws ProcessValidationException
IProcessModelParser
getEdgeProbability
in interface IProcessModelParser
edgeId
- edge id from the modeProcessValidationException
public String getModelElementId(Integer verticeIndex)
IProcessModelParser
getModelElementId
in interface IProcessModelParser
verticeIndex
- element index from process graphpublic boolean isParallel(Integer verticeIndex)
IProcessModelParser
isParallel
in interface IProcessModelParser
verticeIndex
- element index from process graphpublic boolean isChoice(Integer verticeIndex)
IProcessModelParser
isChoice
in interface IProcessModelParser
public boolean isEventGateway(Integer verticeIndex)
IProcessModelParser
isEventGateway
in interface IProcessModelParser
public Graph getGraph()
IProcessModelParser
getGraph
in interface IProcessModelParser
public boolean isTask(String name)
IProcessModelParser
isTask
in interface IProcessModelParser
name
- name of the taskpublic EventType getEventType(Integer vertex)
IProcessModelParser
getEventType
in interface IProcessModelParser
vertex
- element indexpublic EventAction getEventAction(Integer vertex)
IProcessModelParser
getEventAction
in interface IProcessModelParser
vertex
- element indexpublic Integer[] getSubProcessStartActivityIndexes(Integer verticeIndex)
IProcessModelParser
getSubProcessStartActivityIndexes
in interface IProcessModelParser
verticeIndex
- index of sub-process activitypublic int getErrorHandlerActivity(int processIndex, int subProcessIndex, String errorCode)
IProcessModelParser
getErrorHandlerActivity
in interface IProcessModelParser
processIndex
- index of parent processsubProcessIndex
- index of sub-processerrorCode
- event code to handlepublic boolean isSubProcess(Integer verticeIndex)
IProcessModelParser
isSubProcess
in interface IProcessModelParser
verticeIndex
- index of elementpublic boolean isOR(Integer verticeIndex)
IProcessModelParser
isOR
in interface IProcessModelParser
verticeIndex
- index of an elementprotected List<org.jdom2.Document> getDocuments()
protected boolean simulateSubProcessAsTask(String subProcessId)
Copyright © 2020 Pivotal Software, Inc.. All rights reserved.