Dotted chart of business process

Business applications collect lot of information, but I have always feeling that these data are not used enough. Yes, we make reports and charts that answer questions and drive next questions and we make next reports and so we develop our knowledge and perception about existing rules.

I would like to share one more way how to represent and analyse data. I learned this method in Process Mining course in Coursera (https://www.coursera.org/course/procmin).

General idea is to use event log to make analysis of event frequency, sequence, etc. First thing that come to my mind hearing event log is Windows system event logs or log4j logs. Unfortunately mentioned logs are not always useful, especially for business analysis. Why? Because there are lot of unnecessary data and vice versa lot of information is missing. Its a paradox. Of course we can develop business applications that generate reasonable and usable event logs, but story is not about generation of new data. Story is about usage of existing data, that is collected over years. There have to be some value that is not discovered yet.

Here I will talk about event logs that are created from existing information and that contain following information:

– case – thing that is processed. It can be customer, agreement, patient, etc.

– action – activity that is performed in case. For example, agreement can be registered, approved, cancelled or renewed.

– employee – person who is doing activity

– timestamp – at which moment employee performed action

I will use ProM to make dotted chart of business process. ProM is process mining tool that you can freely download here. It is not the simplest and most user friendly tool in the world and mainly that is the reason why I write this article.

Lets assume that we have collected some event log in CSV format. Please, note that timestamp date format have to be exactly in format YYYY-MM-DDTHH24:MI:SS.

CASE;ACTIVITY;TIMESTAMP;EMPLOYEE
Agreement1;Registered;2012-01-01T08:09:00;John
Agreement1;Edited;2012-01-01T08:10:00;John
Agreement1;Signed;2012-01-01T08:11:00;David
Agreement2;Registered;2012-01-02T08:13:00;John
Agreement2;Signed;2012-01-02T08:14:00;David
Agreement3;Registered;2012-01-03T08:15:00;John
Agreement3;Edited;2012-01-03T08:17:00;John
Agreement3;Signed;2012-01-03T08:18:00;David
Agreement4;Registered;2012-01-04T08:20:00;John
Agreement4;Edited;2012-01-04T08:21:00;John
Agreement4;Signed;2012-01-04T08:22:00;David

Run ProM and use button “Import…” in the upper right corner, that will give you possibility to select CSV file and import it.

prom_import

As a result “Key/Value Set” have to appear in the middle of workspace.

prom_key_value_set

ProM automatically don’t recognize which of the CSV columns contain what information and we have to map them. Select “Key/Value Set” and press button “Play” that is in the middle right of workspace (third button in 4 button group). This will open list of actions that can be applied to inputs. You have to select action “Convert Key/Value Set to Log” and press “Start”.

prom_convert_to_log

This will open a screen where to map every CSV column to log attributes. You have to map it like this:

Trace identifier -> CASE
lifecycle:transition -> ACTION
org:resource -> EMPLOYEE
time:timestamp -> TIMESTAMP

prom_setup_mapping

Please, be careful – after you select last mapping you have to press to some other attribute otherwise your last selection will not be taken. For instance, you can press on attribute “org:role” when you have finished mapping. Press button “Continue” and dashboard appear where general log information is visible.

prom_log_dashboard

Press button “Inspector” on the left side, review loaded cases and make sure that all data is loaded. It is reasonable to use such case identification that you can later track information in source system. Because during event log analysis some questions will come up and you will want to analyse some cases in details.

 prom_inspector

Now press on “Two document” icon (first tab of top-middle section) and workspace will appear where new log can be found.

Now Dotted Chart will be made based on created log. Click on log and again press button “Play” that is in the middle right of workspace (third button in 4 button group).

prom_workspace_log

Again list of actions will be opened and we have to find “Analyze using Dotted Chart” typing “dot” in the search field.

prom_action_dotted_chart

Select action “Analyze using Dotted Chart” and press “Start” that will open dotted chart of event log.

prom_dotted_chart

In this case our sample log is very small and dotted chart analysis don’t show much reasonable information. But if log is bigger then dotted chart becomes much more interesting like shown in the next picture.

 prom_dotted_chart_real

Every dot in the chart is event, dots color is action type, every horizontal line is case and every vertical line is moment in time. Notice, that there are empty vertical lines that means no actions or less actions happen in these moments. In this case empty vertical lines means weekends or holidays.

Moreover it is visible that more events happen in the beginning of case and latter events are less. It is visible that density of events is less toward upper-right corner. Usually aim of business process analysis is to optimize processes meaning that process time or cost is reduced. Shorter process time means that customer is served faster and customer is more satisfied. Regarding this upper-right corner show cases that are processed more than 5 month and some detailed analysis have to be done. Pressing on each dot in dotted chart show details about event.

Dotted chart also have all kind of parameters on right side that can be used to browse and view data from many perspectives.

My screen is upside down

Just press Ctrl + Alt + <Arrow Up>.

Sometimes you accidentally press some key combination on the keyboard and your screen turns upside down. If your computer is turned upside down, now you can turn it back. 🙂

Windows 8 combination Ctrl + Alt + <Arrow Up>  restore screen back to normal position. I encourage you to try other combinations like Ctrl + Alt + <Arrow Left> and so on and play around this feature.

Actually I don’t know what is the purpose of this feature. I can imagine to use it when computer is connected to ceiling mounted projector and then your picture have to be turned upside down. But usually ceiling mounted projector picture have been already turned upside down in its settings and there is no need to turn monitor on computer.

Anyway, I had a little bit harder problem. After turning my monitor to normal position for some reason it turned on a side automatically after I switched to some application. I pressed Ctrl + Alt + <Arrow Up> and got screen back in correct position, but screen turned on one of the sides again after I opened or switched to some other application.

I have to mention that I worked on a notebook when I experienced this strange behaviour.

Finally I found out that Windows 8 screen resolution settings have property “Allow the screen to auto-rotate”. When this attribute is checked notebook acts like smart phone adapting screen orientation to phone position. I found out that turning notebook on one or another side screen automatically adapts to position. I checked out mentioned property and problem with rotation was gone. Unfortunately I have to admit that my HP ProBook orientation sensor works poorly.

Time to time it is useful to review application shortcuts. Please, find here Windows 8 short cuts: http://windows.microsoft.com/en-us/windows-8/keyboard-shortcuts.

See pictures below.

P.S. Surprise, surprise – just found out that Windows logo key + O locks and unlocks screen auto rotation!

rotated_screen_on_a_side

allow_screen_auto_rotate

autorotate on off

Ubuntu Edge project can save only miracle

I carefully follow Ubuntu Edge project that promise to develop best smart phone in the market. Ubuntu call it Formula One among smart phones.

I have collected data about crowd funding progress and you can visually see that only miracle can save this project. I think there are no hopes to collect $32 000 000 till 21st of August 2013.

Of course you can participate in this project and change the fate of this project! 🙂

ubuntu_edge_progress

expdp and ORA-39087: directory name is invalid

Short solution

expdp directory=<directory_name> dumpfile=<dump_file> logfile=<log_file> schemas=<schema>

Username: <username>
Password: <password>

Connected to: Oracle Database 11g Release ...
 ORA-39002: invalid operation
 ORA-39070: Unable to open the log file.
 ORA-39087: directory name <directory_name> is invalid

Possible reason of problem is that user <username> don’t recognize Oracle directory <directory_name>.

Connect to database using user <username> and perform SQL

SELECT * FROM all_directories WHERE direcotry_name = '<directory_name>'

Table all_directories contain all Oracle directories visible by <username>. If given SELECT don’t return record, then this is the reason of ORA-39087: direcotry name is invalid.

NB! Be sure that you use <directory_name> in uppercase in SELECT. Try also SELECT without WHERE clause and double check that really <directory_name> doesn’t exist.

If <direcotry_name> doesn’t exist, then use CREATE DIRECTORY statement to create it.

Further reading:  How to find path of Oracle directory (exp_dir, imp_dir)?

How to get HTML formatter in Notepad++

Short answer

You can have HTML formatter in Notepad++ installing Tidy2.

Select Plugins -> Plugin Manager -> Show Plugin Manager

Look for “Tidy2” in tab “Available” and install it.

You will find menu item Plugin -> Tidy2 -> Tidy (config 1) after plugin will be installed and you will restart Notepad++.

HTML before Tidy2

Notepad++_and_Tidy2_before

HTML after Tidy2. There is some garbage in head that have to be removed manually.

Notepad++_and_Tidy2_after

Thanks to JackArbiter here

Is Microsoft going to acquire Ubuntu?

I am surprised how different and freaky is Windows 8 comparing to other Windows. What is more striking, Windows 8 have stolen some Ubuntu ideas about desktop and main menu.

win8_search

ubuntu_search

And thats not all – Windows 8 share icon is similar to Ubuntu icon.

win8_share        ubuntu_icon

These Microsoft experiments proves my assumption that Microsoft use every second Windows release to experiment on us. That is the case right now with Windows 8 and that was the case also with Windows Vista.

Maybe Microsoft prepare us for something big. Imagine the future article title “Microsoft acquire Ubuntu and Windows become bigest Linux distro”.

Where is calculator in Windows 8?

Short comment

My first idea was to create script (bat file) that will  open calculator. Later I understood that I can find “calc.exe” (C:\Windows\System32\calc.exe) in file system and create shortcut on desktop.

But the correct answer is – put your mouse to the very upper-right corner and menu will appear. Select “Search” and write down “Calc” that will filter calculator. Of course, you will find also other applications there. You will find also “Command prompt” writting “cmd” in search.

 

Expdp and ORA-39070: Unable to open the log file

Short solution

expdp <username>/<password> directory=<exp_dir> dumpfile=<dumpfilename>.dmp logfile=<logfilename>_<yyyymmdd>.log schemas=<schematoexport> include=table,index

gives error:

ORA-39002: invalid operation
ORA-39070: Unable to open the log file.
ORA-29283: invalid file operation
ORA-06512: at "SYS.UTL_FILE", line 536
ORA-29283: invalid file operation

I know three possibilities that can cause problem:
1) <exp_dir> is not existing. Use SELECT * FROM dba_directories to check available Oracle directories and paths.
2) Oracle service is launched under system user that don’t have access to Oracle directory path. Oracle don’t check the existence and access rights when Oracle directory is created. You have to log in to DB server with Oracle service user and check are you able access path in file system.
3) If Oracle is installed on Windows and path contains mapped network drive then Oracle don’t recognize it and gives this error. You have to use full path to the folder. For example: \\server\share.

