org.processmining.importing.owfn
Class oWFNImport

java.lang.Object
  extended by org.processmining.importing.owfn.oWFNImport
All Implemented Interfaces:
Plugin, ImportPlugin, LogReaderConnectionImportPlugin

public class oWFNImport
extends java.lang.Object
implements LogReaderConnectionImportPlugin

Title: oWFNImport

Description: Import an oWFN file. Result will be an oWFNet object.

Copyright: Copyright (c) 2004

Company:

Version:
1.0
Author:
Eric Verbeek

Constructor Summary
oWFNImport()
           
 
Method Summary
 java.lang.String deflate(java.io.InputStream input)
          Convert the given stream to a deflated string, where deflating means removing comments and white spaces.
 javax.swing.filechooser.FileFilter getFileFilter()
           
 java.lang.String getHtmlDescription()
          Gets a description of this plugin in HTML.
 java.lang.String getName()
          Gets the name of this plugin.
 PetriNetResult importFile(java.io.InputStream input)
          Interface for plugins that import from file.
 java.lang.String parseContents(java.lang.String contents, oWFNet petriNet)
           
 java.lang.String parseEdges(java.lang.String contents, oWFNet petriNet, Transition transition, boolean isInput)
          Read a list of weighted places, and store it as preset (isInput = true) or postset (isInpuyt = false) of the given transition in the given open WF net.
 java.lang.String parseMarking(java.lang.String contents, oWFNet petriNet)
          Read a list of weighted places, and ignore it.
 java.lang.String parsePlaces(java.lang.String contents, oWFNet petriNet, int mode)
          Read a list of places from the contents.
 java.lang.String parseToken(java.lang.String contents, java.lang.String token)
          Read the given token from the given contents, if possible.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

oWFNImport

public oWFNImport()
Method Detail

getName

public java.lang.String getName()
Description copied from interface: Plugin
Gets the name of this plugin. Implementing classes should use this method to return their own name.

Specified by:
getName in interface Plugin
Returns:
the name of this plugin

getFileFilter

public javax.swing.filechooser.FileFilter getFileFilter()
Specified by:
getFileFilter in interface ImportPlugin

importFile

public PetriNetResult importFile(java.io.InputStream input)
                          throws java.io.IOException
Description copied from interface: ImportPlugin
Interface for plugins that import from file.

Specified by:
importFile in interface ImportPlugin
Specified by:
importFile in interface LogReaderConnectionImportPlugin
Parameters:
input - The framework will always provide a ProMInputStream as the input parameter. To retrieve the filename use: ((ProMInputStream) input).getFilename();
Returns:
MiningResult A JComponent that is visualized in a frame. If null is returned then the framework thinks the call to this method was aborted.
Throws:
java.io.IOException - If an IO exception occurs.

parseContents

public java.lang.String parseContents(java.lang.String contents,
                                      oWFNet petriNet)
Parameters:
contents - String Deflated oWF net formatted string.
petriNet - oWFNet open WF net to hold the parsing results.
Returns:
String The unparsed end of contents.

parseToken

public java.lang.String parseToken(java.lang.String contents,
                                   java.lang.String token)
Read the given token from the given contents, if possible.

Parameters:
contents - String
token - String
Returns:
String The contents with the token removed, if possible. Otherwise, the contents.

parsePlaces

public java.lang.String parsePlaces(java.lang.String contents,
                                    oWFNet petriNet,
                                    int mode)
Read a list of places from the contents. Store the places in the given oWF net. Mode specifies whether the places are internal (0), input (1), or output (2).

Parameters:
contents - String
petriNet - oWFNet
mode - int
Returns:
String

parseMarking

public java.lang.String parseMarking(java.lang.String contents,
                                     oWFNet petriNet)
Read a list of weighted places, and ignore it.

Parameters:
contents - String
petriNet - oWFNet
Returns:
String

parseEdges

public java.lang.String parseEdges(java.lang.String contents,
                                   oWFNet petriNet,
                                   Transition transition,
                                   boolean isInput)
Read a list of weighted places, and store it as preset (isInput = true) or postset (isInpuyt = false) of the given transition in the given open WF net.

Parameters:
contents - String
petriNet - oWFNet
transition - Transition
isInput - boolean
Returns:
String

deflate

public java.lang.String deflate(java.io.InputStream input)
                         throws java.io.IOException
Convert the given stream to a deflated string, where deflating means removing comments and white spaces.

Parameters:
input - InputStream
Returns:
String
Throws:
java.io.IOException

getHtmlDescription

public java.lang.String getHtmlDescription()
Description copied from interface: Plugin
Gets a description of this plugin in HTML. The string returned by this method should only contain the contents of the body of the html page, so the html, head and body tags should not be used. This HTML page is displayed in the help system or as context sensitive help. The HTML body can be stored in an external file in the /lib/documentation/ sub folder and in this case it can be obtained by calling PluginDocumentationLoader.load(this)

Specified by:
getHtmlDescription in interface Plugin
Returns:
a description of this plugin in HTML