Re: [PR] kie-tools-issues#3184- [sonataflow-management-console-webapp] Management console is unable to sort workflow instances by ID [incubator-kie-tools]
domhanak merged PR #3189: URL: https://github.com/apache/incubator-kie-tools/pull/3189 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] kie-tools-issues#3184- [sonataflow-management-console-webapp] Management console is unable to sort workflow instances by ID [incubator-kie-tools]
kumaradityaraj commented on PR #3189: URL: https://github.com/apache/incubator-kie-tools/pull/3189#issuecomment-3056684099 > @kumaradityaraj I cannot replicate the bug you described > > Screencast.From.2025-07-10.11-50-41.mp4 LGTM, I thaught its a bug on the UI since it already receives the sorted list. We can merge this. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] kie-tools-issues#3184- [sonataflow-management-console-webapp] Management console is unable to sort workflow instances by ID [incubator-kie-tools]
fantonangeli commented on PR #3189: URL: https://github.com/apache/incubator-kie-tools/pull/3189#issuecomment-3056668648 @kumaradityaraj I cannot replicate the bug you described https://github.com/user-attachments/assets/fd3b8c58-91a8-4e72-bb24-162634528e74 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] kie-tools-issues#3184- [sonataflow-management-console-webapp] Management console is unable to sort workflow instances by ID [incubator-kie-tools]
kumaradityaraj commented on PR #3189: URL: https://github.com/apache/incubator-kie-tools/pull/3189#issuecomment-3056571909 > @kumaradityaraj I quickly opened a PR, which needs to be tested more, on your branch: [kumaradityaraj#9](https://github.com/kumaradityaraj/kie-tools/pull/9) Hey Fabrizio, I checked it and works well. BTW, I noticed one behaviour when we click on the sort button on the first click it remains the same on the second click we see sorting in opposite direction. Is this the expected behaviour or its a bug? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] kie-tools-issues#3184- [sonataflow-management-console-webapp] Management console is unable to sort workflow instances by ID [incubator-kie-tools]
fantonangeli commented on PR #3189: URL: https://github.com/apache/incubator-kie-tools/pull/3189#issuecomment-3052704033 @kumaradityaraj I quickly opened a PR, which needs to be tested more, on your branch: https://github.com/kumaradityaraj/kie-tools/pull/9 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] kie-tools-issues#3184- [sonataflow-management-console-webapp] Management console is unable to sort workflow instances by ID [incubator-kie-tools]
fantonangeli commented on PR #3183: URL: https://github.com/apache/incubator-kie-tools/pull/3183#issuecomment-3003952123 Hi @domhanak, would you agree with changing the sort by "Id" to "Process Name"? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] kie-tools-issues#3184- [sonataflow-management-console-webapp] Management console is unable to sort workflow instances by ID [incubator-kie-tools]
fantonangeli commented on PR #3183: URL: https://github.com/apache/incubator-kie-tools/pull/3183#issuecomment-2989057419 @wmedvede thank you so much for your very useful information. I agree to use the same field we are using to display in the UI, so I would "vote" for `processName` and rename the column to `Process Name`. @domhanak Because you were the first one to discover the bug, do you agree with this solution? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] - To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
Re: [PR] kie-tools-issues#3184- [sonataflow-management-console-webapp] Management console is unable to sort workflow instances by ID [incubator-kie-tools]
wmedvede commented on PR #3183:
URL:
https://github.com/apache/incubator-kie-tools/pull/3183#issuecomment-2988759386
Hello @fantonangeli
I don't think the sorting by **"id"** (which corresponds to the process
instanced id) is implemented for the ProcessInstances query, but also I don't
see that the documentation is saying that it is possible.
Looking at here:
https://sonataflow.org/serverlessworkflow/main/data-index/data-index-core-concepts.html
I don't see any example.
Also, if we look in the DI GraphqlUI in the sort options for the
ProcessInstances query, we are not showing the **"id"** field as available for
sorting.
We can sort for example by **"processId"**, but not by **"id"**
```
{
ProcessInstances (orderBy: {processId: DESC} ) {
processId,
state,
serviceUrl,
state
}
}
```

