public class AnalysisManager extends Object
MenuAreaButton
buttons in the
application tab menus that are connected to analysis procedures and management.
It is used by the Controller that delegates to this class the implementation of the actions
connected to these MenuAreaButton
buttons.
The Controller receives the user'choice by the relative listener and call the right method of this class.
MenuAreaButton
,
EventLogManagerController
Modifier and Type | Class and Description |
---|---|
(package private) class |
AnalysisManager.AlphabetSequenceGenerator
This class implements an alphabet sequence generator, extending
AbstractIterator . |
(package private) class |
AnalysisManager.ParserContentHandler
This inner class extends
DefaultHandler for creating
a specific content handler for the SAXParser object. |
(package private) class |
AnalysisManager.SchemaFactoryErrorHandler
This inner class implements
ErrorHandler for creating
a specific error handler for the SchemaFactory object. |
Modifier and Type | Field and Description |
---|---|
private EventLogManagerController |
elmController
The
EventLogManagerController element
that represents the Controller of the application
and that is the one that uses this analysis manager. |
private EventLogManagerModel |
elmModel
The
EventLogManagerModel element
that represents the Model of the application managed
by the Controller. |
private EventLogManagerView |
elmView
The
EventLogManagerView element
that represents the View of the application managed
by the Controller. |
Constructor and Description |
---|
AnalysisManager(EventLogManagerController elmController)
Constructs a new
AnalysisManager , with the EventLogManagerController
passed as parameter associated to it. |
Modifier and Type | Method and Description |
---|---|
void |
generateEventLog(String exp)
This method first generates a set of strings representing all the possible combination
of a set of elements, passed using an infix expression that defines the possible
structure of the generated strings.
|
boolean |
generateEventLogFootprint(boolean printMatrix,
EventLogEditor editor,
FootprintFilter... filter)
This method analyses the XES log contained inside the selected
EventLogEditor (or the passed one as parameter),
using the EventLogEditor filter (or the one passed as parameter), creating at the end of the process a HTML report
with a footprint matrix in it representing the casual dependencies between event traces. |
boolean |
generateXesFromCsv()
This method generates a XES log from a CSV document that is inside the selected
EventLogEditor . |
protected boolean |
parseCSV(String filePath,
String frameTitle)
This method manages the parsing process of the target file, from its
CSV content to the XES version, then from XES to the XML format to show
the generated content inside an
EventLogEditor . |
void |
setFootprintFilters(ActionListener listener)
This method gets the selected internal frame and, if it is an
EventLogEditor ,
it checks its FootprintFilter to ensure it is complete (and if it is not, the
method asks the user if it wants or not to update the filter). |
boolean |
validateEventLog()
Validates the content of the selected
EventLogEditor editor, that is inside
the contentArea ),
against the XES XSD Schema to check if it is a valid XES document. |
private EventLogManagerController elmController
EventLogManagerController
element
that represents the Controller of the application
and that is the one that uses this analysis manager.EventLogManagerController
private EventLogManagerView elmView
EventLogManagerView
element
that represents the View of the application managed
by the Controller.
We set this reference to the View managed by the Controller from the
getView()
method of the EventLogManagerController
.
EventLogManagerView
,
EventLogManagerController
private EventLogManagerModel elmModel
EventLogManagerModel
element
that represents the Model of the application managed
by the Controller.
We set this reference to the Model managed by the Controller from the
getModel()
method of the EventLogManagerController
.
EventLogManagerModel
public AnalysisManager(EventLogManagerController elmController)
AnalysisManager
, with the EventLogManagerController
passed as parameter associated to it.
The passed Controller is the one that uses this AnalysisManager
class. This class
uses this reference to the Controller to communicate with it, calling some of its methods.
This class is delegated by the Controller to implement some operations, for this reason it is able to call the View and the Model directly on behalf of the Controller to handle this operation correctly.
elmController
- the EventLogManagerController
object that represents the Controller and uses this AnalysisManager
EventLogManagerController
,
EventLogManagerView
,
EventLogManagerModel
public boolean validateEventLog()
EventLogEditor
editor, that is inside
the contentArea
),
against the XES XSD Schema to check if it is a valid XES document.
The method first checks if the editor is saved and the file associated to the editor
exists (otherwise it asks the user to save the editor content before continuing), then
start the validation process using the XES XSD Schema available online at
http://www.xes-standard.org/
, or a local copy if the Internet connection is
not available at that specific moment.
During the validation, the SAXParser
utilises the
ParserContentHandler
handler to log all the
validation warning or errors that may occur; at the end, the method will shows this log
to the user inside a dialog box.
The method is made for the EventLogEditor
frame. In case of using it with other
frame types, the method manages this situation with specifics information messages delivered
to the user.
The validation uses as default the XES XSD schema 2.2 version. To change this setting and set
where to find another version of the schema file to use (from offline and/or online sources),
modify the respective values inside the EventLogManagerModel
.
The user can modify these values at runtime from the application, using the Settings button.
true
if we successfully validate the file, false
otherwiseEventLogEditor
,
SAXParser
,
AnalysisManager.ParserContentHandler
public boolean generateEventLogFootprint(boolean printMatrix, EventLogEditor editor, FootprintFilter... filter)
EventLogEditor
(or the passed one as parameter),
using the EventLogEditor
filter (or the one passed as parameter), creating at the end of the process a HTML report
with a footprint matrix in it representing the casual dependencies between event traces.
The report will be eventually showed to the user using a FootprintMatrixInfo
, if asked by using the relative parameter.
If the editor filter is not complete while analysing the document, the process, instead of using that filter (because not complete), records all the needed information and updates the filter to make it complete for the next analysis.
The method first checks if the editor content is validated (and therefore saved) and the associated file still exists. If not, it
proceeds asking to validate the content (demanding the control to the validateEventLog()
) or to save it again (in case of the
file does not exists anymore, using the EditorManager.saveAsEventLog(String)
method of the EditorManager
).
If the editor content instead is saved and validated, the method checks if there is already a generated analysis report saved in the editor, and in that case it shows it instead of starting a new analysis (because if a report exists, is updated, otherwise it would not exists).
If an already generated analysis report does not exist, the method proceeds with the analysis as described above.
printMatrix
- true
to open a FootprintMatrixInfo
with the result of the analysis, false
to make the analysis and save the result, but without showing them to the usereditor
- the EventLogEditor
containing the XES log to analyse, null
to use the selected editor inside the applicationfilter
- the FootprintFilter
to use for the analysis, nothing (this is a optional parameter) to use the editor filter.true
if the process successfully generates a footprint matrix for the log, false
otherwise.EventLogEditor
,
FootprintFilter
,
EditorManager
,
FootprintMatrixInfo
public void setFootprintFilters(ActionListener listener)
EventLogEditor
,
it checks its FootprintFilter
to ensure it is complete (and if it is not, the
method asks the user if it wants or not to update the filter).
Then it asks the View to show a filters dialog associated with the editor. The dialog
content will be calculated based on the editor FootprintFilter
, to show to
the user the possible selections.
An ActionListener
will be associated to the dialog buttons
to implement the panel functions.
listener
- the ActionListener
listener that will be associated with the dialog buttonsEventLogEditor
,
FootprintFilter
,
ActionListener
public boolean generateXesFromCsv()
EventLogEditor
.
This method first checks if the selected frame is an EventLogEditor
,
then it calls the method parseCSV(String, String)
to implement the process.
At the end of the process, the system will show to the user the generated XES log inside a new editor.
true
if the process successfully generates a XES log from the CSV Document, false
otherwise.protected boolean parseCSV(String filePath, String frameTitle)
EventLogEditor
.
If some warnings are recorded during the parsing, the method will show a dialog with them to the user.
filePath
- the path of the file to parseframeTitle
- the title for the frame, usually it is the name of the file or the name of the editor inside the application where the content resides.true
if we successfully parse the file to XES and open an editor with its content in XML format, false
otherwise.EventLogEditor
public void generateEventLog(String exp)
The expression is composed by characters and strings for the definition of elements, the operator + to define the sum of two set of elements, the operator | to define the interleaving between two set of elements and spaces between all of these to define elements composed by multiple characters.
Here an example of a possible expression: a b c + ( ef g | 123 4 5). The element "ef" and the element "123" are a single block, while for example "4" and "5" are two different element of the same set, because they are divided by a space. Note that operators define also the division between different sets, as they are operation between them.
exp
- the expression in infix notation that defines the possible combination its elements, using the standard the standard defined above.