Skip to content

Commit f4b8a99

Browse files
committed
Merge branch '336-pql-interpreter-view' into 'master'
feat: redesign the PQL interpreter view for better user experience See merge request processm-team/processm!344 Former-commit-id: 1f788738da853d6a27a23927c3137e1319cea06e
2 parents afd835e + 97f64ab commit f4b8a99

11 files changed

Lines changed: 147 additions & 48 deletions

File tree

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
</modules>
4646

4747
<properties>
48-
<revision>0.7.1${revision.suffix}</revision>
48+
<revision>0.7.2${revision.suffix}</revision>
4949
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
5050
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
5151
<kotlin.version>1.8.22</kotlin.version>

processm.core/src/test/kotlin/processm/core/log/hierarchical/DBHierarchicalXESInputStreamWithQueryTests.kt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package processm.core.log.hierarchical
22

3+
import org.junit.platform.commons.util.Preconditions.condition
34
import processm.core.DBTestHelper.dbName
45
import processm.core.log.attribute.Attribute.CONCEPT_NAME
56
import processm.core.log.attribute.AttributeMap.Companion.SEPARATOR
@@ -827,6 +828,16 @@ class DBHierarchicalXESInputStreamWithQueryTests : DBHierarchicalXESInputStreamW
827828
assertTrue(log.traces.all { t -> t.events.count() <= 3 })
828829
}
829830

831+
@Test
832+
fun `limits do not affect upper scopes`() {
833+
val totalLogs = (q("select count(l:id)").first().attributes["count(log:identity:id)"] as Long).toInt()
834+
condition(totalLogs >= 2, "This test requires at least two event logs")
835+
836+
assertEquals(totalLogs, q("select l:name limit l:$totalLogs, t:1, e:1").count())
837+
assertEquals(totalLogs, q("select l:name limit l:$totalLogs, e:1").count())
838+
assertEquals(totalLogs, q("select l:name limit l:$totalLogs, t:1").count())
839+
}
840+
830841
@Test
831842
fun offsetSingleTest() {
832843
val stream = q("where l:id=$journal offset l:1")

processm.core/src/test/kotlin/processm/core/querylanguage/QueryTests.kt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,6 +1087,16 @@ class QueryTests {
10871087
assertEquals(PQLSyntaxException.Problem.DecimalPartDropped, (query.warning as PQLSyntaxException).problem)
10881088
}
10891089

1090+
@Test
1091+
fun applyLimitsTest() {
1092+
val query = Query("limit t:1, e:1")
1093+
query.applyLimits(10, 20, 30)
1094+
1095+
assertEquals(10, query.limit[Scope.Log])
1096+
assertEquals(1, query.limit[Scope.Trace])
1097+
assertEquals(1, query.limit[Scope.Event])
1098+
}
1099+
10901100
@Test
10911101
fun offsetSingleTest() {
10921102
val query = Query("offset l:1")

processm.launcher/src/test/kotlin/processm/selenium/AutomaticEtlTest.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,11 @@ class AutomaticEtlTest : SeleniumBase() {
184184
forEach { click(it) }
185185
}
186186
recorder?.take()
187-
val headers = driver.findElements(By.xpath("//*[@name='xes-data-table']//thead/tr/th")).withIndex()
187+
val headers = driver.findElements(By.xpath("(//*[@name='xes-data-table'])[2]//thead/tr/th")).withIndex()
188188
.associate { it.value.text to it.index }
189189
val dbTextColumn = headers["db:text"]
190190
assertNotNull(dbTextColumn)
191-
val rows = driver.findElements(By.xpath("//*[@name='xes-data-table']//tbody/tr"))
191+
val rows = driver.findElements(By.xpath("(//*[@name='xes-data-table'])[2]//tbody/tr"))
192192
.filter { it.findElements(By.tagName("td")).size >= 2 }
193193
assertEquals(12, rows.size)
194194
val log = ArrayList<ArrayList<String>>()

processm.services/src/main/kotlin/processm/services/logic/LogsService.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -194,8 +194,7 @@ class LogsService(private val producer: Producer) {
194194
limitFactor: Long = 1L,
195195
): DBHierarchicalXESInputStream {
196196
loggedScope { logger ->
197-
logger.info("Querying data store: $dataStoreId")
198-
logger.debug("User query: $query")
197+
logger.info("Querying data store $dataStoreId using user query $query")
199198

200199
val q = Query(query)
201200
q.applyLimits(logLimit, traceLimit * limitFactor, eventLimit * limitFactor)

processm.webui/src/main/frontend-app/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

processm.webui/src/main/frontend-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ProcessM",
3-
"version": "0.7.1",
3+
"version": "0.7.2",
44
"private": true,
55
"scripts": {
66
"serve": "vue-cli-service serve",

processm.webui/src/main/frontend-app/src/locales/en-US.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"workspaces": "Workspaces",
88
"users": "@:users.page-title",
99
"data-stores": "@:data-stores.page-title",
10-
"pql-interpreter": "PQL interpreter",
10+
"pql-interpreter": "@:pql-interpreter.page-title",
1111
"about": "@:about.page-title"
1212
},
1313
"topbar": {
@@ -516,5 +516,21 @@
516516
}
517517
]
518518
}
519+
},
520+
"pql-interpreter": {
521+
"page-title": "PQL interpreter",
522+
"page-hint": "This view is intended for prototyping and testing PQL queries. Event logs from all data stores accessible by the current user are available. You can upload your own XES event log below. Raw *.xes files and compressed *.xes.gz files are supported. Type a PQL query below and click [Execute] to see the query results or [Download XES] to download the resulting XES files. Use the drop-down list for predefined queries. Use the [PQL Documentation] button to open the PQL documentation.",
523+
"demo-mode": "DO NOT upload event logs containing personal, sensitive, and/or classified information. The uploaded event logs will be stored in the system for an undefined period of time, e.g., until scheduled clean-up or system update. It will be also shared with the other users of this system. The uploaded files will be public available. The system operator is not responsible for the content made public in this way.",
524+
"upload-xes-file": {
525+
"title": "@:data-stores.upload-xes-file.title"
526+
},
527+
"pql-documentation": "PQL documentation",
528+
"pql-documentation-hint": "@:workspace.component.edit.query-doc",
529+
"logs": "Event logs in the selected data store",
530+
"select-query": "Select query",
531+
"query": "@:workspace.component.edit.query",
532+
"query-hint": "The query executed against the selected data store for the retrieval of event logs",
533+
"execute": "Execute",
534+
"download": "Download XES"
519535
}
520536
}

