Class ActivityState
java.lang.Object
com.evolveum.midpoint.repo.common.activity.run.state.ActivityState
- All Implemented Interfaces:
DebugDumpable
- Direct Known Subclasses:
CurrentActivityState
,OtherActivityState
-
Field Summary
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addDeleteItemRealValues
(@NotNull ItemPath path, @NotNull Collection<?> valuesToAdd, @NotNull Collection<?> valuesToDelete) DO NOT use for setting work state items because of dynamic typing of the work state container value.debugDump
(int indent) protected abstract void
debugDumpExtra
(StringBuilder sb, int indent) void
Flushes pending task modifications.void
Flushes pending task modifications.abstract @NotNull ActivityPath
static @NotNull ActivityState
getActivityStateDownwards
(@NotNull ActivityPath activityPath, @NotNull Task task, @NotNull QName workStateTypeName, @NotNull CommonTaskBeans beans, OperationResult result) Gets the state of the given activity, starting from the `task` and going downwards.Returns an iterator over activity states, from the parent of the current activity to the root.static @NotNull ActivityState
getActivityStateUpwards
(@NotNull ActivityPath activityPath, @NotNull Task task, @Nullable QName workStateTypeName, @NotNull CommonTaskBeans beans, OperationResult result) Returns activity state for given path, crawling from the current task upwards.@NotNull ActivityState
getCurrentActivityStateInParentTask
(boolean fresh, @NotNull QName workStateTypeName, @Nullable OperationResult result) Returns the state of the current activity in the parent task.protected @NotNull String
@NotNull ActivityState
getParentActivityState
(@Nullable QName workStateTypeName, OperationResult result) Returns the state of the _parent activity_, e.g.<T> T
getPropertyRealValue
(ItemPath path, Class<T> expectedType) @Nullable String
@Nullable ObjectReferenceType
protected abstract @NotNull Task
getTask()
abstract @Nullable ComplexTypeDefinition
<T> T
getWorkStateItemRealValueClone
(ItemPath path, Class<T> expectedType) <T> T
getWorkStatePropertyRealValue
(ItemPath path, Class<T> expectedType) incrementCounters
(ExecutionSupport.CountersGroup counterGroup, @NotNull Collection<String> countersIdentifiers, @NotNull OperationResult result) boolean
TODOboolean
boolean
boolean
isWorker()
void
setItemRealValues
(ItemPath path, Object... values) DO NOT use for setting work state items because of dynamic typing of the work state container value.void
setItemRealValuesCollection
(ItemPath path, Collection<?> values) DO NOT use for setting work state items because of dynamic typing of the work state container value.void
void
void
setWorkStateItemRealValues
(ItemPath path, ItemDefinition<?> explicitDefinition, Object... values) void
setWorkStateItemRealValues
(ItemPath path, Object... values) toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.evolveum.midpoint.util.DebugDumpable
debugDump, debugDumpLazily, debugDumpLazily
-
Field Details
-
beans
-
-
Constructor Details
-
ActivityState
-
-
Method Details
-
getRealizationState
-
isComplete
public boolean isComplete()TODO -
getRealizationStartTimestamp
-
getResultStatus
-
getBucketingRole
-
isWorker
public boolean isWorker() -
isScavenger
public boolean isScavenger() -
getPropertyRealValue
-
setItemRealValues
DO NOT use for setting work state items because of dynamic typing of the work state container value.- Throws:
ActivityRunException
-
setItemRealValuesCollection
public void setItemRealValuesCollection(ItemPath path, Collection<?> values) throws ActivityRunException DO NOT use for setting work state items because of dynamic typing of the work state container value.- Throws:
ActivityRunException
-
addDeleteItemRealValues
public void addDeleteItemRealValues(@NotNull @NotNull ItemPath path, @NotNull @NotNull Collection<?> valuesToAdd, @NotNull @NotNull Collection<?> valuesToDelete) throws ActivityRunException DO NOT use for setting work state items because of dynamic typing of the work state container value.- Throws:
ActivityRunException
-
flushPendingTaskModifications
public void flushPendingTaskModifications(OperationResult result) throws SchemaException, ObjectNotFoundException, ObjectAlreadyExistsException Flushes pending task modifications. Note for implementers: this method should be equivalent to a direct call toTask.flushPendingModifications(OperationResult)
. -
flushPendingTaskModificationsChecked
public void flushPendingTaskModificationsChecked(OperationResult result) throws ActivityRunException Flushes pending task modifications. Note for implementers: this method should be equivalent to a direct call toTask.flushPendingModifications(OperationResult)
.- Throws:
ActivityRunException
-
getWorkStateComplexTypeDefinition
-
getWorkStatePropertyRealValue
-
getWorkStateItemRealValueClone
-
getWorkStateReferenceRealValue
-
getWorkStateReferenceRealValues
-
setWorkStateItemRealValues
- Throws:
SchemaException
-
setWorkStateItemRealValues
public void setWorkStateItemRealValues(ItemPath path, ItemDefinition<?> explicitDefinition, Object... values) throws SchemaException - Parameters:
explicitDefinition
- If present, we do not try to derive the definition from work state CTD.- Throws:
SchemaException
-
getTask
-
setSimulationResultOid
- Throws:
ActivityRunException
-
setSimulationResultCreated
- Throws:
ActivityRunException
-
getSimulationResultRef
-
getSimulationResultOid
-
isSimulationResultCreated
public boolean isSimulationResultCreated() -
toString
-
debugDump
- Specified by:
debugDump
in interfaceDebugDumpable
-
debugDumpExtra
-
getEnhancedClassName
-
getParentActivityState
@NotNull public @NotNull ActivityState getParentActivityState(@Nullable @Nullable QName workStateTypeName, OperationResult result) throws SchemaException, ObjectNotFoundException Returns the state of the _parent activity_, e.g. operations completion sub-activity -> reconciliation activity. -
getActivityStatesUpwardsForParent
@Experimental public Iterable<ActivityState> getActivityStatesUpwardsForParent(OperationResult result) Returns an iterator over activity states, from the parent of the current activity to the root. Note that the _work_ states must either exist, or must not be modified by the caller after obtaining (as we don't know their type - at least for now). The idea is to encapsulate the crawling logic, while avoiding the (eventual) task fetch operations if they are not really needed. BEWARE: TheOperationResult
instance is buried into the iterator, and used withinIterator.next()
calls. This is quite dangerous. Maybe we should not do this at all. The best use of this method is when the result is consumed (iterated through) just after it is obtained. That way you avoid the risk of usingOperationResult
instance at an unexpected place. -
getActivityStateUpwards
@NotNull public static @NotNull ActivityState getActivityStateUpwards(@NotNull @NotNull ActivityPath activityPath, @NotNull @NotNull Task task, @Nullable @Nullable QName workStateTypeName, @NotNull @NotNull CommonTaskBeans beans, OperationResult result) throws SchemaException, ObjectNotFoundException Returns activity state for given path, crawling from the current task upwards.- Parameters:
activityPath
- Path to activity for which to obtain activity state.task
- Task where to start searching.workStateTypeName
- Expected type of the work state.- Throws:
SchemaException
ObjectNotFoundException
-
getCurrentActivityStateInParentTask
@NotNull public @NotNull ActivityState getCurrentActivityStateInParentTask(boolean fresh, @NotNull @NotNull QName workStateTypeName, @Nullable @Nullable OperationResult result) throws SchemaException, ObjectNotFoundException Returns the state of the current activity in the parent task. Assumes that it exists.- Parameters:
fresh
- true if we always need to load the parent task from repository; false if we can use cached version (created when the running task started)result
- Can be null if we are 100% sure it will not be used.- Throws:
SchemaException
ObjectNotFoundException
-
getActivityStateDownwards
@NotNull public static @NotNull ActivityState getActivityStateDownwards(@NotNull @NotNull ActivityPath activityPath, @NotNull @NotNull Task task, @NotNull @NotNull QName workStateTypeName, @NotNull @NotNull CommonTaskBeans beans, OperationResult result) throws SchemaException, ObjectNotFoundException Gets the state of the given activity, starting from the `task` and going downwards. UNTESTED. Use with care. TODO cleanup and test thoroughly -
getActivityPath
-
incrementCounters
public Map<String,Integer> incrementCounters(@NotNull ExecutionSupport.CountersGroup counterGroup, @NotNull @NotNull Collection<String> countersIdentifiers, @NotNull @NotNull OperationResult result) throws SchemaException, ObjectNotFoundException, ObjectAlreadyExistsException
-