While it could be technically possible to implement the sorting by **"id"**,
in practice I don't think it't be useful, since the **"id"** (the process
instance id) has values like: **"a0ac78ad-54e6-4168-882e-ac2849706e69"** .
I think that instead of sorting by **"id"** , this query can internally sort
by **"processId"**, and thus, users can group all the instances that belongs to
the same ProcessDefinition.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] kie-tools-issues#3184- [sonataflow-management-console-webapp] Management console is unable to sort workflow instances by ID [incubator-kie-tools]
fantonangeli commented on code in PR #3183:
URL:
https://github.com/apache/incubator-kie-tools/pull/3183#discussion_r2154108756
##
packages/runtime-tools-swf-enveloped-components/src/workflowList/envelope/components/WorkflowListTable/WorkflowListTable.tsx:
##
@@ -90,6 +90,38 @@ const WorkflowListTable: React.FC = ({
const [titleType, setTitleType] = useState("");
const [isModalOpen, setIsModalOpen] = useState(false);
const [selectedWorkflowInstance, setSelectedWorkflowInstance] =
useState(null);
+ const [sortByState, setSortByState] = useState<{ index: number; direction:
"asc" | "desc" }>({
+index: 2,
+direction: "asc",
+ });
+
+ const getComparableValue = (instance: WorkflowInstance, columnKey: string):
any => {
+switch (columnKey) {
+ case "Id":
+return instance.id;
+ case "Status":
+return instance.state;
+ case "Created":
+return new Date(instance.start);
+ case "Last update":
+return new Date(instance.lastUpdate);
+ default:
+return "";
+}
+ };
+
+ const onSortInternal = (_event: React.SyntheticEvent, index: number,
direction: "asc" | "desc") => {
Review Comment:
> This will sort the already-fetched items, but if the Data Index is
returning a "paginated" list of items, this sort is not necessarily correct.
>
> @fantonangeli , can the Data-Index sort by ID?
@wmedvede @ricardozanini @domhanak
It seems that the Data Index does not support sorting by `id`, even though
it's documented
[here](https://sonataflow.org/serverlessworkflow/latest/data-index/data-index-core-concepts.html).
I tried using the following query variables:
```
{
"offset": 0,
"limit": 10,
"orderBy": {
"id": "ASC"
}
}
```
Response:
```
The variables input contains a field name 'id' that is not defined for input
object type 'ProcessInstanceOrderBy'
```
IMO we have a couple of ways:
- Fix the Data Index to support sorting by `id`
- Sort by processName instead and update the column label in the UI from
`id` to `Name`, since that column displays both the process name and ID.
Let me know what you think, or if I'm missing something in the query.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
-
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
Re: [PR] kie-tools-issues#3184- [sonataflow-management-console-webapp] Management console is unable to sort workflow instances by ID [incubator-kie-tools]
fantonangeli commented on code in PR #3183:
URL:
https://github.com/apache/incubator-kie-tools/pull/3183#discussion_r2152247857
##
packages/runtime-tools-swf-enveloped-components/src/workflowList/envelope/components/WorkflowListTable/WorkflowListTable.tsx:
##
@@ -90,6 +90,38 @@ const WorkflowListTable: React.FC = ({
const [titleType, setTitleType] = useState("");
const [isModalOpen, setIsModalOpen] = useState(false);
const [selectedWorkflowInstance, setSelectedWorkflowInstance] =
useState(null);
+ const [sortByState, setSortByState] = useState<{ index: number; direction:
"asc" | "desc" }>({
+index: 2,
+direction: "asc",
+ });
+
+ const getComparableValue = (instance: WorkflowInstance, columnKey: string):
any => {
Review Comment:
it's always better to use `useCallback` to reduce re-rendering of components
##
packages/runtime-tools-swf-enveloped-components/src/workflowList/envelope/components/WorkflowListTable/WorkflowListTable.tsx:
##
Review Comment:
IDKW but in this file at line 22 there is a change from `Table` to
`TableComposable` which GH doesn't show:
upstream/main:
```
import { Table } from "@patternfly/react-table/deprecated";
```
kumaradityaraj/sortWorkflow:
```
import { TableComposable, Thead, Tbody, Tr, Th, Td } from
"@patternfly/react-table/dist/js/components/TableComposable";
```
you can see it running:
```
git difftool -y upstream/main
packages/runtime-tools-swf-enveloped-components/src/workflowList/envelope/components/WorkflowListTable/WorkflowListTable.tsx
```
https://github.com/apache/incubator-kie-tools/blob/main/packages/runtime-tools-swf-enveloped-components/src/workflowList/envelope/components/WorkflowListTable/WorkflowListTable.tsx#L23
https://github.com/kumaradityaraj/kie-tools/blob/bc8556ec487ffb47155a69dce34bbc43a8796a5c/packages/runtime-tools-swf-enveloped-components/src/workflowList/envelope/components/WorkflowListTable/WorkflowListTable.tsx#L22
Was this intentional?
##
packages/runtime-tools-swf-enveloped-components/src/workflowList/envelope/components/WorkflowListTable/WorkflowListTable.tsx:
##
@@ -90,6 +90,38 @@ const WorkflowListTable: React.FC = ({
const [titleType, setTitleType] = useState("");
const [isModalOpen, setIsModalOpen] = useState(false);
const [selectedWorkflowInstance, setSelectedWorkflowInstance] =
useState(null);
+ const [sortByState, setSortByState] = useState<{ index: number; direction:
"asc" | "desc" }>({
+index: 2,
+direction: "asc",
+ });
+
+ const getComparableValue = (instance: WorkflowInstance, columnKey: string):
any => {
+switch (columnKey) {
+ case "Id":
+return instance.id;
+ case "Status":
+return instance.state;
+ case "Created":
+return new Date(instance.start);
+ case "Last update":
+return new Date(instance.lastUpdate);
+ default:
+return "";
+}
+ };
+
+ const onSortInternal = (_event: React.SyntheticEvent, index: number,
direction: "asc" | "desc") => {
Review Comment:
it's always better to use `useCallback` to reduce re-rendering of components
##
packages/runtime-tools-swf-enveloped-components/src/workflowList/envelope/components/WorkflowListTable/WorkflowListTable.tsx:
##
@@ -90,6 +90,38 @@ const WorkflowListTable: React.FC = ({
const [titleType, setTitleType] = useState("");
const [isModalOpen, setIsModalOpen] = useState(false);
const [selectedWorkflowInstance, setSelectedWorkflowInstance] =
useState(null);
+ const [sortByState, setSortByState] = useState<{ index: number; direction:
"asc" | "desc" }>({
+index: 2,
+direction: "asc",
+ });
+
+ const getComparableValue = (instance: WorkflowInstance, columnKey: string):
any => {
+switch (columnKey) {
+ case "Id":
+return instance.id;
+ case "Status":
+return instance.state;
+ case "Created":
+return new Date(instance.start);
+ case "Last update":
+return new Date(instance.lastUpdate);
+ default:
+return "";
+}
+ };
+
+ const onSortInternal = (_event: React.SyntheticEvent, index: number,
direction: "asc" | "desc") => {
Review Comment:
> This will sort the already-fetched items, but if the Data Index is
returning a "paginated" list of items, this sort is not necessarily correct.
>
> @fantonangeli , can the Data-Index sort by ID?
@wmedvede @ricardozanini @domhanak
It seems that the Data Index does not support sorting by `id`, even though
it's documented
[here](https://sonataflow.org/serverlessworkflow/latest/data-index/data-index-core-concepts.html).
I tried using the following query variables:
```
{
"offset": 0,
"limit": 10,
"orderBy": {
"id": "ASC"
}
}
```
Response:
```
GraphQLError: Variable \"$orderBy\" got invalid value { id: \"ASC\" }; Field
\"id\"
