Class WorkObjectServiceImpl
java.lang.Object
org.flowable.common.engine.impl.service.CommonServiceImpl<C>
org.flowable.common.engine.impl.service.CommonEngineServiceImpl<WorkObjectEngineConfiguration>
com.flowable.workobject.engine.impl.WorkObjectServiceImpl
- All Implemented Interfaces:
WorkObjectService
public class WorkObjectServiceImpl extends org.flowable.common.engine.impl.service.CommonEngineServiceImpl<WorkObjectEngineConfiguration> implements WorkObjectService
- Author:
- Tijs Rademakers
-
Field Summary
-
Constructor Summary
Constructors Constructor Description WorkObjectServiceImpl(WorkObjectEngineConfiguration engineConfig)
-
Method Summary
Modifier and Type Method Description void
addGroupIdentityLink(java.lang.String workObjectId, java.lang.String groupId, java.lang.String identityLinkType)
Involves a group with a work object.void
addParticipantGroup(java.lang.String workObjectId, java.lang.String groupId)
Convenience shorthand forWorkObjectService.addGroupIdentityLink(String, String, String)
; with typeIdentityLinkType.PARTICIPANT
void
addParticipantUser(java.lang.String workObjectId, java.lang.String userId)
Convenience shorthand forWorkObjectService.addUserIdentityLink(String, String, String)
; with typeIdentityLinkType.CANDIDATE
void
addUserIdentityLink(java.lang.String workObjectId, java.lang.String userId, java.lang.String identityLinkType)
Involves a user with a work object.WorkObject
createWorkObject(java.lang.String definitionKey, java.lang.String parentId, java.lang.String parentType, java.lang.String tenantId)
Creates newWorkObject
according to provided definitionKey.WorkObjectQuery
createWorkObjectQuery()
Creates a newWorkObjectQuery
instance, that can be used to query the runtime work objects.WorkObjectUpdater
createWorkObjectUpdater(WorkObject workObject)
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.void
deleteParticipantGroup(java.lang.String workObjectId, java.lang.String groupId)
Convenience shorthand forWorkObjectService.deleteGroupIdentityLink(String, String, String)
; with typeIdentityLinkType.PARTICIPANT
void
deleteParticipantUser(java.lang.String workObjectId, java.lang.String userId)
Convenience shorthand forWorkObjectService.deleteUserIdentityLink(String, String, String)
; with typeIdentityLinkType.PARTICIPANT
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.void
deleteWorkObject(java.lang.String workObjectId)
Deletes work objectjava.lang.String
getFirstWorkObjectId(java.lang.String underlyingObjectId, java.lang.String underlyingObjectType)
Fetch the firstWorkObject
id from the underlying object type.java.util.List<org.flowable.identitylink.api.IdentityLink>
getIdentityLinksForWorkObject(java.lang.String instanceId)
Retrieves theIdentityLink
s associated with the given work object.java.lang.String
getParentId(java.lang.String workObjectId)
Gets parent identifier for the given workObjectIdvoid
removeVariable(java.lang.String workObjectId, java.lang.String name)
Removes variable from a given workObjectvoid
updateVariable(java.lang.String workObjectId, java.lang.String name, java.lang.Object value)
Updates/creates a variable for a given workObjectWorkObject
updateWorkObject(WorkObject workObject)
Based on theWorkObject.getId()
update workObject attributes.Methods inherited from class org.flowable.common.engine.impl.service.CommonEngineServiceImpl
getCommandExecutor, setCommandExecutor
-
Constructor Details
-
Method Details
-
updateVariable
public void updateVariable(java.lang.String workObjectId, java.lang.String name, java.lang.Object value)Description copied from interface:WorkObjectService
Updates/creates a variable for a given workObject- Specified by:
updateVariable
in interfaceWorkObjectService
- Parameters:
workObjectId
- workObject identifiername
- variable namevalue
- new variable value
-
removeVariable
public void removeVariable(java.lang.String workObjectId, java.lang.String name)Description copied from interface:WorkObjectService
Removes variable from a given workObject- Specified by:
removeVariable
in interfaceWorkObjectService
- Parameters:
workObjectId
- workObject identifiername
- of the variable to remove
-
createWorkObjectQuery
Description copied from interface:WorkObjectService
Creates a newWorkObjectQuery
instance, that can be used to query the runtime work objects.- Specified by:
createWorkObjectQuery
in interfaceWorkObjectService
-
createWorkObject
public WorkObject createWorkObject(java.lang.String definitionKey, java.lang.String parentId, java.lang.String parentType, java.lang.String tenantId)Description copied from interface:WorkObjectService
Creates newWorkObject
according to provided definitionKey. DefinitionKey identifies the latest version of theWorkObjectDefinition
- Specified by:
createWorkObject
in interfaceWorkObjectService
- 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
Description copied from interface:WorkObjectService
Based on theWorkObject.getId()
update workObject attributes. To update workObject variable useWorkObjectService.updateVariable(String, String, Object)
- Specified by:
updateWorkObject
in interfaceWorkObjectService
- Parameters:
workObject
- work object to update- Returns:
- updated work object
-
deleteWorkObject
public void deleteWorkObject(java.lang.String workObjectId)Description copied from interface:WorkObjectService
Deletes work object- Specified by:
deleteWorkObject
in interfaceWorkObjectService
- Parameters:
workObjectId
- work object identifier
-
getFirstWorkObjectId
public java.lang.String getFirstWorkObjectId(java.lang.String underlyingObjectId, java.lang.String underlyingObjectType)Description copied from interface:WorkObjectService
Fetch the firstWorkObject
id from the underlying object type.- Specified by:
getFirstWorkObjectId
in interfaceWorkObjectService
- Parameters:
underlyingObjectId
- underlying object identifierunderlyingObjectType
- underlying object relation ship descriptor- Returns:
- the first
WorkObject
id which is the parent of the specified underlying object
-
createWorkObjectUpdater
- Specified by:
createWorkObjectUpdater
in interfaceWorkObjectService
-
addUserIdentityLink
public void addUserIdentityLink(java.lang.String workObjectId, java.lang.String userId, java.lang.String identityLinkType)Description copied from interface:WorkObjectService
Involves a user with a work object. The type of identity link is defined by the given identityLinkType.- Specified by:
addUserIdentityLink
in interfaceWorkObjectService
- 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
).
-
addGroupIdentityLink
public void addGroupIdentityLink(java.lang.String workObjectId, java.lang.String groupId, java.lang.String identityLinkType)Description copied from interface:WorkObjectService
Involves a group with a work object. The type of identityLink is defined by the given identityLink.- Specified by:
addGroupIdentityLink
in interfaceWorkObjectService
- 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
).
-
addParticipantUser
public void addParticipantUser(java.lang.String workObjectId, java.lang.String userId)Description copied from interface:WorkObjectService
Convenience shorthand forWorkObjectService.addUserIdentityLink(String, String, String)
; with typeIdentityLinkType.CANDIDATE
- Specified by:
addParticipantUser
in interfaceWorkObjectService
- Parameters:
workObjectId
- id of the work object, cannot be null.userId
- id of the user to use as candidate, cannot be null.
-
addParticipantGroup
public void addParticipantGroup(java.lang.String workObjectId, java.lang.String groupId)Description copied from interface:WorkObjectService
Convenience shorthand forWorkObjectService.addGroupIdentityLink(String, String, String)
; with typeIdentityLinkType.PARTICIPANT
- Specified by:
addParticipantGroup
in interfaceWorkObjectService
- Parameters:
workObjectId
- id of the work object, cannot be null.groupId
- id of the group to use as candidate, cannot be null.
-
deleteParticipantUser
public void deleteParticipantUser(java.lang.String workObjectId, java.lang.String userId)Description copied from interface:WorkObjectService
Convenience shorthand forWorkObjectService.deleteUserIdentityLink(String, String, String)
; with typeIdentityLinkType.PARTICIPANT
- Specified by:
deleteParticipantUser
in interfaceWorkObjectService
- Parameters:
workObjectId
- id of the work object, cannot be null.userId
- id of the user to use as candidate, cannot be null.
-
deleteParticipantGroup
public void deleteParticipantGroup(java.lang.String workObjectId, java.lang.String groupId)Description copied from interface:WorkObjectService
Convenience shorthand forWorkObjectService.deleteGroupIdentityLink(String, String, String)
; with typeIdentityLinkType.PARTICIPANT
- Specified by:
deleteParticipantGroup
in interfaceWorkObjectService
- Parameters:
workObjectId
- id of the work object, cannot be null.groupId
- id of the group to use as candidate, cannot be null.
-
deleteUserIdentityLink
public void deleteUserIdentityLink(java.lang.String workObjectId, java.lang.String userId, java.lang.String identityLinkType)Description copied from interface:WorkObjectService
Removes the association between a user and a work object for the given identityLinkType.- Specified by:
deleteUserIdentityLink
in interfaceWorkObjectService
- 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
).
-
deleteGroupIdentityLink
public void deleteGroupIdentityLink(java.lang.String workObjectId, java.lang.String groupId, java.lang.String identityLinkType)Description copied from interface:WorkObjectService
Removes the association between a group and a work object for the given identityLinkType.- Specified by:
deleteGroupIdentityLink
in interfaceWorkObjectService
- 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
).
-
getIdentityLinksForWorkObject
public java.util.List<org.flowable.identitylink.api.IdentityLink> getIdentityLinksForWorkObject(java.lang.String instanceId)Description copied from interface:WorkObjectService
Retrieves theIdentityLink
s associated with the given work object. Such anIdentityLink
informs how a certain user is involved with a work object.- Specified by:
getIdentityLinksForWorkObject
in interfaceWorkObjectService
-
getParentId
public java.lang.String getParentId(java.lang.String workObjectId)Description copied from interface:WorkObjectService
Gets parent identifier for the given workObjectId- Specified by:
getParentId
in interfaceWorkObjectService
- Parameters:
workObjectId
- child object identifier- Returns:
- parent workObject identifier or null in the case when workObject is root already
-