Skip to content

Commit

Permalink
fix constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
elguardian committed Sep 9, 2024
1 parent 2e61cc3 commit 5da2bfa
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,14 +138,16 @@ static public Optional<WorkItemTransition> userTaskActivateWorkItemHandler(Kogit
instance.setTaskPriority(priorityInteger);
instance.setExternalReferenceId(workItem.getStringId());
instance.setMetadata("ProcessId", workItem.getProcessInstance().getProcessId());
if (workItem instanceof InternalKogitoWorkItem ikw) {
ikw.setExternalReferenceId(instance.getId());
}


instance.setExternalReferenceId(workItem.getStringId());
instance.assign();
instance.transition(instance.createTransitionToken("activate", emptyMap()));
userTask.instances().update(instance);
if (workItem instanceof InternalKogitoWorkItem ikw) {
ikw.setExternalReferenceId(instance.getId());
ikw.setActualOwner(instance.getActualOwner());
}
if (instance.getActualOwner() == null) {
return Optional.empty();
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,13 @@ public class DefaultUserTaskInstance implements UserTaskInstance {

public DefaultUserTaskInstance() {
this.metadata = new HashMap<>();
this.attachments = new ArrayList<>();
this.comments = new ArrayList<>();
this.potentialUsers = new HashSet<>();
this.potentialGroups = new HashSet<>();
this.adminUsers = new HashSet<>();
this.adminGroups = new HashSet<>();
this.excludedUsers = new HashSet<>();
}

public DefaultUserTaskInstance(UserTask userTask) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ public void completeTask() throws JsonProcessingException {
}

@Test
@Disabled("Revisited after ht endpoints")
public void completeProcess() throws JsonProcessingException {
/// /processes/approvals
var id = appRoot.get(ProcessIds.class).get("approvals");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ void testGetNodeInstances() {
.statusCode(200)
.body("$.size()", is(2))
.body("$", hasItems(hasEntry("name", "Hello1"), hasEntry("name", "Hello2")))
.body("[0].state", is(0))
.body("[1].state", is(0));
.body("[0].state", is(1))
.body("[1].state", is(1));
}

@Test
Expand Down

0 comments on commit 5da2bfa

Please sign in to comment.