Further reading:

https://janiskempe.wordpress.com/2013/05/12/impdp-and-ora-01950-no-privileges-on-tablespace/

https://janiskempe.wordpress.com/2013/05/24/how-to-find-path-of-oracle-directory-exp_dir-imp_dir/

How to find path of Oracle directory (exp_dir, imp_dir)?

Short answer

All directories that are defined in Oracle 11g can be selected by view DBA_DIRECTORIES. You will need rights to access this view.

SELECT * FROM dba_directories;

Directories accessible to current user can be selected by view ALL_DIRECTORIES.

SELECT * FROM all_directories;

Further reading:
http://docs.oracle.com/cd/E11882_01/timesten.112/e21644/systemtables.htm

Longer comment

I believe that Oracle directories have wide usage, but I have used them only for Oralce Data Pump to export (expdp) and/or import data (impdp).

Oracle directory can have any name that fits to Oracle object naming rules – no specific system words and no longer than 30 bytes. Actually, I can’t understand why Oracle object name can’t be longer than 30 bytes. It is year 2013, isn’t it?

CREATE DIRECTORY <directory_name> AS '<path>';

Oracle will not check existance and access rights to <path> during Oracle directory creation. You also  have to be sure that system user under which Oracle database service is running, have access to <path>. If your Oracle installed on Windows Server then mapped network drives can’t be used in <path>.

Further reading:

https://janiskempe.wordpress.com/2013/05/12/impdp-and-ora-01950-no-privileges-on-tablespace/

http://docs.oracle.com/cd/E11882_01/server.112/e26088/statements_5007.htm#SQLRF01207