Package com.flowable.workobject.api
Interface WorkObjectService
- All Known Implementing Classes:
WorkObjectServiceImpl
public interface WorkObjectService
- Author:
- Tijs Rademakers
-
Method Summary
Modifier and Type Method Description voidaddGroupIdentityLink(java.lang.String workObjectId, java.lang.String groupId, java.lang.String identityLinkType)Involves a group with a work object.voidaddParticipantGroup(java.lang.String workObjectId, java.lang.String groupId)Convenience shorthand foraddGroupIdentityLink(String, String, String); with typeIdentityLinkType.PARTICIPANTvoidaddParticipantUser(java.lang.String workObjectId, java.lang.String userId)Convenience shorthand foraddUserIdentityLink(String, String, String); with typeIdentityLinkType.CANDIDATEvoidaddUserIdentityLink(java.lang.String workObjectId, java.lang.String userId, java.lang.String identityLinkType)Involves a user with a work object.WorkObjectcreateWorkObject(java.lang.String definitionKey, java.lang.String parentId, java.lang.String parentType, java.lang.String tenantId)Creates newWorkObjectaccording to provided definitionKey.WorkObjectQuerycreateWorkObjectQuery()Creates a newWorkObjectQueryinstance, that can be used to query the runtime work objects.WorkObjectUpdatercreateWorkObjectUpdater(WorkObject workObject)voiddeleteGroupIdentityLink(java.lang.String workObjectId, java.lang.String groupId, java.lang.String identityLinkType)Removes the association between a group and a work object for the given identityLinkType.voiddeleteParticipantGroup(java.lang.String workObjectId, java.lang.String groupId)Convenience shorthand fordeleteGroupIdentityLink(String, String, String); with typeIdentityLinkType.PARTICIPANTvoiddeleteParticipantUser(java.lang.String workObjectId, java.lang.String userId)Convenience shorthand fordeleteUserIdentityLink(String, String, String); with typeIdentityLinkType.PARTICIPANTvoiddeleteUserIdentityLink(java.lang.String workObjectId, java.lang.String userId, java.lang.String identityLinkType)Removes the association between a user and a work object for the given identityLinkType.voiddeleteWorkObject(java.lang.String workObjectId)Deletes work objectjava.lang.StringgetFirstWorkObjectId(java.lang.String underlyingObjectId, java.lang.String underlyingObjectType)Fetch the firstWorkObjectid from the underlying object type.java.util.List<org.flowable.identitylink.api.IdentityLink>getIdentityLinksForWorkObject(java.lang.String instanceId)Retrieves theIdentityLinks associated with the given work object.java.lang.StringgetParentId(java.lang.String workObjectId)Gets parent identifier for the given workObjectIdvoidremoveVariable(java.lang.String workObjectId, java.lang.String name)Removes variable from a given workObjectvoidupdateVariable(java.lang.String workObjectId, java.lang.String name, java.lang.Object value)Updates/creates a variable for a given workObjectWorkObjectupdateWorkObject(WorkObject workObject)Based on theWorkObject.getId()update workObject attributes.
-
Method Details
-
updateVariable
void updateVariable(java.lang.String workObjectId, java.lang.String name, java.lang.Object value)Updates/creates a variable for a given workObject- Parameters:
workObjectId- workObject identifiername- variable namevalue- new variable value
-
removeVariable
void removeVariable(java.lang.String workObjectId, java.lang.String name)Removes variable from a given workObject- Parameters:
workObjectId- workObject identifiername- of the variable to remove
-
createWorkObjectQuery
WorkObjectQuery createWorkObjectQuery()Creates a newWorkObjectQueryinstance, that can be used to query the runtime work objects. -
createWorkObject
WorkObject createWorkObject(java.lang.String definitionKey, java.lang.String parentId, java.lang.String parentType, java.lang.String tenantId)Creates newWorkObjectaccording to provided definitionKey. DefinitionKey identifies the latest version of theWorkObjectDefinition- Parameters:
definitionKey- definition according which new workObject will be createdparentId- workObject is created as a child of the parentparentType- parent reference type identifiertenantId- tenantId which is used to determine definition- Returns:
- workObject created according to definition
-
updateWorkObject
Based on theWorkObject.getId()update workObject attributes. To update workObject variable useupdateVariable(String, String, Object)- Parameters:
workObject- work object to update- Returns:
- updated work object
- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException- in the case when work Object was not found
-
createWorkObjectUpdater
-
deleteWorkObject
void deleteWorkObject(java.lang.String workObjectId)Deletes work object- Parameters:
workObjectId- work object identifier- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException- n the case when work object does not exist
-
getFirstWorkObjectId
java.lang.String getFirstWorkObjectId(java.lang.String underlyingObjectId, java.lang.String underlyingObjectType)Fetch the firstWorkObjectid from the underlying object type.- Parameters:
underlyingObjectId- underlying object identifierunderlyingObjectType- underlying object relation ship descriptor- Returns:
- the first
WorkObjectid which is the parent of the specified underlying object
-
addUserIdentityLink
void addUserIdentityLink(java.lang.String workObjectId, java.lang.String userId, java.lang.String identityLinkType)Involves a user with a work object. The type of identity link is defined by the given identityLinkType.- Parameters:
workObjectId- id of the work object, cannot be null.userId- id of the user involve, cannot be null.identityLinkType- type of identityLink, cannot be null (@seeIdentityLinkType).- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException- when the work object doesn't exist.
-
addGroupIdentityLink
void addGroupIdentityLink(java.lang.String workObjectId, java.lang.String groupId, java.lang.String identityLinkType)Involves a group with a work object. The type of identityLink is defined by the given identityLink.- Parameters:
workObjectId- id of the work object, cannot be null.groupId- id of the group to involve, cannot be null.identityLinkType- type of identity, cannot be null (@seeIdentityLinkType).- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException- when the work object or group doesn't exist.
-
addParticipantUser
void addParticipantUser(java.lang.String workObjectId, java.lang.String userId)Convenience shorthand foraddUserIdentityLink(String, String, String); with typeIdentityLinkType.CANDIDATE- Parameters:
workObjectId- id of the work object, cannot be null.userId- id of the user to use as candidate, cannot be null.- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException- when the task or user doesn't exist.
-
addParticipantGroup
void addParticipantGroup(java.lang.String workObjectId, java.lang.String groupId)Convenience shorthand foraddGroupIdentityLink(String, String, String); with typeIdentityLinkType.PARTICIPANT- Parameters:
workObjectId- id of the work object, cannot be null.groupId- id of the group to use as candidate, cannot be null.- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException- when the task or group doesn't exist.
-
deleteParticipantUser
void deleteParticipantUser(java.lang.String workObjectId, java.lang.String userId)Convenience shorthand fordeleteUserIdentityLink(String, String, String); with typeIdentityLinkType.PARTICIPANT- Parameters:
workObjectId- id of the work object, cannot be null.userId- id of the user to use as candidate, cannot be null.- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException- when the task or user doesn't exist.
-
deleteParticipantGroup
void deleteParticipantGroup(java.lang.String workObjectId, java.lang.String groupId)Convenience shorthand fordeleteGroupIdentityLink(String, String, String); with typeIdentityLinkType.PARTICIPANT- Parameters:
workObjectId- id of the work object, cannot be null.groupId- id of the group to use as candidate, cannot be null.- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException- when the task or group doesn't exist.
-
deleteUserIdentityLink
void deleteUserIdentityLink(java.lang.String workObjectId, java.lang.String userId, java.lang.String identityLinkType)Removes the association between a user and a work object for the given identityLinkType.- Parameters:
workObjectId- id of the work object, cannot be null.userId- id of the user involve, cannot be null.identityLinkType- type of identityLink, cannot be null (@seeIdentityLinkType).- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException- when the task or user doesn't exist.
-
deleteGroupIdentityLink
void deleteGroupIdentityLink(java.lang.String workObjectId, java.lang.String groupId, java.lang.String identityLinkType)Removes the association between a group and a work object for the given identityLinkType.- Parameters:
workObjectId- id of the work object, cannot be null.groupId- id of the group to involve, cannot be null.identityLinkType- type of identity, cannot be null (@seeIdentityLinkType).- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException- when the task or group doesn't exist.
-
getIdentityLinksForWorkObject
java.util.List<org.flowable.identitylink.api.IdentityLink> getIdentityLinksForWorkObject(java.lang.String instanceId)Retrieves theIdentityLinks associated with the given work object. Such anIdentityLinkinforms how a certain user is involved with a work object. -
getParentId
java.lang.String getParentId(java.lang.String workObjectId)Gets parent identifier for the given workObjectId- Parameters:
workObjectId- child object identifier- Returns:
- parent workObject identifier or null in the case when workObject is root already
- Throws:
org.flowable.common.engine.api.FlowableObjectNotFoundException- when the child workObject does not exist.
-