-
Improvement
-
Resolution: Unresolved
-
Neutral
-
None
-
1.2.9
-
-
Yes
-
Empty show more show less
I discussed this improvement with slutz
I dug into the code how hard it would be -> its easy to achieve (I add a patch).
Situation / Problem
A content editor/Eric published content, in pages app trough workflow/tasks.
When he triggers a publication, he does not get any information at all.
He has no clue if it worked, and what happens, he has on information about:
- If the publication was triggered at all
- the state of his publication ->is anybody working on it?
- no information that a publication was approved -> he will only see by coincidence, that the node is suddenly green.
Solution - General
One should always see his own requested/triggered Tasks.
The one sees the state of every task -> 'requestor' in Task
Of course he can not assign or change the task, as he is not a part of the task's group it was sent to. Only seeing it, not being able to operate on it.
Solution - In Code
I dug a bit into the code. I think the solution is pretty easy, maybe I missed some place where also needs adaptions.
But if I see it right, it all comes down to one method that would have to be adapted in:
info.magnolia.task.persistence.TasksStoreImpl.prepareQueryStatementByUserAndStatuses(String, List<Status>)
TaskStoreImpl.patch
Code change from:
StringBuilder sql = new StringBuilder(String.format("SELECT * FROM [%1$s] WHERE (actorId = '%2$s' OR actorIds = '%2$s'", TaskNode.NAME, userId));
To:
StringBuilder sql = new StringBuilder(String.format("SELECT * FROM [%1$s] WHERE ((actorId = '%2$s' OR actorIds = '%2$s') OR (requestor = '%2$s')", TaskNode.NAME, userId));
Which will change the resulting query:
From resulting query in info.magnolia.task.persistence.TasksStoreImpl.prepareQueryStatementByUserAndStatuses(String, List<Status>):
SELECT * FROM [mgnl:task] WHERE (actorId = 'eric' OR actorIds = 'eric' OR groupIds = 'travel-demo-editors') AND (status LIKE '%Created%') AND status NOT LIKE '%Archived%'
To resulting query in info.magnolia.task.persistence.TasksStoreImpl.prepareQueryStatementByUserAndStatuses(String, List<Status>):
SELECT * FROM [mgnl:task] WHERE ((actorId = 'eric' OR actorIds = 'eric' OR groupIds = 'travel-demo-editors') OR (requestor = 'eric')) AND (status LIKE '%Created%') AND status NOT LIKE '%Archived%'
Possible nice extensions
Extension 1 - Allow sending a message/notification
- It would be the perfect use case, of using notifications between two authors:
When seeing a task which is assigned to somebody, one could click on an Action "Write to assignee of Task". So he could write something like "This pub request is really important, could you take care soon of it."
- When seeing a task which is not assigned to anybody, maybe being able to write to the whole group: "This is super important, can please take somebody care of that task?"
Extension 2 - Be informed on success
When a task finishes successful, that the requestor gets automatically informed about it by the workflow/task.