Class CreationWorkItemSpec
- java.lang.Object
-
- com.orchestranetworks.workflow.CreationWorkItemSpec
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static CreationWorkItemSpecforAllocation(UserReference allocatedTo)Allows to directly create a work item allocated to the specified user.static CreationWorkItemSpecforAllocationWithPossibleReallocation(UserReference allocatedTo, Role offeredTo)Allows to create a work item allocated to the specified user with the possibility to reallocate it.static CreationWorkItemSpecforAllocationWithPossibleReallocation(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 CreationWorkItemSpecforNone()static CreationWorkItemSpecforOffer(Role offeredTo)Allows to create a work item offered to the specified role.static CreationWorkItemSpecforOfferring(Profile offeredOrAllocatedTo)Allows to create a work item offered or allocated to the specified profile.static CreationWorkItemSpecforOfferring(Collection<Profile> offeredToProfiles)Allows to create a work item for a profile list.UserReferencegetAllocatedTo()Returns the user to whom the work item must be allocated.StringgetNotificationMail()RolegetOfferedTo()Deprecated.Since 5.7.0.Collection<Profile>getOfferedToProfiles()Returns the collection of profiles to whom the work item must be offered.ProfilegetProfileMailCC()UserMessagegetSpecificLabel()voidsetNotificationMail(String notificationMail)Sets the notification mail to be sent when the work item is created.voidsetProfileMailCC(Profile profileMailCC)voidsetSpecificLabel(UserMessage specificLabel)Sets the label of the work item.
-
-
-
Method Detail
-
forAllocation
public static CreationWorkItemSpec forAllocation(UserReference allocatedTo)
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
offeredTovalue, hence the work item can not be reallocated.
-
forOffer
public static CreationWorkItemSpec forOffer(Role offeredTo)
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
offeredTorole can take the created work item.
-
forOfferring
public static CreationWorkItemSpec forOfferring(Profile offeredOrAllocatedTo)
Allows to create a work item offered or allocated to the specified profile.If
offeredOrAllocatedTois aRole, this method is equivalent toforOffer(Role): the state of the created work item is offered and all users of theofferedTorole can take the created work item.If
offeredOrAllocatedTois aUserReference, this method is equivalent toforAllocation(UserReference): the state of the created work item is allocated; the work item is created without anofferedTovalue.
-
forOfferring
public static CreationWorkItemSpec forOfferring(Collection<Profile> offeredToProfiles)
Allows to create a work item for a profile list.If
offeredToProfilescontains 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
offeredToProfilescontains 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:
UserTaskCreationContext.createWorkItem(CreationWorkItemSpec)
-
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(UserReference, Collection)
-
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
offeredToProfilescontains 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:
forAllocationWithPossibleReallocation(UserReference, Role)
-
forNone
public static CreationWorkItemSpec forNone()
-
getAllocatedTo
public UserReference getAllocatedTo()
Returns the user to whom the work item must be allocated.
-
getOfferedTo
@Deprecated public Role 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
public final Collection<Profile> getOfferedToProfiles()
Returns the collection of profiles to whom the work item must be offered.- Since:
- 5.7.0
-
getNotificationMail
public String getNotificationMail()
-
setNotificationMail
public void setNotificationMail(String notificationMail)
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
public Profile getProfileMailCC()
-
setProfileMailCC
public void setProfileMailCC(Profile profileMailCC)
-
setSpecificLabel
public void setSpecificLabel(UserMessage specificLabel)
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
public UserMessage getSpecificLabel()
-
-