Skip to content

Commit

Permalink
Merge pull request #67 from assimbly/develop
Browse files Browse the repository at this point in the history
Release 3.8.1
  • Loading branch information
joaocatalao committed Dec 14, 2022
2 parents eadf2cb + 83a10c9 commit 4169db9
Show file tree
Hide file tree
Showing 24 changed files with 1,131 additions and 279 deletions.
36 changes: 36 additions & 0 deletions .github/issue-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
mode: auto

silent: false

commentMessage: 'Branch ${branchName} created for issue: ${issue.number}-${issue.title}'

defaultBranch: 'develop'

branchName: 'issue-${issue.number}/${issue.title,}'

gitSafeReplacementChar: '-'

branches:
- label: [ feature ]
prefix: feature/

- label: [ bug ]
prefix: bugfix/

- label: [ documentation ]
prefix: documentation/

- label: '*'
prefix: issues/

- label: no-branch
skip: true

autoCloseIssue: true
openDraftPR: true

copyIssueDescriptionToPR: true
copyIssueLabelsToPR: true
copyIssueAssigneeToPR: true
copyIssueProjectsToPR: false
copyIssueMilestoneToPR: false
3 changes: 3 additions & 0 deletions .github/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
feature: ['feature/*', 'feat/*']
fix: ['fix/*', 'bug-fix/*']
chore: ['chore/*', 'maintenance/*', 'wip/*']
37 changes: 21 additions & 16 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,38 @@
name-template: 'v$RESOLVED_VERSION'
tag-template: 'v$RESOLVED_VERSION'
name-template: '$RESOLVED_VERSION'
tag-template: '$RESOLVED_VERSION'
categories:
- title: '🚀 Features'
collapse-after: 5
labels:
- 'feature'
- 'enhancement'
- title: '🐛 Bug Fixes'
collapse-after: 5
labels:
- 'fix'
- 'bugfix'
- 'bug'
- title: '🧰 Maintenance'
collapse-after: 5
labels:
- 'chore'
- 'maintenance'
change-template: '- $TITLE @$AUTHOR (#$NUMBER)'
- 'wip'
exclude-labels:
- 'skip-changelog'
change-template: '- $TITLE (#$NUMBER)'
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
#version-resolver:
# major:
# labels:
# - 'major'
# minor:
# labels:
# - 'minor'
# patch:
# labels:
# - 'patch'
# default: patch
version-resolver:
major:
labels:
- 'major'
minor:
labels:
- 'minor'
patch:
labels:
- 'patch'
default: patch
template: |
## Changes
$CHANGES
$CHANGES
14 changes: 14 additions & 0 deletions .github/workflows/issue-branch.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Create Issue Branch

on:
issues:
types: [ created, assigned ]

jobs:
create_issue_branch_job:
runs-on: ubuntu-latest
steps:
- name: Create Issue Branch
uses: robvanderleek/create-issue-branch@main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 3 additions & 6 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
name: Publish package to GitHub Packages
on:
release:
types: [created, updated]
push:
branches:
- master
types: [ released ]

jobs:
publish:
runs-on: ubuntu-latest
Expand All @@ -18,7 +16,6 @@ jobs:
java-version: '11'
distribution: 'adopt'
- name: Publish package
run: |
sh ./bin/mac/deploy.sh
run: sh ./bin/mac/deploymodules.sh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23 changes: 23 additions & 0 deletions .github/workflows/pr-labeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: PR Labeler
on:
pull_request:
types: [opened, reopened, synchronize, assigned]
branches:
- develop # matches develop branch
- '*/*' # matches every branch containing a single '/'
- '!master' # excludes master branch (production)

permissions:
contents: read

jobs:
pr-labeler:
permissions:
contents: read
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: Add labels to PR
uses: TimonVS/pr-labeler-action@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
11 changes: 6 additions & 5 deletions .github/workflows/release-drafter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ on:
push:
branches:
- master
- develop

pull_request:
types: [opened, reopened, synchronize]
branches:
- master

permissions:
contents: read
Expand All @@ -15,11 +17,10 @@ jobs:
update_release_draft:
permissions:
contents: write
pull-requests: write

pull-requests: write
runs-on: ubuntu-latest

steps:
- uses: release-drafter/release-drafter@v5
- name: Draft a Release
uses: release-drafter/release-drafter@v5
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion broker/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>runtime</artifactId>
<groupId>org.assimbly</groupId>
<version>3.8.0</version>
<version>3.8.1</version>
</parent>

<name>broker</name>
Expand Down
2 changes: 1 addition & 1 deletion brokerRest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<artifactId>runtime</artifactId>
<groupId>org.assimbly</groupId>
<version>3.8.0</version>
<version>3.8.1</version>
</parent>

<name>broker-rest</name>
Expand Down
2 changes: 1 addition & 1 deletion dil/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<artifactId>runtime</artifactId>
<groupId>org.assimbly</groupId>
<version>3.8.0</version>
<version>3.8.1</version>
</parent>

