public interface AnyWorkObjectService extends EntityService<AnyWorkObject>
The service to access the concrete work object management functionality.
Modifier and Type | Method and Description |
---|---|
AnyWorkObject |
apply(GearWorkObjectUpdate update,
String description)
Applies an entity update.
|
void |
cancelEntity(String entityId)
Cancels or terminates any background activities / processes associated with the given work object.
|
void |
completeEntity(String id,
String description)
Completes the given entity by setting its state to
WorkObjectState.STATE_COMPLETED . |
void |
completeWorkObject(String id,
String description)
Completes the specified concrete work object by setting its state to
WorkObjectState.STATE_COMPLETED . |
long |
countWorkObjects(Predicate predicate)
Counts the concrete work objects that match the query with the given predicate.
|
long |
countWorkObjects(Predicate predicate,
SearchScope searchScope)
Counts the concrete work objects that match the query with the given predicate.
|
long |
countWorkObjects(Query query)
Counts the concrete work objects that match the given query.
|
long |
countWorkObjects(Query query,
SearchScope searchScope)
Counts the concrete work objects that match the given query.
|
String |
create(String definitionId)
Creates a new root entity based on the given definition ID.
|
String |
create(String definitionId,
String parentId)
Creates a new child entity based on the given definition ID.
|
AnyWorkObjectModification.Builder |
createModificationBuilder()
Creates a new type-safe modification builder.
|
GearWorkObjectUpdate.Builder |
createUpdateBuilder(String workObjectId)
Creates a new type-safe update builder for the given entity.
|
void |
deleteEntity(String entityId,
String description)
Deletes the given entity with all its variables.
|
void |
deleteVariable(String id,
String name,
String description)
Deletes the variable with the given
name from the entity with given id . |
<V> void |
deleteVariable(String id,
ValueAccessor<V> name,
String description)
Deletes the variable with the given
name from the entity with given id . |
void |
deleteVariables(String entityId,
Collection<String> variables,
String description)
Deletes the variables from the collection of variable
names from the entity with given entityId . |
void |
deleteWorkObject(String workObjectId,
String description)
Deletes the given entity with all its variables.
|
String |
findParentId(AnyWorkObject workObject)
Returns the parent work object.
|
String |
findParentIdByType(AnyWorkObject workObject,
String requiredType)
Returns the closest parent work object of the given type for a given work object.
|
String |
findTopMostParentIdByType(AnyWorkObject workObject,
String requiredType,
boolean includeSelf)
Returns the top-most parent work object of the given type for a given work object.
|
AnyWorkObject |
findWorkObject(Predicate predicate)
Finds the concrete work object that matches the query with the given predicate.
|
AnyWorkObject |
findWorkObject(Predicate predicate,
SearchScope searchScope)
Finds the concrete work object that matches the query with the given predicate.
|
AnyWorkObject |
findWorkObject(Query query)
Finds the concrete work object that matches the given query.
|
AnyWorkObject |
findWorkObject(Query query,
SearchScope searchScope)
Finds the concrete work object that matches the given query.
|
AnyWorkObject |
findWorkObjectByExternalId(String externalId)
Finds the concrete work object with the given external id.
|
AnyWorkObject |
findWorkObjectByExternalId(String externalId,
SearchScope searchScope)
Finds the concrete work object with the given external id in the given scope.
|
AnyWorkObject |
findWorkObjectByGlobalId(String globalId)
Finds the concrete work object with the given global id.
|
AnyWorkObject |
findWorkObjectByGlobalId(String globalId,
SearchScope searchScope)
Finds the concrete work object with the given global id in the given scope.
|
AnyWorkObject |
findWorkObjectById(String id)
Finds the concrete work object with the given concrete work object id.
|
AnyWorkObject |
findWorkObjectById(String id,
SearchScope searchScope)
Finds the concrete work object with the given concrete work object id in the given scope.
|
List<AnyWorkObject> |
findWorkObjects(Predicate predicate)
Finds the concrete work objects that match the query with the given predicate.
|
List<AnyWorkObject> |
findWorkObjects(Predicate predicate,
SearchScope searchScope)
Finds the concrete work objects that match the query with the given predicate.
|
List<AnyWorkObject> |
findWorkObjects(Query query)
Finds the concrete work objects that match the given query.
|
List<AnyWorkObject> |
findWorkObjects(Query query,
SearchScope searchScope)
Finds the concrete work objects that match the given query.
|
String |
getRootId(AnyWorkObject workObject)
Returns the root work object ID for a given work object.
|
<V> V |
getServiceInterface(String providerId,
Class<V> serviceInterfaceClass)
Returns the typed service interface for a given provider ID.
|
<V> List<V> |
getServiceInterfaces(Class<V> serviceInterfaceClass)
Returns all instances of a typed service interface for the current providers.
|
AnyWorkObject |
getWorkObjectByGlobalId(String globalId)
Finds the work object with the given global id.
|
AnyWorkObject |
getWorkObjectByGlobalId(String globalId,
SearchScope searchScope)
Finds the work object with the given global id in the given scope.
|
AnyWorkObject |
getWorkObjectById(String id)
Finds the work object with the given work object id.
|
AnyWorkObject |
getWorkObjectById(String id,
SearchScope searchScope)
Finds the work object with the given work object id in the given scope.
|
void |
putVariable(String id,
String name,
Object value,
String description)
Associates the given variable with the specified entity.
|
<V> void |
putVariable(String id,
ValueAccessor<V> name,
V value,
String description)
Associates the given variable with the specified entity.
|
void |
putVariables(String id,
Map<String,Object> variables,
String description)
Associates the given variables with the specified entity.
|
void |
putVariables(String id,
ValueMap variables,
String description)
Associates the given variables with the specified entity.
|
void |
setAssignedGroup(String id,
String groupId,
String description)
Sets the user to which the specified entity is assigned to.
|
void |
setAssignedUser(String id,
String userId,
String description)
Sets the user to which the specified entity is assigned to.
|
void |
setCandidateGroups(String id,
Set<String> groupIds,
String description)
Sets the candidate groups of the specified entity.
|
void |
setCandidateUsers(String id,
Set<String> userIds,
String description)
Sets the candidate users of the specified entity.
|
void |
setDueTime(String id,
Instant dueTime,
String description)
Sets the due time of the specified entity.
|
void |
setName(String id,
String name,
String description)
Sets the name of the specified entity.
|
void |
setOwner(String id,
String userId,
String description)
Sets the owner of the specified entity.
|
void |
setParent(String id,
String parentId,
String description)
Sets the parent of the specified entity.
|
void |
setPriority(String id,
Integer priority,
String description)
Sets the priority of the specified entity.
|
void |
setResubmissionTime(String id,
Instant resubmissionTime,
String description)
Sets the resubmission time of the specified entity.
|
void |
setState(String id,
String state,
String description)
Sets the
WorkObjectState of the specified entity. |
void |
setSubState(String id,
String state,
String description)
Sets the
WorkObjectState of the specified entity. |
countEntities, countEntities, countEntities, countEntities, create, create, findEntities, findEntities, findEntities, findEntities, findEntity, findEntity, findEntity, findEntity, findEntityByExternalId, findEntityByExternalId, findEntityByGlobalId, findEntityByGlobalId, findEntityById, findEntityById, findIdByExternalId, findIdByExternalId, getEntityByGlobalId, getEntityByGlobalId, getEntityById, getEntityById
AnyWorkObject getWorkObjectById(String id)
Finds the work object with the given work object id. If no work object matches the given id, an exception is thrown.
id
- the id of the work object to findEntityNotFoundException
- if work object cannot be foundAnyWorkObject getWorkObjectById(String id, SearchScope searchScope)
Finds the work object with the given work object id in the given scope. If no work object matches the given id, an exception is thrown.
id
- the id of the work object to findsearchScope
- the scope in which to search for the work objectEntityNotFoundException
- if work object cannot be foundAnyWorkObject getWorkObjectByGlobalId(String globalId)
Finds the work object with the given global id. If no work object matches the given id, an exception is thrown.
globalId
- the global id of the work object to findEntityNotFoundException
- if work object cannot be foundAnyWorkObject getWorkObjectByGlobalId(String globalId, SearchScope searchScope)
Finds the work object with the given global id in the given scope. If no work object matches the given id, an exception is thrown.
globalId
- the global id of the work object to findsearchScope
- the scope in which to search for the work objectEntityNotFoundException
- if work object cannot be foundAnyWorkObject findWorkObjectById(String id)
Finds the concrete work object with the given concrete work object id. If no concrete work object matches the given id, null is returned.
id
- the id of the concrete work object to findAnyWorkObject findWorkObjectById(String id, SearchScope searchScope)
Finds the concrete work object with the given concrete work object id in the given scope. If no concrete work object matches the given id, null is returned.
id
- the id of the concrete work object to findsearchScope
- the scope in which to search for the concrete work objectAnyWorkObject findWorkObjectByGlobalId(String globalId)
Finds the concrete work object with the given global id. If no concrete work object matches the given id, null is returned.
globalId
- the global id of the work object to findAnyWorkObject findWorkObjectByGlobalId(String globalId, SearchScope searchScope)
Finds the concrete work object with the given global id in the given scope. If no concrete work object matches the given id, null is returned.
globalId
- the global id of the work object to findsearchScope
- the scope in which to search for the concrete work objectAnyWorkObject findWorkObjectByExternalId(String externalId)
Finds the concrete work object with the given external id. If no concrete work object matches the given external id, null is returned.
externalId
- the external id of the concrete work object to findAnyWorkObject findWorkObjectByExternalId(String externalId, SearchScope searchScope)
Finds the concrete work object with the given external id in the given scope. If no concrete work object matches the given external id, null is returned.
externalId
- the external id of the concrete work object to findsearchScope
- the scope in which to search for the concrete work objectAnyWorkObject findWorkObject(Predicate predicate)
Finds the concrete work object that matches the query with the given predicate.
If no concrete work object matches the query with the given predicate, null is returned. If more than one concrete work object matches the query with the predicate, an exception is thrown. <p> Note: No sorting, paging, nor query hints are applied. This can become a potential query performance issue.
predicate
- the predicate to apply when executing the queryAnyWorkObject findWorkObject(Predicate predicate, SearchScope searchScope)
Finds the concrete work object that matches the query with the given predicate. If no concrete work object matches the query with the given predicate, null is returned. If more than one concrete work object matches the query with the predicate, an exception is thrown. <p> Note: No sorting, paging, nor query hints are applied. This can become a potential query performance issue.
predicate
- the predicate to apply when executing the querysearchScope
- the scope in which to search for the concrete work objectList<AnyWorkObject> findWorkObjects(Predicate predicate)
Finds the concrete work objects that match the query with the given predicate. If no concrete work object matches the query with the given predicate, an empty list is returned. <p> Note: No sorting, paging, nor query hints are applied. This can become a potential query performance issue.
predicate
- the predicate to apply when executing the queryList<AnyWorkObject> findWorkObjects(Predicate predicate, SearchScope searchScope)
Finds the concrete work objects that match the query with the given predicate. If no concrete work object matches the query with the given predicate, an empty list is returned. <p> Note: No sorting, paging, nor query hints are applied. This can become a potential query performance issue.
predicate
- the predicate to apply when executing the querysearchScope
- the scope in which to search for the concrete work objectslong countWorkObjects(Predicate predicate)
Counts the concrete work objects that match the query with the given predicate.
predicate
- the predicate to apply when executing the querylong countWorkObjects(Predicate predicate, SearchScope searchScope)
Counts the concrete work objects that match the query with the given predicate.
predicate
- the predicate to apply when executing the querysearchScope
- the scope in which to count number of concrete work objectsAnyWorkObject findWorkObject(Query query)
Finds the concrete work object that matches the given query. If no concrete work object matches the given query, null is returned. If more than one concrete work object matches the query, an exception is thrown.
query
- the query to executeAnyWorkObject findWorkObject(Query query, SearchScope searchScope)
Finds the concrete work object that matches the given query. If no concrete work object matches the given query, null is returned. If more than one concrete work object matches the query, an exception is thrown.
query
- the query to executesearchScope
- the scope in which to search for the concrete work objectList<AnyWorkObject> findWorkObjects(Query query)
Finds the concrete work objects that match the given query. If no concrete work object matches the given query, an empty list is returned.
query
- the query to executeList<AnyWorkObject> findWorkObjects(Query query, SearchScope searchScope)
Finds the concrete work objects that match the given query. If no concrete work object matches the given query, an empty list is returned.
query
- the query to executesearchScope
- the scope in which to search for the concrete work objectslong countWorkObjects(Query query)
Counts the concrete work objects that match the given query.
query
- the query to executelong countWorkObjects(Query query, SearchScope searchScope)
Counts the concrete work objects that match the given query.
query
- the query to executesearchScope
- the scope in which to count number of concrete work objectsvoid completeWorkObject(String id, String description)
Completes the specified concrete work object by setting its state to WorkObjectState.STATE_COMPLETED
.
id
- the concrete work object to completedescription
- transient meta information regarding the reason to complete the concrete work objectEntityNotFoundException
- if the given concrete work object cannot be foundvoid deleteWorkObject(String workObjectId, String description)
Deletes the given entity with all its variables. If the entity has children then an IllegalArgumentException
is thrown such that the path of the children is
always valid.
workObjectId
- the work object id to deletedescription
- transient meta information regarding the reason to delete the work objectEntityNotFoundException
- if no work object with given work object id was foundIllegalArgumentException
- if the work object to delete has children.String findParentId(AnyWorkObject workObject)
Returns the parent work object.
null
if the work object has no parentString findParentIdByType(AnyWorkObject workObject, String requiredType)
Returns the closest parent work object of the given type for a given work object.
workObject
- the work objectrequiredType
- the required work object typenull
if there was no matchString findTopMostParentIdByType(AnyWorkObject workObject, String requiredType, boolean includeSelf)
Returns the top-most parent work object of the given type for a given work object.
workObject
- the work objectrequiredType
- the required work object typeincludeSelf
- true
if the starting work object should be included in the searchnull
if there was no matchString getRootId(AnyWorkObject workObject)
Returns the root work object ID for a given work object.
workObject
- the starting work object<V> V getServiceInterface(String providerId, Class<V> serviceInterfaceClass)
Returns the typed service interface for a given provider ID.
V
- the type of the required service interfaceproviderId
- the provider IDserviceInterfaceClass
- the required service interface classIllegalStateException
- if no matching provider is foundClassCastException
- if the actual provider has the wrong type<V> List<V> getServiceInterfaces(Class<V> serviceInterfaceClass)
Returns all instances of a typed service interface for the current providers.
V
- the type of the required service interfaceserviceInterfaceClass
- the required service interface classvoid setState(String id, String state, String description)
Sets the WorkObjectState
of the specified entity.
id
- the id of the entity for which to set the work object statestate
- the work object state to set on the entitydescription
- transient meta information regarding the reason to set the work object state of the entityvoid setSubState(String id, String state, String description)
Sets the WorkObjectState
of the specified entity.
id
- the id of the entity for which to set the work object sub-statestate
- the work object sub-state to set on the entitydescription
- transient meta information regarding the reason to set the work object sub-state of the entityvoid setOwner(String id, String userId, String description)
Sets the owner of the specified entity.
id
- the entity to ownuserId
- the user whom to give ownership of the entitydescription
- transient meta information regarding the reason to give ownership of the entityEntityNotFoundException
- if the given entity cannot be foundvoid setAssignedUser(String id, String userId, String description)
Sets the user to which the specified entity is assigned to.
id
- the entity to assign to a useruserId
- the user whom to assign the entity todescription
- transient meta information regarding the reason to assign the entity to a userEntityNotFoundException
- if no entity with the given id can be foundvoid setAssignedGroup(String id, String groupId, String description)
Sets the user to which the specified entity is assigned to.
id
- the entity to assign to a groupgroupId
- the group whom to assign the entity todescription
- transient meta information regarding the reason to assign the entity to a groupEntityNotFoundException
- if no entity with the given id can be foundvoid setCandidateUsers(String id, Set<String> userIds, String description)
Sets the candidate users of the specified entity.
id
- the entity for which to set the candidate usersuserIds
- the candidate usersdescription
- transient meta information regarding the reason to set the candidate usersEntityNotFoundException
- if no entity with the given id can be foundvoid setCandidateGroups(String id, Set<String> groupIds, String description)
Sets the candidate groups of the specified entity.
id
- the entity for which to set the candidate groupsgroupIds
- the candidate groupsdescription
- transient meta information regarding the reason to set the candidate groupsEntityNotFoundException
- if no entity with the given id can be foundvoid setPriority(String id, Integer priority, String description)
Sets the priority of the specified entity.
id
- the id of the entity for which to set the prioritypriority
- the priority to set on the entitydescription
- transient meta information regarding the reason to set the priority of the entityEntityNotFoundException
- if no entity with the given id can be foundvoid setResubmissionTime(String id, Instant resubmissionTime, String description)
Sets the resubmission time of the specified entity.
id
- the id of the entity for which to set the resubmission timeresubmissionTime
- the resubmission time to set on the entitydescription
- transient meta information regarding the reason to set the resubmission time of the entityEntityNotFoundException
- if no entity with the given id can be foundvoid setDueTime(String id, Instant dueTime, String description)
Sets the due time of the specified entity.
id
- the id of the entity for which to set the due timedueTime
- the due time to set on the entitydescription
- transient meta information regarding the reason to set the due time of the entityEntityNotFoundException
- if no entity with the given id can be foundvoid setParent(String id, String parentId, String description)
Sets the parent of the specified entity.
Note that this will move the current work object and all of its descendants to the new parent. Special care is needed when the descendants contain running processes. If a running process accesses state in its parent work objects then changing the process parent (or grandparent etc.) may mean that the subsequent process execution could behave incorrectly.
id
- the id of the entity for which to set the parentparentId
- the parent to set on the entitydescription
- transient meta information regarding the reason to set the parent of the entityEntityNotFoundException
- if no entity with the given id can be foundvoid completeEntity(String id, String description)
Completes the given entity by setting its state to WorkObjectState.STATE_COMPLETED
.
id
- the entity to completedescription
- transient meta information regarding the reason to complete the entityEntityNotFoundException
- if no entity with the given id can be foundvoid deleteEntity(String entityId, String description)
Deletes the given entity with all its variables. If the entity has children then an IllegalArgumentException
is thrown such that the path of the children is
always valid.
entityId
- the entity id to deletedescription
- transient meta information regarding the reason to delete the work objectEntityNotFoundException
- if no work object with given work object id was foundIllegalArgumentException
- if the work object to delete has children.void cancelEntity(String entityId)
Cancels or terminates any background activities / processes associated with the given work object.
If no background activity is present then this method will have no effect.
entityId
- the work object to be cancelledString create(String definitionId)
Creates a new root entity based on the given definition ID.
The definition provider will be used to manage the entity creation.
definitionId
- the definition IDString create(String definitionId, String parentId)
Creates a new child entity based on the given definition ID.
The definition provider will be used to manage the entity creation.
definitionId
- the definition IDvoid setName(String id, String name, String description)
Sets the name of the specified entity.
id
- the id of the entity for which to set the namename
- the name to set on the entitydescription
- transient meta information regarding the reason to set the name of the entityvoid putVariable(String id, String name, Object value, String description)
Associates the given variable with the specified entity.
id
- the id of the entity for which to associate the variable withname
- the name of the variable to associate with the entityvalue
- the value of the variable to associate with the entitydescription
- transient meta information regarding the reason to associate variable with the entity<V> void putVariable(String id, ValueAccessor<V> name, V value, String description)
Associates the given variable with the specified entity.
V
- the expected transient type of the variableid
- the id of the entity for which to associate the variable withname
- the name of the variable to associate with the entityvalue
- the value of the variable to associate with the entitydescription
- transient meta information regarding the reason to associate variable with the entityvoid putVariables(String id, Map<String,Object> variables, String description)
Associates the given variables with the specified entity.
id
- the id of the entity for which to associate the variables withvariables
- the variables to associate with the entitydescription
- transient meta information regarding the reason to associate variables with the entityvoid putVariables(String id, ValueMap variables, String description)
Associates the given variables with the specified entity.
id
- the id of the entity for which to associate the variables withvariables
- the variables to associate with the entitydescription
- transient meta information regarding the reason to associate variables with the entityvoid deleteVariable(String id, String name, String description)
Deletes the variable with the given name
from the entity with given id
. In the case when variable does not exist no action is taken.
id
- the entity id from which variable is deletedname
- the variable namedescription
- transient meta information regarding the reason to delete variable from the entityEntityNotFoundException
- if the given entity cannot be found<V> void deleteVariable(String id, ValueAccessor<V> name, String description)
Deletes the variable with the given name
from the entity with given id
. In the case when variable does not exist no action is taken.
id
- the entity globalId from which variable is deletedname
- the variable namedescription
- transient meta information regarding the reason to delete variable from the entityEntityNotFoundException
- if the given entity cannot be foundvoid deleteVariables(String entityId, Collection<String> variables, String description)
Deletes the variables from the collection of variable names
from the entity with given entityId
. In the case when variable does not exist no action
is taken.
entityId
- the entity id from which variable is deletedvariables
- the collection of variable names to deletedescription
- transient meta information regarding the reason to delete variable from the entityEntityNotFoundException
- if the given entity cannot be foundAnyWorkObjectModification.Builder createModificationBuilder()
Creates a new type-safe modification builder.
GearWorkObjectUpdate.Builder createUpdateBuilder(String workObjectId)
Creates a new type-safe update builder for the given entity.
workObjectId
- the work object IDAnyWorkObject apply(GearWorkObjectUpdate update, String description)
Applies an entity update.
update
- the update to be applieddescription
- transient meta information regarding the reason for the changeCopyright © 2010 - 2019 edorasware ag. All Rights Reserved.