Skip to content

Commit

Permalink
[1.40.x] KOGITO-9416 - Remove SVG extension from prod profile (#1788)
Browse files Browse the repository at this point in the history
* KOGITO-9416 - Remove SVG extension from prod profile (#1787)

* Apply suggestions from code review

---------

Co-authored-by: Cristiano Nicolai <[email protected]>
  • Loading branch information
github-actions[bot] and cristianonicolai authored Jun 22, 2023
1 parent 8af5fa0 commit 6555893
Show file tree
Hide file tree
Showing 47 changed files with 1,236 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@
<groupId>org.kie.kogito</groupId>
<artifactId>kogito-addons-quarkus-data-index-common-runtime</artifactId>
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>kogito-addons-quarkus-process-svg-deployment</artifactId>
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>kogito-addons-quarkus-source-files-deployment</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>kogito-addons-quarkus-process-svg</artifactId>
<artifactId>kogito-addons-process-svg</artifactId>
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ public class KogitoAddonRuntimeClientImpl implements KogitoRuntimeClient {
private Processes processes;

@Inject
public KogitoAddonRuntimeClientImpl(ProcessSvgService processSvgService,
public KogitoAddonRuntimeClientImpl(Instance<ProcessSvgService> processSvgService,
SourceFilesProvider sourceFilesProvider,
Instance<Processes> processesInstance) {
this.processSvgService = processSvgService;
this.processSvgService = processSvgService.isResolvable() ? processSvgService.get() : null;
this.sourceFilesProvider = sourceFilesProvider;
this.processes = processesInstance.isResolvable() ? processesInstance.get() : null;
}
Expand Down Expand Up @@ -90,7 +90,11 @@ public CompletableFuture<String> updateProcessInstanceVariables(String serviceUR

@Override
public CompletableFuture<String> getProcessInstanceDiagram(String serviceURL, ProcessInstance processInstance) {
return CompletableFuture.supplyAsync(() -> processSvgService.getProcessInstanceSvg(processInstance.getProcessId(), processInstance.getId(), null).orElse(null), managedExecutor);
if (processSvgService == null) {
return CompletableFuture.completedFuture(null);
} else {
return CompletableFuture.supplyAsync(() -> processSvgService.getProcessInstanceSvg(processInstance.getProcessId(), processInstance.getId(), null).orElse(null), managedExecutor);
}
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.kie.kogito</groupId>
<artifactId>kogito-addons-quarkus-data-index-infinispan-parent</artifactId>
<version>1.40.1-SNAPSHOT</version>
</parent>
<artifactId>kogito-addons-quarkus-data-index-infinispan-integration-tests-process</artifactId>
<name>Kogito Apps :: Kogito Addons Quarkus Data Index Infinispan :: Integration Tests :: Process</name>

<dependencies>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>kogito-quarkus-processes</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-resteasy-jackson</artifactId>
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>kogito-addons-quarkus-data-index-infinispan</artifactId>
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>kogito-addons-quarkus-persistence-infinispan</artifactId>
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>kogito-addons-quarkus-process-svg</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-junit5</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>kogito-addons-quarkus-data-index-infinispan-deployment</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>${version.io.quarkus}</version>
<executions>
<execution>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>native</id>
<activation>
<property>
<name>native</name>
</property>
</activation>
<properties>
<quarkus.package.type>native</quarkus.package.type>
<failsafe.include>**/*IT.java</failsafe.include>
</properties>
</profile>
</profiles>
</project>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<bpmn2:definitions xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:bpsim="http://www.bpsim.org/schemas/1.0" xmlns:dc="http://www.omg.org/spec/DD/20100524/DC" xmlns:di="http://www.omg.org/spec/DD/20100524/DI" xmlns:drools="http://www.jboss.org/drools" xmlns:xsi="xsi" id="_hT2oIPJzEDuE8tm0q8uK_w" xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd http://www.jboss.org/drools drools.xsd http://www.bpsim.org/schemas/1.0 bpsim.xsd http://www.omg.org/spec/DD/20100524/DC DC.xsd http://www.omg.org/spec/DD/20100524/DI DI.xsd " exporter="jBPM Process Modeler" exporterVersion="2.0" targetNamespace="http://www.omg.org/bpmn20">
<bpmn2:collaboration id="_4326C578-FDBD-4F8C-BAB8-5C9CFE867882" name="Default Collaboration">
<bpmn2:participant id="_B70F49F9-D9BE-4BCD-A095-2601433AD6F7" name="Pool Participant" processRef="hello"/>
</bpmn2:collaboration>
<bpmn2:process id="hello" drools:packageName="com.example" drools:version="1.0" drools:adHoc="false" name="hello" isExecutable="true" processType="Public">
<bpmn2:sequenceFlow id="_9FD38FF8-A530-41E7-8EA0-E1F71353CBB3" sourceRef="_C3F8BD7A-55E5-4513-8C0D-5576F8099167" targetRef="_B3241ACF-97BE-443B-A49F-964AB3DD006C"/>
<bpmn2:endEvent id="_B3241ACF-97BE-443B-A49F-964AB3DD006C">
<bpmn2:incoming>_9FD38FF8-A530-41E7-8EA0-E1F71353CBB3</bpmn2:incoming>
</bpmn2:endEvent>
<bpmn2:startEvent id="_C3F8BD7A-55E5-4513-8C0D-5576F8099167">
<bpmn2:outgoing>_9FD38FF8-A530-41E7-8EA0-E1F71353CBB3</bpmn2:outgoing>
</bpmn2:startEvent>
</bpmn2:process>
<bpmndi:BPMNDiagram>
<bpmndi:BPMNPlane bpmnElement="hello">
<bpmndi:BPMNShape id="shape__C3F8BD7A-55E5-4513-8C0D-5576F8099167" bpmnElement="_C3F8BD7A-55E5-4513-8C0D-5576F8099167">
<dc:Bounds height="56" width="56" x="321" y="287"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape id="shape__B3241ACF-97BE-443B-A49F-964AB3DD006C" bpmnElement="_B3241ACF-97BE-443B-A49F-964AB3DD006C">
<dc:Bounds height="56" width="56" x="457" y="287"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge id="edge_shape__C3F8BD7A-55E5-4513-8C0D-5576F8099167_to_shape__B3241ACF-97BE-443B-A49F-964AB3DD006C" bpmnElement="_9FD38FF8-A530-41E7-8EA0-E1F71353CBB3">
<di:waypoint x="349" y="315"/>
<di:waypoint x="485" y="315"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
<bpmn2:relationship type="BPSimData">
<bpmn2:extensionElements>
<bpsim:BPSimData>
<bpsim:Scenario id="default" name="Simulationscenario">
<bpsim:ScenarioParameters/>
<bpsim:ElementParameters elementRef="_C3F8BD7A-55E5-4513-8C0D-5576F8099167">
<bpsim:TimeParameters>
<bpsim:ProcessingTime>
<bpsim:NormalDistribution mean="0" standardDeviation="0"/>
</bpsim:ProcessingTime>
</bpsim:TimeParameters>
</bpsim:ElementParameters>
</bpsim:Scenario>
</bpsim:BPSimData>
</bpmn2:extensionElements>
<bpmn2:source>_hT2oIPJzEDuE8tm0q8uK_w</bpmn2:source>
<bpmn2:target>_hT2oIPJzEDuE8tm0q8uK_w</bpmn2:target>
</bpmn2:relationship>
</bpmn2:definitions>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2022 Red Hat, Inc. and/or its affiliates.
* Copyright 2023 Red Hat, Inc. and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -27,7 +27,7 @@
import static org.hamcrest.CoreMatchers.notNullValue;

@QuarkusIntegrationTest
class PostgreSQLQuarkusAddonDataIndexIT {
class InfinispanQuarkusAddonDataIndexIT {

static {
RestAssured.enableLoggingOfRequestAndResponseIfValidationFails();
Expand All @@ -43,11 +43,10 @@ void testDataIndexAddon() {
String id = given()
.contentType(ContentType.JSON)
.accept(ContentType.JSON)
.body("{\"workflowdata\" : {\"name\" : \"John\", \"language\":\"English\"}}").when()
.post("/greet")
.post("/hello")
.then()
.statusCode(201)
.body("workflowdata.greeting", is("Hello from JSON Workflow,"))
.body("id", is(notNullValue()))
.extract().path("id");

given().contentType(ContentType.JSON).body("{ \"query\" : \"{ProcessInstances{ id, state, diagram, source, nodeDefinitions { name } } }\" }")
Expand All @@ -58,7 +57,7 @@ void testDataIndexAddon() {
.body("data.ProcessInstances[0].state", is("COMPLETED"))
.body("data.ProcessInstances[0].diagram", is(notNullValue()))
.body("data.ProcessInstances[0].source", is(notNullValue()))
.body("data.ProcessInstances[0].nodeDefinitions.size()", is(12));
.body("data.ProcessInstances[0].nodeDefinitions.size()", is(2));
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<artifactId>kogito-addons-quarkus-data-index-infinispan-parent</artifactId>
<version>1.40.1-SNAPSHOT</version>
</parent>
<artifactId>kogito-addons-quarkus-data-index-infinispan-integration-tests</artifactId>
<name>Kogito Apps :: Kogito Addons Quarkus Data Index Infinispan :: Integration Tests</name>
<artifactId>kogito-addons-quarkus-data-index-infinispan-integration-tests-sw</artifactId>
<name>Kogito Apps :: Kogito Addons Quarkus Data Index Infinispan :: Integration Tests :: SW</name>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
kogito.persistence.type=infinispan

quarkus.kogito.data-index.graphql.ui.always-include=true
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import static io.restassured.RestAssured.given;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.CoreMatchers.nullValue;

@QuarkusIntegrationTest
class InfinispanQuarkusAddonDataIndexIT {
Expand Down Expand Up @@ -56,7 +57,7 @@ void testDataIndexAddon() {
.body("data.ProcessInstances.size()", is(1))
.body("data.ProcessInstances[0].id", is(id))
.body("data.ProcessInstances[0].state", is("COMPLETED"))
.body("data.ProcessInstances[0].diagram", is(notNullValue()))
.body("data.ProcessInstances[0].diagram", is(nullValue()))
.body("data.ProcessInstances[0].source", is(notNullValue()))
.body("data.ProcessInstances[0].nodeDefinitions.size()", is(12));
}
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,21 @@
<modules>
<module>deployment</module>
<module>runtime</module>
<module>integration-tests</module>
<module>integration-tests-sw</module>
</modules>

<profiles>
<profile>
<id>default</id>
<activation>
<property>
<name>!productized</name>
</property>
</activation>
<modules>
<module>integration-tests-process</module>
</modules>
</profile>
</profiles>

</project>
Loading

0 comments on commit 6555893

Please sign in to comment.