Skip to content

Commit

Permalink
5774 : Add YaRD
Browse files Browse the repository at this point in the history
  • Loading branch information
Rikkola committed Apr 10, 2024
1 parent 745a23f commit 9edd3f1
Show file tree
Hide file tree
Showing 49 changed files with 2,633 additions and 0 deletions.
10 changes: 10 additions & 0 deletions bom/kie-yard-bom/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/target
/local

# Eclipse, Netbeans and IntelliJ files
/.gitignore
!.gitignore
/nbproject
/*.ipr
/*.iws
/*.iml
113 changes: 113 additions & 0 deletions bom/kie-yard-bom/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.kie</groupId>
<artifactId>kie-core-bom</artifactId>
<version>999-SNAPSHOT</version>
<relativePath>../kie-core-bom/pom.xml</relativePath>
</parent>

<artifactId>kie-yard-bom</artifactId>
<packaging>pom</packaging>

<name>Kie YaRD BOM (Bill Of Materials)</name>
<description>
Import this BOM in your dependencyManagement if you want to depend on multiple Kie YaRD artifacts.
</description>

<url>https://www.drools.org</url>

<scm>
<connection>scm:git:https://github.com/apache/incubator-kie-drools.git</connection>
<developerConnection>scm:git:[email protected]:apache/incubator-kie-drools.git</developerConnection>
<url>https://github.com/apache/incubator-kie-drools</url>
</scm>
<issueManagement>
<system>GitHub Issues</system>
<url>https://github.com/apache/incubator-kie-issues/issues</url>
</issueManagement>
<developers>
<developer>
<name>All developers are listed on the team website</name>
<url>http://www.drools.org/community/team.html</url>
</developer>
</developers>
<contributors>
<contributor>
<name>All contributors are listed on the team website</name>
<url>http://www.drools.org/community/team.html</url>
</contributor>
</contributors>
<mailingLists>
<mailingList>
<name>Development mailing list</name>
<post>[email protected]</post>
<subscribe>[email protected]</subscribe>
<unsubscribe>[email protected]</unsubscribe>
<archive>https://lists.apache.org/[email protected]</archive>
</mailingList>
<mailingList>
<name>setup</name>
<subscribe>https://groups.google.com/forum/#!forum/drools-setup</subscribe>
<unsubscribe>https://groups.google.com/forum/#!forum/drools-setup</unsubscribe>
</mailingList>
<mailingList>
<name>usage</name>
<subscribe>https://groups.google.com/forum/#!forum/drools-usage</subscribe>
<unsubscribe>https://groups.google.com/forum/#!forum/drools-usage</unsubscribe>
</mailingList>
</mailingLists>

<!-- IMPORTANT: Do not declare any build things here! Declare them in kie-user-bom-parent. -->
<build/>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-bom</artifactId>
<type>pom</type>
<version>${project.version}</version>
<scope>import</scope>
</dependency>
<!--
IMPORTANT: Only declare modules of Kie YaRD
Do not declare external dependencies.
Do not duplicate modules from another bom.
-->
<!--
Declare all dependency versions. Do not declare <scope> or <optional>.
Each module should declare it's direct dependencies and possibly overwrite scope/optional.
Always declare the sources jar too and optionally the test-jar.
-->

<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-yard-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-yard-api</artifactId>
<version>${project.version}</version>
<classifier>sources</classifier>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-yard-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.kie</groupId>
<artifactId>kie-yard-core</artifactId>
<version>${project.version}</version>
<classifier>sources</classifier>
</dependency>

</dependencies>
</dependencyManagement>

</project>
1 change: 1 addition & 0 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
<module>kie-efesto-bom</module>
<module>kie-dmn-bom</module>
<module>kie-pmml-bom</module>
<module>kie-yard-bom</module>
</modules>

</project>
18 changes: 18 additions & 0 deletions build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@
<version.maven-checkstyle>3.3.0</version.maven-checkstyle>
<version.build.helper.maven.plugin>3.4.0</version.build.helper.maven.plugin>
<version.maven-javadoc-plugin.override>3.6.2</version.maven-javadoc-plugin.override>

<version.yaml.mapper>0.4</version.yaml.mapper>
<version.jshell>1.1.0</version.jshell>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -1255,6 +1258,21 @@
<artifactId>jboss-logging</artifactId>
<version>${version.org.jboss.logging}</version>
</dependency>
<dependency>
<groupId>org.treblereel.gwt.yaml.mapper</groupId>
<artifactId>common</artifactId>
<version>${version.yaml.mapper}</version>
</dependency>
<dependency>
<groupId>org.treblereel.gwt.yaml.mapper</groupId>
<artifactId>processor</artifactId>
<version>${version.yaml.mapper}</version>
</dependency>
<dependency>
<groupId>ch.obermuhlner</groupId>
<artifactId>jshell-scriptengine</artifactId>
<version>${version.jshell}</version>
</dependency>
</dependencies>

</dependencyManagement>
Expand Down
61 changes: 61 additions & 0 deletions kie-yard/kie-yard-api/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<?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 xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.kie</groupId>
<artifactId>kie-yard</artifactId>
<version>999-SNAPSHOT</version>
</parent>

<artifactId>kie-yard-api</artifactId>

<properties>
<java.module.name>org.kie.yard.api</java.module.name>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-bom</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.treblereel.gwt.yaml.mapper</groupId>
<artifactId>common</artifactId>
</dependency>

<dependency>
<groupId>org.treblereel.gwt.yaml.mapper</groupId>
<artifactId>processor</artifactId>
<scope>provided</scope>
</dependency>
</dependencies>
</project>
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.yard.api.model;

import org.treblereel.gwt.yaml.api.annotation.YamlSubtype;
import org.treblereel.gwt.yaml.api.annotation.YamlTypeInfo;

@YamlTypeInfo(
key = "type",
value = {
@YamlSubtype(alias = "DecisionTable", type = DecisionTable.class),
@YamlSubtype(alias = "LiteralExpression", type = LiteralExpression.class)
})
public interface DecisionLogic {

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/*
* 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.yard.api.model;

import java.util.List;

import org.treblereel.gwt.yaml.api.annotation.YAMLMapper;
import org.treblereel.gwt.yaml.api.annotation.YamlTypeDeserializer;
import org.treblereel.gwt.yaml.api.annotation.YamlTypeSerializer;

@YAMLMapper
public class DecisionTable implements DecisionLogic {

private List<String> inputs;
private String hitPolicy = "ANY";
@Deprecated
private List<String> outputComponents;
@YamlTypeSerializer(RuleDefSerializer.class)
@YamlTypeDeserializer(RuleDefSerializer.class)
private List rules;

public void setInputs(List<String> inputs) {
this.inputs = inputs;
}

public void setOutputComponents(List<String> outputComponents) {
this.outputComponents = outputComponents;
}

public List<String> getInputs() {
return inputs;
}

@Deprecated
public List<String> getOutputComponents() {
return outputComponents;
}

public String getHitPolicy() {
return hitPolicy;
}

public void setHitPolicy(String hitPolicy) {
this.hitPolicy = hitPolicy;
}

public List getRules() {
return rules;
}

public void setRules(List rules) {
this.rules = rules;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* 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.yard.api.model;

import java.util.List;

import org.treblereel.gwt.yaml.api.annotation.YAMLMapper;

@YAMLMapper
public class Element {

private String name;
private String type;
private List<String> requirements;
private DecisionLogic logic;

public void setName(String name) {
this.name = name;
}

public void setType(String type) {
this.type = type;
}

public void setRequirements(List<String> requirements) {
this.requirements = requirements;
}

public void setLogic(DecisionLogic logic) {
this.logic = logic;
}

public String getName() {
return name;
}

public String getType() {
return type;
}

public List<String> getRequirements() {
return requirements;
}

public DecisionLogic getLogic() {
return logic;
}
}
Loading

0 comments on commit 9edd3f1

Please sign in to comment.