Skip to content

Commit

Permalink
update activty string to include all relevant details for each action…
Browse files Browse the repository at this point in the history
… event
  • Loading branch information
KrishPatel13 committed Jul 21, 2024
1 parent 8c3be28 commit 7bf3698
Show file tree
Hide file tree
Showing 7 changed files with 4,002 additions and 496 deletions.
484 changes: 242 additions & 242 deletions openadapt/process-graph/dataout.csv

Large diffs are not rendered by default.

3,504 changes: 3,504 additions & 0 deletions openadapt/process-graph/output/tmpkbsu9k18.html

Large diffs are not rendered by default.

Large diffs are not rendered by default.

206 changes: 206 additions & 0 deletions openadapt/process-graph/output/tmpkbsu9k18_files/viz.js.download

Large diffs are not rendered by default.

33 changes: 22 additions & 11 deletions openadapt/process-graph/process-query.sql
Original file line number Diff line number Diff line change
@@ -1,11 +1,22 @@
select r.id as case_id,
we.title as activity,
-- ae."timestamp" as timestamp,
datetime(ae."timestamp", 'unixepoch', 'localtime') AS "timestamp",
COALESCE(ae."timestamp" - LAG(ae."timestamp") OVER (ORDER BY ae."timestamp"), 0) as costs,
ae.name as resource
from recording r
inner join action_event ae on r."timestamp" = ae.recording_timestamp
inner join window_event we on r."timestamp" = we.recording_timestamp and we."timestamp" = ae.window_event_timestamp
where r.id = 1
order by r.id, ae."timestamp";
SELECT
R.ID AS "case_id",
'Title: ' || WE.TITLE || ', Action: ' || AE.NAME || ', Action_Target: ' ||
CASE
WHEN AE.NAME = 'scroll' THEN '(' || AE.mouse_dx || ',' || AE.mouse_dy || ')'
WHEN AE.NAME = 'move' THEN '(' || AE.mouse_x || ',' || AE.mouse_y || ')'
WHEN AE.NAME = 'click' THEN AE.mouse_button_name
WHEN AE.NAME IN ('press', 'release') THEN AE.CANONICAL_KEY_NAME
ELSE 'N/A'
END AS "activity",
DATETIME(AE."timestamp", 'unixepoch', 'localtime') AS "timestamp",
COALESCE(AE."timestamp" - LAG(AE."timestamp") OVER (ORDER BY AE."timestamp"), 0) AS "costs",
AE.NAME AS "resource"
FROM
RECORDING R
INNER JOIN ACTION_EVENT AE ON R."timestamp" = AE.RECORDING_TIMESTAMP
INNER JOIN WINDOW_EVENT WE ON R."timestamp" = WE.RECORDING_TIMESTAMP AND WE."timestamp" = AE.WINDOW_EVENT_TIMESTAMP
WHERE
R.ID = 1
ORDER BY
R.ID,
AE."timestamp";
3 changes: 3 additions & 0 deletions openadapt/process-graph/process_graph_generation_example.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
"""Example of process graph generation using PM4Py library."""

import pm4py
import pandas


if __name__ == "__main__":
log = pandas.read_csv("dataout.csv", sep=",")
log = pm4py.format_dataframe(
Expand Down
266 changes: 23 additions & 243 deletions openadapt/process-graph/test_file.txt

Large diffs are not rendered by default.

0 comments on commit 7bf3698

Please sign in to comment.