Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info
iconfalse
titleBest practice
Multiexcerpt
MultiExcerptNameDon't use tasks if you don't have any human activity in your workflow

Don't Do not use tasks if you don't have any human activity in your workflow. Tasks and Pulse notifications are great for humans but unnecessary for operations that only involve the system itself.

...

A task is an object that you create using the 

Javadoc
0info.magnolia.task.TasksManager
classNameinfo.magnolia.task.TasksManager
renderTypeasynchronous
. You can send the task to a list of users or to a list of groups. The recipient can assign the task to himself. Other recipients can see who owns the task and its status when they go to the Pulse.

...

Code Block
languagejava
titleUsing TasksManager
@Inject
public MyClass(TasksManager tasksManager) {
	this.tasksManager = tasksManager;
}

public void createTask() {
    Task task = new Task();
    ...
	tasksManager.addTask(task);
}
Note

Be aware that by calling

Code Block
task.setId(String);

the task will not be created in the workspace.


Creating a task

Start by giving the

Javadoc
0info.magnolia.task.Task
 a task a name. The name is unique for the type of task you are creating and acts as a reference to the task definition in the registry.

...

Magnolia uses info.magnolia.ui.admincentral.shellapp.pulse.task.action.ClaimTaskAction inside the Pulse for this step.

Reclaiming a task

((warning) Magnolia 5.5.6+) With appropriate publication rights you can reclaim a task which is already InProgress from another user.

...

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
Node nameValue

Mgnl f
messageViews

 


Mgnl n
publish

 

Mgnl n
form

 

Mgnl n
actions

 

Mgnl n
approve

 

Mgnl n
availability

 

Mgnl p
class

info.magnolia.ui.admincentral.shellapp.pulse.task.action.ResolveTaskActionDefinition

Mgnl p
decision

approve

Mgnl p
icon

icon-publish

...

Changes to task status can be tracked by registering a 

Javadoc
0info.magnolia.task.event.TaskEventHandler
classNameinfo.magnolia.task.event.TaskEventHandler
renderTypeasynchronous
 to the system event bus.

...

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
Node nameValue

Mgnl f
my-module

 

Mgnl f
tasks

 


Mgnl n
getGroceries

 


Mgnl p
class

info.magnolia.task.definition.TaskDefinition

Mgnl p
taskView

my-module:groceries

Mgnl p
title

Groceries


The simplest

Javadoc
0info.magnolia.task.definition.TaskDefinition
classNameinfo.magnolia.task.definition.TaskDefinition
renderTypeasynchronous
 needs the following properties:

...


As with any definition used in Magnolia, you can define your own extensions to the task definition and add configurable nodes and properties. This is especially useful in combination with a custom task presenter for putting together the detail view.

...

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
Node nameValue

Mgnl f
my-module

 

Mgnl f
messageViews

 

Mgnl n
groceries

 

Mgnl n
form

 


Mgnl n
tabs

 


Mgnl n
groceries

 

Mgnl n
fields

 


Mgnl n
actorIds

 

Mgnl n
content.groceries

 

Mgnl p
class

info.magnolia.ui.form.field.definition.TextFieldDefinition

Mgnl n
content.budget

 

Mgnl n
comment

 

Mgnl n
actions

 

Mgnl n
actionbar

 



Task presenter

A task presenter is started when a user opens a task to see its details. The presenter builds the form and action bar which are displayed to the user in the browser. Magnolia provides a 

Javadoc
0info.magnolia.ui.admincentral.shellapp.pulse.task.DefaultTaskDetailPresenter
classNameinfo.magnolia.ui.admincentral.shellapp.pulse.task.DefaultTaskDetailPresenter
renderTypeasynchronous
. See Task view above for  for its functionality.

Most likely the task data you want to display in the Pulse can be rendered with the DefaultTaskDetailPresenter. But in case the default presenter is not sufficient you can implement your own presenter and have it render whatever view is needed.

To implement a custom presenter, extend or use 

Javadoc
0info.magnolia.ui.admincentral.shellapp.pulse.task.definition.TaskUiDefinition
classNameinfo.magnolia.ui.admincentral.shellapp.pulse.task.definition.TaskUiDefinition
renderTypeasynchronous
 instead of 
Javadoc
0info.magnolia.task.definition.TaskDefinition
classNameinfo.magnolia.task.definition.TaskDefinition
renderTypeasynchronous
 and add a presenterClass property with a custom implementation of the 
Javadoc
0info.magnolia.ui.admincentral.shellapp.pulse.task.TaskDetailPresenter
classNameinfo.magnolia.ui.admincentral.shellapp.pulse.task.TaskDetailPresenter
renderTypeasynchronous
interface to the configuration.

Advanced Tables - Table Plus
heading0
multiplefalse
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse
Node nameValue

Mgnl f
tasks

 


Mgnl n
getGroceries

 

Mgnl p
class

info.magnolia.ui.admincentral.shellapp.pulse.task.definition.TaskUiDefinition

Mgnl p
presenterClass

info.my-company.ui.GroceryTaskPresenter

Mgnl p
taskView

my-module:groceries

Mgnl p
title

Groceries

...

Advanced Tables - Table Plus
heading0
enableHeadingAttributesfalse
enableSortingfalse
classm5-configuration-tree
enableHighlightingfalse

Node name

Value

Mgnl n
bulkActions

 

Mgnl n
archive

 

Mgnl n
availability

 


Mgnl n
access  


Mgnl n
roles

 

Mgnl p
superuser

superuser

Mgnl n
rules 

 

Mgnl n
CanArchiveTaskRule 

 

Mgnl n
status  


Mgnl p
Created

Created

Mgnl p
Failed

Failed

Mgnl p
InProgress

InProgress

Mgnl p
Resolved

Resolved

Mgnl p
Scheduled

Scheduled

Mgnl p
assignee

false

Mgnl p
class

info.magnolia.ui.admincentral.shellapp.pulse.task.action.availability.TaskAvailabilityRuleDefinition

Mgnl p
multiple

true

Mgnl p
class

info.magnolia.ui.admincentral.shellapp.pulse.task.action.ArchiveTasksActionDefinition

Mgnl p
icon

icon-delete

To allow bulk actions for other users, add their role names from the list of default roles as the properties and values of the roles subnode.

...