PM4Py-WS Log Management

PM4Py-WS Log Management

This is responsible to manage the single logs, the visibility and the permissions of the users of the log.

The log management package is pm4pyws.log_manager . In the pm4pyws.log_manager.interface package, the interface to implement is provided.

A log manager should provide the following methods:

set_user_management(self)

Saves into the current log handler a reference to the object of the session handler (for the retrieval of users and sessions)

 

remove_unneeded_sessions(self)

Cleans the expired sessions

 

get_handlers(self)

A method that returns a dictionary with the process name associated to a log handler.

 

get_handler_for_process_and_session(self, process, session)

Gets the handler that could be associated to the given process and session having a particular filter chain.

Parameters:

process => Process (name) that we are interested to handle

session => Session ID that is accessing the handler

Returns:

The handler that could be associated to the given process and session having a particular filter chain.

 

set_handler_for_process_and_session(self, process, session, handlers)

Sets the handler that could be associated to the given process and session having a particular filter chain.

Parameters:

process => Process (name) that we are interested to handle

session => Session ID that is associated to the handler

 

check_is_admin(self, user)

A method that checks if the given user is an administrator of the tool.

Parameters:

user => User ID

Returns:

Boolean value

 

manage_upload(self, user, basename, filepath)

Manages the upload of a given process (having the path where the log file is) (only XES is supported in upload since now).

Entries are added to the database and moreover the log is loaded in memory.

Parameters:

user => User ID

basename => Name that is going to be associated to the process in the system/database

filepath => Path to the log file

 

check_user_log_visibility(self, user, process)

Checks the visibility of the user on the given process

Parameters:

user => User ID

process => Process name

Returns:

Boolean (True if the user has visibility on the given process)

 

check_user_enabled_upload(self, user)

Checks if the user could upload a log to the system.

Parameters:

user => User ID

process => Process name

Returns:

Boolean (True if the user could upload a log to the system)

 

check_user_enabled_download(self, user, process)

Checks if the user could download a log of the given process.

Parameters:

user => User ID

process => Process name

Returns:

Boolean (True if the user could download the given process)

 

load_log_static(self, log_name, file_path)

Loads a log file using the known handlers

Parameters:

log_name => Name that is associated to the process

file_path => Path where the log is

 

save_object_memory(self, key, value)

Saves an object into a dictionary (that is the memory of past objects)

Parameters:

key => Key

value => Value that should be stored referring to that key

 

get_object_memory(self, key)

Gets an object from the dictionary (that is the memory of past objects)

Parameters:

key => Key that should be returned

Returns:

object => Object that is stored in the dictionary

 

get_user_eventlog_vis_down_remov(self)

Gets the visibility, downloadability and removability of users on logs

Returns:

A list of three elements:

  • sorted_users => List of users in the system
  • sorted_logs => List of logs in the system
  • user_log_vis => Map which first key is the user, second key is the log, and value is the visibility of the user on the given log

 

add_user_eventlog_visibility(self, user, event_log)

Sets the visibility for an user to an event log

Parameters:

  • user => User (which visibility shall be changed)
  • event_log => Name of the log in the system

 

remove_user_eventlog_visibility(self, user, event_log)

Removes the visibility for an user to an event log

Parameters:

  • user => User (which visibility shall be changed)
  • event_log => Name of the log in the system

 

add_user_eventlog_downloadable(self, user, event_log)

Sets the permission to download an event log for an user

Parameters:

  • user => User (which permissions shall be changed)
  • event_log => Name of the log in the system

 

remove_user_eventlog_downloadable(self, user, event_log)

Removes the permission to download an event log for an user

Parameters:

  • user => User (which permissions shall be changed)
  • event_log => Name of the log in the system

 

add_user_eventlog_removable(self, user, event_log)

Sets the permission to remove an event log for an user

Parameters:

  • user => User (which permissions shall be changed)
  • event_log => Name of the log in the system

 

remove_user_eventlog_removable(self, user, event_log)

Removes the permission to remove an event log for an user

Parameters:

  • user => User (which permissions shall be changed)
  • event_log => Name of the log in the system

 

check_log_is_removable(self, log)

Checks if the log can be actually removed

Parameters:

log => Name of the log in the system

 

can_delete(self, user, log)

Checks if the user can actually remove the log

Parameters:

  • user => User that wants to delete the log
  • log => Name of the log in the system

 

delete_log(self, log)

Deletes the specified log

Parameters:

  • log => Name of the log in the system