org.processmining.plugins.pnml
Class Pnml

java.lang.Object
  extended by org.processmining.plugins.pnml.PnmlElement
      extended by org.processmining.plugins.pnml.Pnml

public class Pnml
extends PnmlElement

Basic (E)PNML object. Allows import, export, and conversion to a Petri net.

Author:
hverbeek

Nested Class Summary
static class Pnml.PnmlType
          Type of PNML: either PNML or EPNML.
 
Field Summary
static int PHASE_ARCS
           
static int PHASE_DEREFNODES
           
static int PHASE_NODES
           
static int PHASE_REFNODES
           
static java.lang.String TAG
          PNML tag.
 
Fields inherited from class org.processmining.plugins.pnml.PnmlElement
lineNumber, tag
 
Constructor Summary
Pnml()
          Creates a fresh default PNML object, that is, a PNML object of type PNML.
Pnml(Pnml.PnmlType type)
          Creates a fresh PNML object, given the type.
 
Method Summary
 Pnml convertFromNet(java.util.Map<PetrinetGraph,Marking> markedNets, org.processmining.models.connections.GraphLayoutConnection layout)
           
 Pnml convertFromNet(PetrinetGraph net, Marking marking, org.processmining.models.connections.GraphLayoutConnection layout)
           
 Pnml convertFromNet(PetrinetGraph net, Marking marking, java.util.Map<java.lang.String,org.processmining.models.graphbased.AbstractGraphElement> idMap, org.processmining.models.connections.GraphLayoutConnection layout)
           
 void convertToNet(PetrinetGraph net, Marking marking, org.processmining.models.connections.GraphLayoutConnection layout)
          Converts the PNML object to a Petri net and initial marking.
protected  java.lang.String exportElements(Pnml pnml)
          Exports the child elements to String.
 java.lang.String getLabel()
           
 org.deckfour.xes.model.XLog getLog()
           
 Pnml.PnmlType getType()
          Gets the type.
 boolean hasErrors()
           
 boolean hasModule()
           
protected  boolean importElements(org.xmlpull.v1.XmlPullParser xpp, Pnml pnml)
          Checks whether the current start tag is known.
 void log(java.lang.String context, int lineNumber, java.lang.String message)
          Adds a log event to the current trace in the log.
 void logNet(java.lang.String name)
          Adds a new trace with the given name to the log.
 void setLayout(PetrinetGraph net, org.processmining.models.connections.GraphLayoutConnection layout)
           
 void setType(Pnml.PnmlType type)
          Set the type of this PNML object.
 
Methods inherited from class org.processmining.plugins.pnml.PnmlElement
checkValidity, exportAttribute, exportAttributes, exportElement, importAttributes, importElement, importText
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TAG

public static final java.lang.String TAG
PNML tag.

See Also:
Constant Field Values

PHASE_NODES

public static final int PHASE_NODES
See Also:
Constant Field Values

PHASE_DEREFNODES

public static final int PHASE_DEREFNODES
See Also:
Constant Field Values

PHASE_REFNODES

public static final int PHASE_REFNODES
See Also:
Constant Field Values

PHASE_ARCS

public static final int PHASE_ARCS
See Also:
Constant Field Values
Constructor Detail

Pnml

public Pnml(Pnml.PnmlType type)
Creates a fresh PNML object, given the type.

Parameters:
type - Either PNML or EPNML.

Pnml

public Pnml()
Creates a fresh default PNML object, that is, a PNML object of type PNML.

Method Detail

hasModule

public boolean hasModule()

getLog

public org.deckfour.xes.model.XLog getLog()

log

public void log(java.lang.String context,
                int lineNumber,
                java.lang.String message)
Adds a log event to the current trace in the log.

Parameters:
context - Context of the message, typically the current PNML tag.
lineNumber - Current line number.
message - Error message.

logNet

public void logNet(java.lang.String name)
Adds a new trace with the given name to the log. This trace is now current.

Parameters:
name - The give name.

hasErrors

public boolean hasErrors()

setType

public void setType(Pnml.PnmlType type)
Set the type of this PNML object.

Parameters:
type - Either PNML or EPNML.

getType

public Pnml.PnmlType getType()
Gets the type.

Returns:
Either PNML or EPNML.

importElements

protected boolean importElements(org.xmlpull.v1.XmlPullParser xpp,
                                 Pnml pnml)
Checks whether the current start tag is known. If known, it imports the corresponding child element and returns true. Otherwise, it returns false.

Overrides:
importElements in class PnmlElement
Returns:
Whether the start tag was known.

exportElements

protected java.lang.String exportElements(Pnml pnml)
Exports the child elements to String.

Overrides:
exportElements in class PnmlElement
Returns:

convertToNet

public void convertToNet(PetrinetGraph net,
                         Marking marking,
                         org.processmining.models.connections.GraphLayoutConnection layout)
Converts the PNML object to a Petri net and initial marking.

Parameters:
net - Where to store the Petri net in (should be a fresh net).
marking - Where to store the initial marking in (should be a fresh marking).

setLayout

public void setLayout(PetrinetGraph net,
                      org.processmining.models.connections.GraphLayoutConnection layout)

getLabel

public java.lang.String getLabel()

convertFromNet

public Pnml convertFromNet(java.util.Map<PetrinetGraph,Marking> markedNets,
                           org.processmining.models.connections.GraphLayoutConnection layout)

convertFromNet

public Pnml convertFromNet(PetrinetGraph net,
                           Marking marking,
                           org.processmining.models.connections.GraphLayoutConnection layout)

convertFromNet

public Pnml convertFromNet(PetrinetGraph net,
                           Marking marking,
                           java.util.Map<java.lang.String,org.processmining.models.graphbased.AbstractGraphElement> idMap,
                           org.processmining.models.connections.GraphLayoutConnection layout)