Skip to content

Commit

Permalink
incubator-kie-issues#1545: Create JPA persistence layer for Human Tasks
Browse files Browse the repository at this point in the history
- fix type
  • Loading branch information
pefernan committed Oct 22, 2024
1 parent 97f4a0a commit aeb593f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,17 +139,17 @@ public Optional<UserTaskTransitionToken> start(UserTaskInstance userTaskInstance
public Optional<UserTaskTransitionToken> claim(UserTaskInstance userTaskInstance, UserTaskTransitionToken token, IdentityProvider identityProvider) {
if (userTaskInstance instanceof DefaultUserTaskInstance defaultUserTaskInstance) {
if (token.data().containsKey(PARAMETER_USER)) {
defaultUserTaskInstance.setActuaOwner((String) token.data().get(PARAMETER_USER));
defaultUserTaskInstance.setActualOwner((String) token.data().get(PARAMETER_USER));
} else {
defaultUserTaskInstance.setActuaOwner(identityProvider.getName());
defaultUserTaskInstance.setActualOwner(identityProvider.getName());
}
}
return Optional.empty();
}

public Optional<UserTaskTransitionToken> release(UserTaskInstance userTaskInstance, UserTaskTransitionToken token, IdentityProvider identityProvider) {
if (userTaskInstance instanceof DefaultUserTaskInstance defaultUserTaskInstance) {
defaultUserTaskInstance.setActuaOwner(null);
defaultUserTaskInstance.setActualOwner(null);
}
return Optional.empty();
}
Expand All @@ -164,7 +164,7 @@ public Optional<UserTaskTransitionToken> skip(UserTaskInstance userTaskInstance,
userTaskInstance.getMetadata().put(PARAMETER_NOTIFY, token.data().get(PARAMETER_NOTIFY));
}
if (userTaskInstance instanceof DefaultUserTaskInstance defaultUserTaskInstance) {
defaultUserTaskInstance.setActuaOwner(identityProvider.getName());
defaultUserTaskInstance.setActualOwner(identityProvider.getName());
}
return Optional.empty();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,17 +138,17 @@ public Optional<UserTaskTransitionToken> start(UserTaskInstance userTaskInstance
public Optional<UserTaskTransitionToken> claim(UserTaskInstance userTaskInstance, UserTaskTransitionToken token, IdentityProvider identityProvider) {
if (userTaskInstance instanceof DefaultUserTaskInstance defaultUserTaskInstance) {
if (token.data().containsKey(PARAMETER_USER)) {
defaultUserTaskInstance.setActuaOwner((String) token.data().get(PARAMETER_USER));
defaultUserTaskInstance.setActualOwner((String) token.data().get(PARAMETER_USER));
} else {
defaultUserTaskInstance.setActuaOwner(identityProvider.getName());
defaultUserTaskInstance.setActualOwner(identityProvider.getName());
}
}
return Optional.empty();
}

public Optional<UserTaskTransitionToken> release(UserTaskInstance userTaskInstance, UserTaskTransitionToken token, IdentityProvider identityProvider) {
if (userTaskInstance instanceof DefaultUserTaskInstance defaultUserTaskInstance) {
defaultUserTaskInstance.setActuaOwner(null);
defaultUserTaskInstance.setActualOwner(null);
}
return Optional.empty();
}
Expand All @@ -163,7 +163,7 @@ public Optional<UserTaskTransitionToken> skip(UserTaskInstance userTaskInstance,
userTaskInstance.getMetadata().put(PARAMETER_NOTIFY, token.data().get(PARAMETER_NOTIFY));
}
if (userTaskInstance instanceof DefaultUserTaskInstance defaultUserTaskInstance) {
defaultUserTaskInstance.setActuaOwner(identityProvider.getName());
defaultUserTaskInstance.setActualOwner(identityProvider.getName());
}
return Optional.empty();
}
Expand Down

0 comments on commit aeb593f

Please sign in to comment.