-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reimplement workers recon & state deletion
This is a preliminary reimplementation of GUI actions of workers reconciliation + and worker and/or activity state deletion.
- Loading branch information
Showing
11 changed files
with
409 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
...chema/src/main/java/com/evolveum/midpoint/schema/util/task/TreeTransformingProcessor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
/* | ||
* Copyright (C) 2010-2021 Evolveum and contributors | ||
* | ||
* This work is dual-licensed under the Apache License 2.0 | ||
* and European Union Public License. See LICENSE file for details. | ||
*/ | ||
|
||
package com.evolveum.midpoint.schema.util.task; | ||
|
||
import com.evolveum.midpoint.schema.util.task.ActivityTreeUtil.ActivityStateTransformer; | ||
import com.evolveum.midpoint.util.TreeNode; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.ActivityStateType; | ||
import com.evolveum.midpoint.xml.ns._public.common.common_3.TaskType; | ||
|
||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.List; | ||
|
||
class TreeTransformingProcessor<X> implements ActivityTreeUtil.ActivityStateProcessor { | ||
|
||
@NotNull private final ActivityStateTransformer<X> transformer; | ||
@NotNull private TreeNode<X> currentNode; | ||
|
||
TreeTransformingProcessor(@NotNull ActivityStateTransformer<X> transformer, @NotNull TreeNode<X> root) { | ||
this.transformer = transformer; | ||
this.currentNode = root; | ||
} | ||
|
||
@Override | ||
public void process(@NotNull ActivityPath path, @Nullable ActivityStateType state, | ||
@Nullable List<ActivityStateType> workerStates, @NotNull TaskType task) { | ||
currentNode.setUserObject( | ||
transformer.transform(path, state, workerStates, task)); | ||
} | ||
|
||
@Override | ||
public void toNewChild(@NotNull ActivityStateType childState) { | ||
TreeNode<X> child = new TreeNode<>(); | ||
currentNode.add(child); | ||
currentNode = child; | ||
} | ||
|
||
@Override | ||
public void toParent() { | ||
currentNode = currentNode.getParent(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.