Modifier and Type | Method and Description |
---|---|
static CreationWorkItemSpec |
forAllocation(UserReference allocatedTo)
Allows to directly create a work item allocated to the specified user.
|
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 |
forAllocationWithPossibleReallocation(UserReference allocatedTo,
Role offeredTo)
Allows to create a work item allocated to the specified user with
the possibility to reallocate it.
|
static CreationWorkItemSpec |
forNone() |
static CreationWorkItemSpec |
forOffer(Role offeredTo)
Allows to create a work item offered to the specified role.
|
static CreationWorkItemSpec |
forOfferring(Collection<Profile> offeredToProfiles)
Allows to create a work item for a profile list.
|
static CreationWorkItemSpec |
forOfferring(Profile offeredOrAllocatedTo)
Allows to create a work item offered or allocated to the specified profile.
|
UserReference |
getAllocatedTo()
Returns the user to whom the work item must be allocated.
|
String |
getNotificationMail() |
Role |
getOfferedTo()
Deprecated.
Since 5.7.0. This method is replaced by
getOfferedToProfiles() . |
Collection<Profile> |
getOfferedToProfiles()
Returns the collection of profiles to whom the work item must be offered.
|
Profile |
getProfileMailCC() |
UserMessage |
getSpecificLabel() |
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.
|
public static CreationWorkItemSpec forAllocation(UserReference allocatedTo)
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.
public static CreationWorkItemSpec forOffer(Role offeredTo)
The state of the created work item is offered
and all users of the offeredTo
role can take the created work item.
public static CreationWorkItemSpec forOfferring(Profile offeredOrAllocatedTo)
If offeredOrAllocatedTo
is a Role
,
this method is equivalent to forOffer(Role)
:
the state of the created work item is offered
and all users of the offeredTo
role can take the created work item.
If offeredOrAllocatedTo
is a UserReference
,
this method is equivalent to forAllocation(UserReference)
:
the state of the created work item is allocated;
the work item is created without an offeredTo
value.
public static CreationWorkItemSpec forOfferring(Collection<Profile> offeredToProfiles)
IfofferedToProfiles
contains only one profile, this method is
equivalent to forOfferring(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.
UserTaskCreationContext.createWorkItem(CreationWorkItemSpec)
public static CreationWorkItemSpec forAllocationWithPossibleReallocation(UserReference allocatedTo, Role offeredTo)
This method is useful to simulate a default allocation:
The state of the created work item is allocated.
allocatedTo
- the user for the first allocation.offeredTo
- the authorized role to take the work item, if reallocated.forAllocationWithPossibleReallocation(UserReference, Collection)
public static CreationWorkItemSpec forAllocationWithPossibleReallocation(UserReference allocatedTo, Collection<Profile> offeredToProfiles)
If offeredToProfiles
contains only one role, this method is
equivalent to forAllocationWithPossibleReallocation(UserReference, Role)
The state of the created work item is allocated.
allocatedTo
- the user for the first allocation.offeredToProfiles
- the authorized profiles to take the work item, if reallocated.forAllocationWithPossibleReallocation(UserReference, Role)
public static CreationWorkItemSpec forNone()
public UserReference getAllocatedTo()
public Role getOfferedTo()
getOfferedToProfiles()
.IllegalStateException
- If the work item specification offers the work item to several profiles.public final Collection<Profile> getOfferedToProfiles()
public String getNotificationMail()
public void setNotificationMail(String notificationMail)
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.
notificationMail
- key (integer) of the notification mail in the technical configuration table
in Workflow-Executions of the Administration.IllegalArgumentException
- if the parameter is not convertible into an integer.public Profile getProfileMailCC()
public void setProfileMailCC(Profile profileMailCC)
public void setSpecificLabel(UserMessage specificLabel)
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.
public UserMessage getSpecificLabel()