processm.webui/src/main/frontend-app/src/locales/pl-PL.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"kpi-dialog": {
2222
"title": "Kluczowe wskaźniki efektywności (KPI)",
2323
"model-kpi": "KPI bazujące na modelu",
24-
"log-kpi":"@:workspace.component.aligner-kpi",
24+
"log-kpi": "@:workspace.component.aligner-kpi",
2525
"kpi": "KPI",
2626
"value": "Wartość",
2727
"log-count": "Liczba logów"
@@ -516,5 +516,21 @@
516516
}
517517
]
518518
}
519+
},
520+
"pql-interpreter": {
521+
"page-title": "Interpreter PQL",
522+
"page-hint": "Ten widok jest przeznaczony do prototypowania i testowania zapytań PQL. Dzienniki zdarzeń ze wszystkich magazynów danych dostępnych dla bieżącego użytkownika są dostępne. Możesz przesłać swój własny dziennik zdarzeń XES poniżej. Obsługiwane są pliki *.xes oraz skompresowane pliki *.xes.gz. Wpisz zapytanie PQL poniżej i kliknij [Wykonaj], aby zobaczyć wyniki zapytania lub [Pobierz XES], aby pobrać wynikowe pliki XES. Użyj listy rozwijanej, aby wybrać wstępnie zdefiniowane zapytania. Użyj przycisku [Dokumentacja PQL], aby otworzyć dokumentację PQL.",
523+
"demo-mode": "NIE przesyłaj dzienników zdarzeń zawierających dane osobowe, wrażliwe i/lub poufne informacje. Przesłane dzienniki zdarzeń będą przechowywane w systemie przez nieokreślony czas, np. do zaplanowanego czyszczenia lub aktualizacji systemu. Będą również udostępniane innym użytkownikom tego systemu. Przesłane pliki będą publicznie dostępne. Operator systemu nie ponosi odpowiedzialności za treści udostępnione w ten sposób.",
524+
"upload-xes-file": {
525+
"title": "@:data-stores.upload-xes-file.title"
526+
},
527+
"pql-documentation": "Dokumentacja PQL",
528+
"pql-documentation-hint": "@:workspace.component.edit.query-doc",
529+
"logs": "Dzienniki zdarzeń w wybranym magazynie danych",
530+
"select-query": "Wybierz zapytanie",
531+
"query": "@:workspace.component.edit.query",
532+
"query-hint": "Zapytanie wykonane na wybranym magazynie danych w celu pobrania dzienników zdarzeń",
533+
"execute": "Wykonaj",
534+
"download": "Pobierz XES"
519535
}
520536
}

processm.webui/src/main/frontend-app/src/views/DataStoreConfiguration.vue

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -568,11 +568,9 @@ export default class DataStoreConfiguration extends Vue {
568568
const { headers, logItems } = this.xesProcessor.extractLogItemsFromLogScope(queryResults);
569569
this.xesLogHeaders = headers;
570570
571-
for (const item of logItems) {
572-
await waitForRepaint(() => {
573-
this.xesLogItems.push(item);
574-
});
575-
}
571+
await waitForRepaint(() => {
572+
this.xesLogItems.push(...logItems);
573+
});
576574
});
577575
} catch (err) {
578576
this.app.error(err?.response?.data?.error ?? err);
@@ -790,4 +788,4 @@ export default class DataStoreConfiguration extends Vue {
790788
return false;
791789
}
792790
}
793-
</script>
791+
</script>

0 commit comments

Comments
 (0)