Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Rafael T. C. Soares (A.K.A Tuelho) rafaeltuelho

🎯
Focusing
View GitHub Profile
View loan-approval.dmn
<dmn:definitions xmlns:dmn="http://www.omg.org/spec/DMN/20180521/MODEL/" xmlns="https://kiegroup.org/dmn/_EC5A0305-6427-48D9-B8A4-EBBE4E697952" xmlns:di="http://www.omg.org/spec/DMN/20180521/DI/" xmlns:kie="http://www.drools.org/kie/dmn/1.2" xmlns:feel="http://www.omg.org/spec/DMN/20180521/FEEL/" xmlns:dmndi="http://www.omg.org/spec/DMN/20180521/DMNDI/" xmlns:dc="http://www.omg.org/spec/DMN/20180521/DC/" id="_0D8FD7B2-A3CD-477C-B572-A81193BDD346" name="loan-approval" expressionLanguage="http://www.omg.org/spec/DMN/20180521/FEEL/" typeLanguage="http://www.omg.org/spec/DMN/20180521/FEEL/" namespace="https://kiegroup.org/dmn/_EC5A0305-6427-48D9-B8A4-EBBE4E697952">
<dmn:extensionElements/>
<dmn:itemDefinition id="_630A1942-6338-478E-ACA0-22191A69AC39" name="Applicant" isCollection="false">
<dmn:itemComponent id="_8E74686D-BE67-47D2-97D9-2414C8D87D4D" name="age" isCollection="false">
<dmn:typeRef>number</dmn:typeRef>
</dmn:itemComponent>
<dmn:itemComponent id="_37BF9988-5935-44D1-9C64-375483F
@rafaeltuelho
rafaeltuelho / minimal-drools-pom.xml
Last active Jun 9, 2021
Minimal Drools (Kie) project pom
View minimal-drools-pom.xml
<?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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.redhat.demos</groupId>
<artifactId>minimal-drools-project</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>kjar</packaging>
@rafaeltuelho
rafaeltuelho / settings-redhat-repos.xml
Created Jun 7, 2021
Maven Settings with Red Hat Enterprise repos
View settings-redhat-repos.xml
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>nexus-ocp</id>
<username>rhpam</username>
<password>secret_pass</password>
</server>
</servers>
@rafaeltuelho
rafaeltuelho / quarkus-ocp4-dc.yaml
Created Apr 16, 2021
Quarkus App DeploymentConfig for Openshift 4 using ubi8/openjdk-8 image
View quarkus-ocp4-dc.yaml
kind: DeploymentConfig
apiVersion: apps.openshift.io/v1
metadata:
annotations:
openshift.io/generated-by: OpenShiftNewApp
name: my-quarkus-app
spec:
strategy:
type: Rolling
rollingParams:
View ubi8-openjdk-8-vars.adoc

Red Hat UBI OpenJDK Image

Table of Contents

Informational variables

Table 1. Table Informational variables

Name

Value

Description

@rafaeltuelho
rafaeltuelho / maven-ignore-ssl.md
Created Apr 14, 2021
Maven ignore SSL Certificate Validation
View maven-ignore-ssl.md
mvn install \
 -Dmaven.wagon.http.ssl.insecure=true\
 -Dmaven.wagon.http.ssl.allowall=true\
 -Dmaven.wagon.http.ssl.ignore.validity.dates=true
@rafaeltuelho
rafaeltuelho / jbpm-sla-update-api.md
Last active Apr 1, 2021
Update a SLA of a instantiated process in jBPM
View jbpm-sla-update-api.md

Get Process Instance SLAs (Timers)

Returns all timers for a specified process instance.
GET /server/admin/containers/{containerId}/processes/instances/{processInstanceId}/timers

curl -X GET "http://localhost:8080/kie-server/services/rest/server/admin/containers/sla-test_1.0.0-SNAPSHOT/processes/instances/165/timers" -H "accept: application/json"

Response

@rafaeltuelho
rafaeltuelho / docker-file-volume.md
Created Mar 11, 2021
Copy files to a docker volume
View docker-file-volume.md
@rafaeltuelho
rafaeltuelho / maven-gav-bash.md
Last active Feb 2, 2021
Ways to get GAV from your POM using bash script
View maven-gav-bash.md
  1. using native bash commands (echo, cat, xmlint, sed)

Ref: https://stackoverflow.com/a/16962213/1010947

This approach should work in most of the Linux base continer images. No need to instll additionl pkgs!

pom="source/pom.xml"
groupId=$(echo "cat //*[local-name()='project']/*[local-name()='groupId']" | xmllint --shell $pom | sed '/^\/ >/d' | sed 's/<[^>]*.//g')
artifactId=$(echo "cat //*[local-name()='project']/*[local-name()='artifactId']" | xmllint --shell $pom | sed '/^\/ >/d' | sed 's/<[^>]*.//g')
@rafaeltuelho
rafaeltuelho / drools-gsdt-decompiler.md
Created Feb 1, 2021
Drools Guided Decision Table (GDST) decompiler
View drools-gsdt-decompiler.md
org.drools.workbench.models.guided.dtable.shared.model.GuidedDecisionTable52 unmarshal = 
    org.drools.workbench.models.guided.dtable.backend.GuidedDTXMLPersistence.getInstance().unmarshal(
            new String(Files.readAllBytes(Paths.get("src/main/resources/guidedTable.gdst")))
      );
String drl = org.drools.workbench.models.guided.dtable.backend.GuidedDTDRLPersistence.getInstance().marshal(unmarshal);

System.out.println(drl);