This module contains workflow tasks for the plugin lutece-system-plugin-unittree.
The tasks are the following:
The admin user has to configure the tasks. A assignment type and at least one unit selection are mandatory.
For a manual unit assignment, several unit selections can be configured. The user will choose the selection she / he wants in the task form.
For an automatic unit assignment, only one unit selection can be configured.
The assignment types are the following:
Introduction
A unit selection enables to select the target unit. A unit selection can be automatic and so can be used in the task to automatically assign a resource to a unit. All the unit selections (automatic or not) can be used in the task to manually assign a resource to a unit.
This module contains the following unit selections:
Create a unit selection
If you want to use your own unit selection, the only thing you have to do is to implement the interface fr.paris.lutece.plugins.workflow.modules.unittree.service.task.selection.IUnitSelection and to declare it as a bean in the Spring context. Your unit selection will be then present in the configuration of the unit assignment tasks.
The method which does the real job is the method select( ... ). It returns the id of the target unit. This method is not responsible of storing the assignment. The store is done by the workflow task itself. If this method detects that the assignment is not possible, it must throw a fr.paris.lutece.plugins.workflow.modules.unittree.exception.AssignmentNotPossibleException.
The IUnitSelection uses a configuration handler to manage the configuration part of the unit selection in the unit assignment tasks. You can create your own configuration handler by implementing the interface fr.paris.lutece.plugins.workflow.modules.unittree.service.task.selection.IConfigurationHandler. If your unit selection has no configuration, you can extends the abstract class fr.paris.lutece.plugins.workflow.modules.unittree.service.task.selection.impl.AbstractEmptyConfigurationHandler. The only thing you have to do is to give the title of your unit selection.
The IUnitSelection uses a form handler to manage the task form of the unit selection in the unit assignment tasks. You can create your own form handler by implementing the interface fr.paris.lutece.plugins.workflow.modules.unittree.service.task.selection.ITaskFormHandler. For automatic selections, it is a good idea to test if the assignment is possible in the method getDisplayedForm( ... ) (by calling the method select( ... )). If the assignment is not possible, then the method must throw a fr.paris.lutece.plugins.workflow.modules.unittree.exception.AssignmentNotPossibleException. It enables to hide this selection in the task form.
The service fr.paris.lutece.plugins.workflow.modules.unittree.service.UnitAssignmentService enables to retrieve the unit assignments for a resource.
It contains the following methods:
The workflow tasks are used to assign the resource to units. The service UnitAssignmentService is used to retrieve the unit assignments for the resource.