-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feature/tasklist support custom fields (#415)
closes #406 **Changes** - Taskvariables named in a specific pattern (e.g. `miranum_task_***` are automatically added to miranum tasklist as custom fields - The prefix for variables is customizable (default `miranum_task_`)
- Loading branch information
Showing
22 changed files
with
461 additions
and
35 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
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
46 changes: 46 additions & 0 deletions
46
examples/single-deployment-unit-example/src/main/resources/processes/tasklist-example.bpmn
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,46 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:camunda="http://camunda.org/schema/1.0/bpmn" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:modeler="http://camunda.org/schema/modeler/1.0" id="Definitions_1xyw0eh" targetNamespace="http://bpmn.io/schema/bpmn" exporter="Camunda Modeler" exporterVersion="5.25.0" modeler:executionPlatform="Camunda Platform" modeler:executionPlatformVersion="7.21.0"> | ||
<bpmn:process id="tasklist-example" name="Tasklist Example" isExecutable="true"> | ||
<bpmn:startEvent id="StartEvent_1"> | ||
<bpmn:outgoing>Flow_1v8rmgf</bpmn:outgoing> | ||
</bpmn:startEvent> | ||
<bpmn:sequenceFlow id="Flow_1v8rmgf" sourceRef="StartEvent_1" targetRef="Activity_0iqcr9j" /> | ||
<bpmn:endEvent id="Event_1mikqwy"> | ||
<bpmn:incoming>Flow_1bsx7k3</bpmn:incoming> | ||
</bpmn:endEvent> | ||
<bpmn:sequenceFlow id="Flow_1bsx7k3" sourceRef="Activity_0iqcr9j" targetRef="Event_1mikqwy" /> | ||
<bpmn:userTask id="Activity_0iqcr9j" name="Example Usertask" camunda:candidateGroups="group1"> | ||
<bpmn:extensionElements> | ||
<camunda:inputOutput> | ||
<camunda:inputParameter name="miranum_task_form">ExampleForm</camunda:inputParameter> | ||
<camunda:inputParameter name="miranum_task_description">This is a example description</camunda:inputParameter> | ||
<camunda:inputParameter name="miranum_task_type">example</camunda:inputParameter> | ||
<camunda:inputParameter name="miranum_task_foo">bar</camunda:inputParameter> | ||
</camunda:inputOutput> | ||
</bpmn:extensionElements> | ||
<bpmn:incoming>Flow_1v8rmgf</bpmn:incoming> | ||
<bpmn:outgoing>Flow_1bsx7k3</bpmn:outgoing> | ||
</bpmn:userTask> | ||
</bpmn:process> | ||
<bpmndi:BPMNDiagram id="BPMNDiagram_1"> | ||
<bpmndi:BPMNPlane id="BPMNPlane_1" bpmnElement="tasklist-example"> | ||
<bpmndi:BPMNShape id="_BPMNShape_StartEvent_2" bpmnElement="StartEvent_1"> | ||
<dc:Bounds x="179" y="99" width="36" height="36" /> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNShape id="Event_1mikqwy_di" bpmnElement="Event_1mikqwy"> | ||
<dc:Bounds x="632" y="99" width="36" height="36" /> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNShape id="Activity_1guszed_di" bpmnElement="Activity_0iqcr9j"> | ||
<dc:Bounds x="370" y="77" width="100" height="80" /> | ||
</bpmndi:BPMNShape> | ||
<bpmndi:BPMNEdge id="Flow_1v8rmgf_di" bpmnElement="Flow_1v8rmgf"> | ||
<di:waypoint x="215" y="117" /> | ||
<di:waypoint x="370" y="117" /> | ||
</bpmndi:BPMNEdge> | ||
<bpmndi:BPMNEdge id="Flow_1bsx7k3_di" bpmnElement="Flow_1bsx7k3"> | ||
<di:waypoint x="470" y="117" /> | ||
<di:waypoint x="632" y="117" /> | ||
</bpmndi:BPMNEdge> | ||
</bpmndi:BPMNPlane> | ||
</bpmndi:BPMNDiagram> | ||
</bpmn:definitions> |
33 changes: 33 additions & 0 deletions
33
examples/single-deployment-unit-example/src/test/resources/tasklist.http
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,33 @@ | ||
### Get Access Token | ||
POST http://keycloak:9090/auth/realms/miranum/protocol/openid-connect/token | ||
Content-Type: application/x-www-form-urlencoded | ||
|
||
grant_type = password & | ||
client_secret = s3creT & | ||
client_id = miranum & | ||
username = [email protected] & | ||
password = test | ||
|
||
> {% | ||
client.global.set("access_token", response.body.access_token); | ||
%} | ||
|
||
### Get Group Tasks for group1 | ||
GET http://localhost:8083/rest/task/group/group1 | ||
Content-Type: application/json | ||
Authorization: Bearer {{ access_token }} | ||
|
||
> {% | ||
var firstTaskId = response.body[0].id; | ||
client.global.set("group_task_id", firstTaskId); | ||
%} | ||
|
||
|
||
### Claim Task for user alex.admin | ||
POST http://localhost:8083/rest/task/{{group_task_id}}/assign | ||
Content-Type: application/json | ||
Authorization: Bearer {{ access_token }} | ||
|
||
{ | ||
"assignee": "alex.admin" | ||
} |
14 changes: 14 additions & 0 deletions
14
platform/engine/task/src/main/java/io/miragon/miranum/platform/tasklist/TaskProperties.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,14 @@ | ||
package io.miragon.miranum.platform.tasklist; | ||
|
||
import lombok.Getter; | ||
import lombok.Setter; | ||
import org.springframework.boot.context.properties.ConfigurationProperties; | ||
|
||
@ConfigurationProperties(prefix = "miranum.tasklist") | ||
@Getter | ||
@Setter | ||
public class TaskProperties { | ||
|
||
private String customFieldsPrefix = "miranum_task_"; | ||
|
||
} |
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
47 changes: 47 additions & 0 deletions
47
...io/miragon/miranum/platform/tasklist/adapter/out/task/taskinfo/TaskCustomFieldEntity.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,47 @@ | ||
package io.miragon.miranum.platform.tasklist.adapter.out.task.taskinfo; | ||
|
||
import jakarta.persistence.*; | ||
import lombok.*; | ||
|
||
import java.util.UUID; | ||
|
||
@Getter | ||
@Setter | ||
@Builder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
@Entity(name = "TaskCustomFields") | ||
@Table(name = "MIRANUM_TASK_CUSTOM_FIELDS") | ||
public class TaskCustomFieldEntity { | ||
|
||
/** | ||
* The id of the authority | ||
*/ | ||
@Id | ||
@Column(name = "id_", unique = true, nullable = false, length = 36) | ||
private String id; | ||
|
||
/** | ||
* The name of the custom field | ||
*/ | ||
@Column(name = "key_", nullable = false) | ||
private String key; | ||
|
||
/** | ||
* The value of the custom field | ||
*/ | ||
@Column(name = "value_", nullable = false) | ||
private String value; | ||
|
||
@ManyToOne(fetch = FetchType.LAZY) | ||
@JoinColumn(name = "taskinfo_id") | ||
private TaskInfoEntity taskInfo; | ||
|
||
@PrePersist | ||
public void generateId() { | ||
if (id == null) { | ||
id = UUID.randomUUID().toString(); | ||
} | ||
} | ||
|
||
} |
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.