diff --git a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/helpers/OperationsHelper.java b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/helpers/OperationsHelper.java index 0ec2ca461ee..3e5ea21c3bb 100644 --- a/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/helpers/OperationsHelper.java +++ b/model/model-impl/src/main/java/com/evolveum/midpoint/model/impl/scripting/helpers/OperationsHelper.java @@ -144,7 +144,7 @@ public void recordEnd(ExecutionContext context, ObjectType objectType, long star context.getTask(), objectType); } if (context.getTask() != null) { - context.getTask().setProgress(context.getTask().getProgress() + 1); + context.getTask().incrementProgressAndStoreStatsIfNeeded(); } } } diff --git a/samples/tasks/bulk-actions/script-objects-delay.xml b/samples/tasks/bulk-actions/script-objects-delay.xml new file mode 100644 index 00000000000..327116bf228 --- /dev/null +++ b/samples/tasks/bulk-actions/script-objects-delay.xml @@ -0,0 +1,54 @@ + + + + + + + Waits on each object + + + + ObjectType + + execute-script + + script + + + log.info('Waiting on: {}', input) + Thread.sleep(15000) + log.info('Done waiting on: {}', input) + + + + + + + + + runnable + + BulkActions + http://midpoint.evolveum.com/xml/ns/public/model/scripting/handler-3 + single + + +