Skip to content

Commit

Permalink
fix query
Browse files Browse the repository at this point in the history
  • Loading branch information
elguardian committed Nov 22, 2023
1 parent 55104cd commit b6ce950
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 31 deletions.
33 changes: 18 additions & 15 deletions data-audit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,26 +56,29 @@ org.kie.kogito.app.audit.spi.GraphQLSchemaQueryProvider: this allow the subsyste

You need to add two different dependencies to your project.

<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>kogito-addons-data-audit-<runtime></artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>kogito-addons-data-audit-jpa-<runtime></artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>kogito-addons-data-audit-<runtime></artifactId>
<version>${version}</version>
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>kogito-addons-data-audit-jpa-<runtime></artifactId>
<version>${version}</version>
</dependency>




The first dependency is related how to you want to deploy it. In this case as collocated/embedded service
The second dependency is which implementation you want to use.

Each implementation might require additional dependencies. In our case for using JPA implementation we might require driver

<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jdbc-h2</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jdbc-h2</artifactId>
</dependency>

No additional configuration is requires besides the default datasource use by the application already.

Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,6 @@ public class UserTaskInstanceStateTO {

private String businessKey;

private String taskId;

private String name;

private String description;
Expand All @@ -54,14 +52,13 @@ public class UserTaskInstanceStateTO {
private String eventType;

public UserTaskInstanceStateTO(String eventId, Date eventDate, String userTaskDefinitionId, String userTaskInstanceId, String processInstanceId, String businessKey,
String taskId, String name, String description, String actualUser, String state, String nodeDefitionId, String nodeInstanceId, String eventType) {
String name, String description, String actualUser, String state, String nodeDefitionId, String nodeInstanceId, String eventType) {
this.eventId = eventId;
this.eventDate = OffsetDateTime.ofInstant(eventDate.toInstant(), ZoneId.of("UTC"));
this.userTaskDefinitionId = userTaskDefinitionId;
this.userTaskInstanceId = userTaskInstanceId;
this.processInstanceId = processInstanceId;
this.businessKey = businessKey;
this.taskId = taskId;
this.name = name;
this.description = description;
this.actualUser = actualUser;
Expand Down Expand Up @@ -119,14 +116,6 @@ public void setBusinessKey(String businessKey) {
this.businessKey = businessKey;
}

public String getTaskId() {
return taskId;
}

public void setTaskId(String taskId) {
this.taskId = taskId;
}

public String getName() {
return name;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,6 @@ type UserTaskInstanceStateLog {
userTaskInstanceId : String
processInstanceId : String
businessKey : String
taskId : String
name : String
description : String
actualUser : String
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ public void storeProcessInstanceDataEvent(DataAuditContext context, ProcessInsta
ProcessInstanceStateLog log = new ProcessInstanceStateLog();
setProcessCommonAttributes(log, event);
log.setEventType(ProcessStateLogType.SLA_VIOLATION);

log.setSlaDueDate(event.getData().getSlaDueDate());
entityManager.persist(log);
} else {
ProcessInstanceNodeLog log = new ProcessInstanceNodeLog();
Expand All @@ -191,6 +191,7 @@ public void storeProcessInstanceDataEvent(DataAuditContext context, ProcessInsta
log.setNodeName(event.getData().getNodeName());
log.setNodeType(event.getData().getNodeType());
log.setEventType(NodeLogType.SLA_VIOLATION);
log.setSlaDueDate(event.getData().getSlaDueDate());
entityManager.persist(log);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -545,7 +545,6 @@
log.user_task_instance_id,
log.process_instance_id,
log.business_key,
log.task_id,
log.name,
log.description,
log.actual_user,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public void init() {
public void testGetAllUserTaskInstanceState() {

String query =
"{ GetAllUserTaskInstanceState { eventId, eventDate, userTaskDefinitionId, userTaskInstanceId, processInstanceId, businessKey, taskId, name, description, actualUser, state, nodeDefitionId, nodeInstanceId, eventType } }";
"{ GetAllUserTaskInstanceState { eventId, eventDate, userTaskDefinitionId, userTaskInstanceId, processInstanceId, businessKey, name, description, actualUser, state, nodeDefitionId, nodeInstanceId, eventType } }";
query = wrapQuery(query);
List<Map<String, Object>> data = given()
.contentType(ContentType.JSON)
Expand Down

0 comments on commit b6ce950

Please sign in to comment.