Skip to content

Commit

Permalink
KOGITO-10000 : YaRD: Add YaRD to the released repositories
Browse files Browse the repository at this point in the history
Part of KOGITO-9997 : Create end to end usable YaRD example
  • Loading branch information
Rikkola committed Feb 16, 2024
1 parent 60fc10c commit 05de24d
Show file tree
Hide file tree
Showing 47 changed files with 2,432 additions and 0 deletions.
22 changes: 22 additions & 0 deletions kogito-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2789,6 +2789,28 @@
<version>${project.version}</version>
<classifier>sources</classifier>
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>yard-api</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>yard-api</artifactId>
<version>${project.version}</version>
<classifier>sources</classifier>
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>yard-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>yard-core</artifactId>
<version>${project.version}</version>
<classifier>sources</classifier>
</dependency>
</dependencies>

</dependencyManagement>
Expand Down
18 changes: 18 additions & 0 deletions kogito-build/kogito-dependencies-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@
<version.black.ninia>4.2.0</version.black.ninia>
<version.com.google.guava>32.0.0-jre</version.com.google.guava>
<version.apache.commons.commons-compress>1.24.0</version.apache.commons.commons-compress>
<version.yaml.mapper.common>0.4</version.yaml.mapper.common>
<version.yaml.mapper>0.4</version.yaml.mapper>
<version.jshell>1.1.0</version.jshell>
</properties>

<dependencyManagement>
Expand Down Expand Up @@ -806,6 +809,21 @@
<artifactId>jep</artifactId>
<version>${version.black.ninia}</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
5 changes: 5 additions & 0 deletions kogito-build/kogito-kie-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,11 @@
<artifactId>drools-ruleunits-api</artifactId>
<version>${version.org.kie}</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-ruleunits-dsl</artifactId>
<version>${version.org.kie}</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-ruleunits-impl</artifactId>
Expand Down
1 change: 1 addition & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
<module>addons</module>
<module>kogito-workitems</module>
<module>kogito-serverless-workflow</module>
<module>yard</module>
<module>kogito-maven-plugin</module>
<module>springboot</module>
</modules>
Expand Down
69 changes: 69 additions & 0 deletions yard/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
<?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:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://maven.apache.org/POM/4.0.0"
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.kogito</groupId>
<artifactId>kogito-build-parent</artifactId>
<version>999-SNAPSHOT</version>
<relativePath>../kogito-build/kogito-build-parent/pom.xml</relativePath>
</parent>

<artifactId>yard</artifactId>
<packaging>pom</packaging>

<name>Kogito :: YARD</name>
<description>
A simple way to describe declarative Decisions and Rules in YAML.
</description>

<properties>
<surefire.forkCount>1</surefire.forkCount>
<alphanetworkCompilerEnabled>false</alphanetworkCompilerEnabled>
</properties>

<modules>
<module>yard-api</module>
<module>yard-core</module>
</modules>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<forkCount>${surefire.forkCount}</forkCount>
<reuseForks>true</reuseForks>
<runOrder>hourly</runOrder>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>

</project>
61 changes: 61 additions & 0 deletions yard/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.kogito</groupId>
<artifactId>yard</artifactId>
<version>999-SNAPSHOT</version>
</parent>

<artifactId>yard-api</artifactId>

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

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.kie.kogito</groupId>
<artifactId>kogito-kie-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,31 @@
/*
* 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;
}

}
64 changes: 64 additions & 0 deletions yard/yard-api/src/main/java/org/kie/yard/api/model/Element.java
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 05de24d

Please sign in to comment.