Class CreationWorkItemSpec
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic CreationWorkItemSpec
forAllocation
(UserReference allocatedTo) Allows to directly create a work item allocated to the specified user.static CreationWorkItemSpec
forAllocationWithPossibleReallocation
(UserReference allocatedTo, Role offeredTo) Allows to create a work item allocated to the specified user with the possibility to reallocate it.static CreationWorkItemSpec
forAllocationWithPossibleReallocation
(UserReference allocatedTo, Collection<Profile> offeredToProfiles) Allows to create a work item allocated to the specified user with the possibility to reallocate to a profile contained in offeredToProfiles.static CreationWorkItemSpec
forNone()
static CreationWorkItemSpec
Allows to create a work item offered to the specified role.static CreationWorkItemSpec
forOfferring
(Profile offeredOrAllocatedTo) Allows to create a work item offered or allocated to the specified profile.static CreationWorkItemSpec
forOfferring
(Collection<Profile> offeredToProfiles) Allows to create a work item for a profile list.Returns the user to whom the work item must be allocated.Deprecated.Since 5.7.0.final Collection<Profile>
Returns the collection of profiles to whom the work item must be offered.void
setNotificationMail
(String notificationMail) Sets the notification mail to be sent when the work item is created.void
setProfileMailCC
(Profile profileMailCC) void
setSpecificLabel
(UserMessage specificLabel) Sets the label of the work item.
-
Method Details
-
forAllocation
Allows to directly create a work item allocated to the specified user.The state of the created work item is allocated. The work item is created without an
offeredTo
value, hence the work item can not be reallocated. -
forOffer
Allows to create a work item offered to the specified role.The state of the created work item is offered and all users of the
offeredTo
role can take the created work item. -
forOfferring
Allows to create a work item offered or allocated to the specified profile.If
offeredOrAllocatedTo
is aRole
, this method is equivalent toforOffer(Role)
: the state of the created work item is offered and all users of theofferedTo
role can take the created work item.If
offeredOrAllocatedTo
is aUserReference
, this method is equivalent toforAllocation(UserReference)
: the state of the created work item is allocated; the work item is created without anofferedTo
value. -
forOfferring
Allows to create a work item for a profile list.If
offeredToProfiles
contains only one profile, this method is equivalent toforOfferring(Profile)
: If the profile is a user, the created work item is allocated to it, If the profile is as role, the created work item is offered to it.If
offeredToProfiles
contains several profiles, the created work item is offered to all of them.This feature should not be used for user tasks in the legacy mode (multi work items) for several profiles. If this method
UserTaskCreationContext.createWorkItem(CreationWorkItemSpec)
is called for user tasks in legacy mode, an exception is thrown at the work item creation if the work item is specified with more than one offered profiles.- Since:
- 5.7.0
- See Also:
-
forAllocationWithPossibleReallocation
public static CreationWorkItemSpec forAllocationWithPossibleReallocation(UserReference allocatedTo, Role offeredTo) Allows to create a work item allocated to the specified user with the possibility to reallocate it.This method is useful to simulate a default allocation:
- The work item is automatically allocated to the specified user.
- But it can be reallocated to the users of the specified role.
The state of the created work item is allocated.
- Parameters:
allocatedTo
- the user for the first allocation.offeredTo
- the authorized role to take the work item, if reallocated.- See Also:
-
forAllocationWithPossibleReallocation
public static CreationWorkItemSpec forAllocationWithPossibleReallocation(UserReference allocatedTo, Collection<Profile> offeredToProfiles) Allows to create a work item allocated to the specified user with the possibility to reallocate to a profile contained in offeredToProfiles.If
offeredToProfiles
contains only one role, this method is equivalent toforAllocationWithPossibleReallocation(UserReference, Role)
- The work item is automatically allocated to the specified user.
- But it can be reallocated to a profile referenced in offeredToProfile.
The state of the created work item is allocated.
- Parameters:
allocatedTo
- the user for the first allocation.offeredToProfiles
- the authorized profiles to take the work item, if reallocated.- Since:
- 6.0.1
- See Also:
-
forNone
-
getAllocatedTo
Returns the user to whom the work item must be allocated. -
getOfferedTo
Deprecated.Since 5.7.0. This method is replaced bygetOfferedToProfiles()
.Returns the role to whom the work item must be offered.- Throws:
IllegalStateException
- If the work item specification offers the work item to several profiles.
-
getOfferedToProfiles
Returns the collection of profiles to whom the work item must be offered.- Since:
- 5.7.0
-
getNotificationMail
-
setNotificationMail
Sets the notification mail to be sent when the work item is created.If the work item is offered, the mail will be sent to all users of the role. If the work item is allocated, the mail will be sent to the owner.
If the notification mail is
null
, no mail will be sent.- Parameters:
notificationMail
- key (integer) of the notification mail in the technical configuration table in Workflow-Executions of the Administration.- Throws:
IllegalArgumentException
- if the parameter is not convertible into an integer.
-
getProfileMailCC
-
setProfileMailCC
-
setSpecificLabel
Sets the label of the work item.If the specific label contains a data context variable, it would be evaluated.
If the specific label is empty, the default label will be generated from the label defined in the user task definition.
-
getSpecificLabel
-