Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync main branch with Apache main branch #35

Merged
merged 2 commits into from
Aug 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>persistence-commons-jpa</artifactId>
<artifactId>persistence-commons-jpa-base</artifactId>
</dependency>
<dependency>
<groupId>org.mapstruct</groupId>
Expand Down
11 changes: 8 additions & 3 deletions data-index/data-index-storage/data-index-storage-jpa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,19 @@
<artifactId>data-index-storage-jpa-common</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-test-h2</artifactId>
<scope>test</scope>
<groupId>org.kie.kogito</groupId>
<artifactId>persistence-commons-jpa</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jdbc-h2</artifactId>
</dependency>

<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-test-h2</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>data-index-storage-api</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,16 @@ create table jobs
id varchar(255) not null,
callback_endpoint varchar(255),
endpoint varchar(255),
execution_counter NUMBER(10),
execution_counter integer,
expiration_time timestamp,
last_update timestamp,
node_instance_id varchar(255),
priority NUMBER(10),
priority integer,
process_id varchar(255),
process_instance_id varchar(255),
repeat_interval NUMBER(19),
repeat_limit NUMBER(10),
retries NUMBER(10),
repeat_interval bigint,
repeat_limit integer,
retries integer,
root_process_id varchar(255),
root_process_instance_id varchar(255),
scheduled_id varchar(255),
Expand Down Expand Up @@ -97,8 +97,8 @@ create table processes
root_process_id varchar(255),
root_process_instance_id varchar(255),
start_time timestamp,
state NUMBER(10),
variables blob,
state integer,
variables varbinary(max),
CONSTRAINT processes_pk PRIMARY KEY (id),
CONSTRAINT processes_variables_json CHECK (variables IS JSON)
);
Expand All @@ -124,10 +124,10 @@ create table tasks
completed timestamp,
description varchar(255),
endpoint varchar(255),
inputs blob,
inputs varbinary(max),
last_update timestamp,
name varchar(255),
outputs blob,
outputs varbinary(max),
priority varchar(255),
process_id varchar(255),
process_instance_id varchar(255),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,28 @@

create table definitions
(
id varchar2(255 char) not null,
version varchar2(255 char) not null,
name varchar2(255 char),
source blob,
type varchar2(255 char),
endpoint varchar2(255 char),
id varchar2(255) not null,
version varchar2(255) not null,
name varchar2(255),
source bytea,
type varchar2(255),
endpoint varchar2(255),
primary key (id, version)
);

create table definitions_addons
(
process_id varchar2(255 char) not null,
process_version varchar2(255 char) not null,
addon varchar2(255 char) not null,
process_id varchar2(255) not null,
process_version varchar2(255) not null,
addon varchar2(255) not null,
primary key (process_id, process_version, addon)
);

create table definitions_roles
(
process_id varchar2(255 char) not null,
process_version varchar2(255 char) not null,
role varchar2(255 char) not null,
process_id varchar2(255) not null,
process_version varchar2(255) not null,
role varchar2(255) not null,
primary key (process_id, process_version, role)
);

Expand All @@ -57,4 +57,4 @@ alter table definitions_roles
on delete cascade;

alter table processes
add version varchar2(255 char);
add column version varchar2(255);
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@

create table definitions_nodes
(
id varchar2(255 char) not null,
name varchar2(255 char),
type varchar2(255 char),
unique_id varchar2(255 char),
process_id varchar2(255 char) not null,
process_version varchar2(255 char) not null,
id varchar2(255) not null,
name varchar2(255),
type varchar2(255),
unique_id varchar2(255),
process_id varchar2(255) not null,
process_version varchar2(255) not null,
primary key (id, process_id, process_version)
);