<name>dil</name>
Expand Down
66 changes: 66 additions & 0 deletions dil/src/main/java/org/assimbly/dil/blocks/templates/Hl7.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
package org.assimbly.dil.blocks.templates;

import org.apache.camel.builder.RouteBuilder;

public class Hl7 extends RouteBuilder {

@Override
public void configure() throws Exception {

routeTemplate("hl7xml-source")
.templateParameter("routeconfiguration_id","0")
.templateParameter("path")
.templateParameter("out")
.from("mllp:{{path}}")
.unmarshal().hl7(true)
.to("bean:Hl7ToXmlConverter")
.routeConfigurationId("{{routeconfiguration_id}}")
.to("{{out}}");

routeTemplate("hl7xml-action")
.templateParameter("routeconfiguration_id","0")
.templateParameter("path")
.templateParameter("in")
.templateParameter("out")
.from("{{in}}")
.to("bean:XmlToHl7Converter")
.to("mllp:{{path}}")
.to("{{out}}");

routeTemplate("hl7xml-sink")
.templateParameter("routeconfiguration_id","0")
.templateParameter("path")
.templateParameter("in")
.templateParameter("out")
.from("{{in}}")
.to("bean:XmlToHl7Converter")
.to("mllp:{{path}}");

routeTemplate("hl7er7-source")
.templateParameter("routeconfiguration_id","0")
.templateParameter("path")
.templateParameter("out")
.from("mllp:{{path}}")
.routeConfigurationId("{{routeconfiguration_id}}")
.to("{{out}}");

routeTemplate("hl7er7-action")
.templateParameter("routeconfiguration_id","0")
.templateParameter("path")
.templateParameter("in")
.templateParameter("out")
.from("{{in}}")
.to("mllp:{{path}}")
.to("{{out}}");

routeTemplate("hl7er7-sink")
.templateParameter("routeconfiguration_id","0")
.templateParameter("path")
.templateParameter("in")
.templateParameter("out")
.from("{{in}}")
.to("mllp:{{path}}");

}

}
25 changes: 23 additions & 2 deletions dil/src/main/java/org/assimbly/dil/loader/FlowLoader.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.assimbly.dil.loader;

import java.util.Set;
import java.util.TreeMap;
import org.apache.camel.*;
import org.apache.camel.builder.*;
Expand All @@ -25,6 +26,9 @@ public class FlowLoader extends RouteBuilder {
private DeadLetterChannelBuilder routeErrorHandler;
private String flowId;
private String flowName;
private String flowEvent;
private String flowVersion;
private String flowEnvironment;

private boolean isFlowLoaded = true;

Expand Down Expand Up @@ -57,6 +61,8 @@ private void init(){

flowId = props.get("id");
flowName = props.get("flow.name");
flowVersion = props.get("flow.version");
flowEnvironment = props.get("environment");

flowLoaderReport = new FlowLoaderReport();

Expand All @@ -66,8 +72,12 @@ private void init(){

}

private void finish(){
flowLoaderReport.finishReport(flowId, flowName);
private void finish() {
if (isFlowLoaded){
flowLoaderReport.finishReport(flowId, flowName, flowEvent, flowVersion, flowEnvironment, "Started flow successfully");
}else{
flowLoaderReport.finishReport(flowId, flowName, flowEvent, flowVersion, flowEnvironment, "Failed to load flow");
}
}

private void setExtendedCamelContext() {
Expand Down Expand Up @@ -187,19 +197,28 @@ private void updateStep(Resource resource, String route, String type, String id,
try {
log.info(logMessage("Updating step", id, type, route));
loader.updateRoutes(resource);

//context
flowLoaderReport.setStep(id, uri, type, "success", null);
flowEvent = "start";
}catch (Exception e) {
String errorMessage = e.getMessage();
log.error("Failed updating step | stepid=" + id);
flowLoaderReport.setStep(id, uri, type, "error", errorMessage);
flowEvent = "error";
isFlowLoaded = false;
}
}

private void loadStep(Resource resource, String route, String type, String id, String uri){

System.out.println("1. id=" + id);
System.out.println("1. StepUri=" + uri);

try {
log.info(logMessage("Loading step", id, type, route));
loader.loadRoutes(resource);
flowEvent = "start";
flowLoaderReport.setStep(id, uri, type, "success", null);
}catch (Exception e){
try {
Expand All @@ -212,11 +231,13 @@ private void loadStep(Resource resource, String route, String type, String id, S
}else{
log.error("Failed loading step | stepid=" + id);
isFlowLoaded = false;
flowEvent = "error";
flowLoaderReport.setStep(id, uri, type,"error",errorMessage);
}
}catch (Exception e2){
log.error("Failed updating step | stepid=" + id);
isFlowLoaded = false;
flowEvent = "error";
flowLoaderReport.setStep(id,uri, type,"error",e2.getMessage());
}
}
Expand Down

0 comments on commit 4169db9

Please sign in to comment.