-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[incubator-kie-issues-1484] Create endpoints for user task
- Loading branch information
1 parent
34389fe
commit 478fbef
Showing
59 changed files
with
2,448 additions
and
1,187 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
35 changes: 35 additions & 0 deletions
35
api/kogito-api/src/main/java/org/kie/kogito/usertask/UserTaskAssignmentStrategy.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,35 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.kie.kogito.usertask; | ||
|
||
import java.util.Optional; | ||
|
||
import org.kie.kogito.auth.IdentityProvider; | ||
|
||
public interface UserTaskAssignmentStrategy { | ||
|
||
static final String DEFAULT_NAME = "default"; | ||
|
||
default String getName() { | ||
return getClass().getName(); | ||
} | ||
|
||
Optional<String> computeAssigment(UserTaskInstance userTaskInstance, IdentityProvider identityProvider); | ||
|
||
} |
32 changes: 32 additions & 0 deletions
32
api/kogito-api/src/main/java/org/kie/kogito/usertask/UserTaskAssignmentStrategyConfig.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,32 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.kie.kogito.usertask; | ||
|
||
import java.util.List; | ||
|
||
public interface UserTaskAssignmentStrategyConfig { | ||
|
||
List<UserTaskAssignmentStrategy> userTaskAssignmentStrategies(); | ||
|
||
UserTaskAssignmentStrategy forName(String name); | ||
|
||
default UserTaskAssignmentStrategy defaultUserTaskAssignmentStrategy() { | ||
return forName(UserTaskAssignmentStrategy.DEFAULT_NAME); | ||
} | ||
} |
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
62 changes: 62 additions & 0 deletions
62
api/kogito-api/src/main/java/org/kie/kogito/usertask/UserTaskService.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,62 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.kie.kogito.usertask; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Optional; | ||
|
||
import org.kie.kogito.auth.IdentityProvider; | ||
import org.kie.kogito.usertask.model.Attachment; | ||
import org.kie.kogito.usertask.model.Comment; | ||
import org.kie.kogito.usertask.view.UserTaskTransitionView; | ||
import org.kie.kogito.usertask.view.UserTaskView; | ||
|
||
public interface UserTaskService { | ||
|
||
List<UserTaskView> list(IdentityProvider identity); | ||
|
||
Optional<UserTaskView> transition(String taskId, String transitionId, Map<String, Object> data, IdentityProvider identity); | ||
|
||
List<UserTaskTransitionView> allowedTransitions(String taskId, IdentityProvider identity); | ||
|
||
Optional<UserTaskView> setOutputs(String taskId, Map<String, Object> data, IdentityProvider identity); | ||
|
||
Optional<UserTaskView> setInputs(String taskId, Map<String, Object> data, IdentityProvider identity); | ||
|
||
List<Comment> getComments(String taskId, IdentityProvider identity); | ||
|
||
Optional<Comment> getComment(String taskId, String commentId, IdentityProvider identity); | ||
|
||
Optional<Comment> addComment(String taskId, Comment comment, IdentityProvider identity); | ||
|
||
Optional<Comment> updateComment(String taskId, Comment comment, IdentityProvider identity); | ||
|
||
Optional<Comment> removeComment(String taskId, String commentId, IdentityProvider identity); | ||
|
||
List<Attachment> getAttachments(String taskId, IdentityProvider identity); | ||
|
||
Optional<Attachment> getAttachment(String taskId, String commentId, IdentityProvider identity); | ||
|
||
Optional<Attachment> addAttachment(String taskId, Attachment comment, IdentityProvider identity); | ||
|
||
Optional<Attachment> updateAttachment(String taskId, Attachment comment, IdentityProvider identity); | ||
|
||
Optional<Attachment> removeAttachment(String taskId, String commentId, IdentityProvider identity); | ||
} |
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
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
29 changes: 29 additions & 0 deletions
29
...gito-api/src/main/java/org/kie/kogito/usertask/lifecycle/UserTaskTransitionException.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,29 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.kie.kogito.usertask.lifecycle; | ||
|
||
public class UserTaskTransitionException extends RuntimeException { | ||
|
||
private static final long serialVersionUID = -9127576077607542859L; | ||
|
||
public UserTaskTransitionException(String msg) { | ||
super(msg); | ||
} | ||
|
||
} |
Oops, something went wrong.