create table definitions_nodes_metadata
(
node_id varchar2(255 char) not null,
process_id varchar2(255 char) not null,
process_version varchar2(255 char) not null,
value varchar2(255 char),
key varchar2(255 char) not null,
node_id varchar2(255) not null,
process_id varchar2(255) not null,
process_version varchar2(255) not null,
value varchar2(255),
key varchar2(255) not null,
primary key (node_id, process_id, process_version, key)
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,18 +19,18 @@

create table definitions_annotations
(
value varchar2(255 char) not null,
process_id varchar2(255 char) not null,
process_version varchar2(255 char) not null,
value varchar2(255) not null,
process_id varchar2(255) not null,
process_version varchar2(255) not null,
primary key (value, process_id, process_version)
);

create table definitions_metadata
(
process_id varchar2(255 char) not null,
process_version varchar2(255 char) not null,
value varchar2(255 char),
key varchar2(255 char) not null,
process_id varchar2(255) not null,
process_version varchar2(255) not null,
value varchar2(255),
key varchar2(255) not null,
primary key (process_id, process_version, key)
);

Expand All @@ -47,5 +47,5 @@ alter table definitions_metadata
on delete cascade;

alter table definitions
add (description varchar2(255 char));
add (description varchar2(255));

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* 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.
*/

create index idx_attachments_tid on attachments(task_id);
create index idx_comments_tid on comments(task_id);
create index idx_definitions_addons_pid_pv on definitions_addons(process_id, process_version);
create index idx_definitions_annotations_pid_pv on definitions_annotations(process_id, process_version);
create index idx_definitions_metadata_pid_pv on definitions_metadata(process_id, process_version);
create index idx_definitions_nodes_pid_pv on definitions_nodes(process_id, process_version);
create index idx_definitions_nodes_metadata_pid_pv on definitions_nodes_metadata(process_id, process_version);
create index idx_definitions_roles_pid_pv on definitions_roles(process_id, process_version);
create index idx_milestones_piid on milestones(process_instance_id);
create index idx_nodes_piid on nodes(process_instance_id);
create index idx_processes_addons_pid on processes_addons(process_id);
create index idx_processes_roles_pid on processes_roles(process_id);
create index idx_tasks_admin_groups_tid on tasks_admin_groups(task_id);
create index idx_tasks_admin_users_tid on tasks_admin_users(task_id);
create index idx_tasks_excluded_users_tid on tasks_excluded_users(task_id);
create index idx_tasks_potential_groups_tid on tasks_potential_groups(task_id);
create index idx_tasks_potential_users_tid on tasks_potential_users(task_id);
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ private Function<Process<?>, ProcessDefinition> mapProcessDefinition(Set<String>
pd.setId(p.id());
pd.setName(p.name());
pd.setVersion(p.version());
pd.setType(pd.getType());
pd.setType(p.type());
pd.setAddons(addons);
// See ProcessInstanceEventBatch.buildSource
pd.setEndpoint(endpoint + "/" + (p.id().contains(".") ? p.id().substring(p.id().lastIndexOf('.') + 1) : p.id()));
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--

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.

-->
<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</groupId>
<artifactId>kogito-addons-quarkus-data-index-persistence-jpa-parent</artifactId>
<version>999-SNAPSHOT</version>
</parent>
<artifactId>kogito-addons-quarkus-data-index-persistence-jpa-deployment</artifactId>
<name>Kogito Apps :: Kogito Addons Quarkus Data Index Persistence JPA :: Deployment</name>
<dependencies>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kogito-addons-quarkus-data-index-persistence-common-deployment</artifactId>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kogito-addons-quarkus-data-index-persistence-jpa</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-flyway-deployment</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-hibernate-orm-panache-deployment</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-jdbc-h2-deployment</artifactId>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<annotationProcessorPaths>
<path>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-extension-processor</artifactId>
<version>${version.io.quarkus}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* 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.addons.quarkus.data.index.persistence.deployment;

import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.builditem.FeatureBuildItem;
import io.quarkus.deployment.builditem.nativeimage.NativeImageResourcePatternsBuildItem;
import io.quarkus.deployment.pkg.steps.NativeOrNativeSourcesBuild;

public class JPASQLDataIndexPersistenceProcessor extends AbstractKogitoAddonsQuarkusDataIndexPersistenceProcessor {

private static final String FEATURE = "kogito-addons-quarkus-data-index-persistence-jpa";

@BuildStep
public FeatureBuildItem feature() {
return new FeatureBuildItem(FEATURE);
}

@BuildStep(onlyIf = NativeOrNativeSourcesBuild.class)
public void addNativeResources(BuildProducer<NativeImageResourcePatternsBuildItem> resources) {
resources.produce(new NativeImageResourcePatternsBuildItem.Builder().includeGlob("sql/*.sql").build());
}

}
Loading
Loading