Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
NourEldin-Ali committed Jun 13, 2024
1 parent 276cbb0 commit 8b9aa86
Show file tree
Hide file tree
Showing 17 changed files with 105 additions and 17 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/build-maven-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ jobs:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Execute Bash script
run: |
chmod +x ../open-bpmn.metamodel/dependencies/compile.sh
bash ../open-bpmn.metamodel/dependencies/compile.sh
- name: Building Open-BPMN Server with Maven
run: mvn -B package --file pom.xml

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
.project
.classpath
open-bpmn.glsp-server/.classpath
lib

### Maven ###
target/
Expand All @@ -23,7 +24,6 @@ buildNumber.properties
node_modules
node_modules/.yarn-integrity
.browser_modules
lib
*.log
tsconfig.tsbuildinfo
gen-webpack.config.js
Expand Down
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ RUN mkdir /usr/src/app/workspace
# COPY . /usr/src/app/open-bpmn
RUN git clone https://github.com/NourEldin-Ali/open-bpmn.git

# COMPILE DEPENDENCIES METAMODEL part
WORKDIR /usr/src/app/open-bpmn/open-bpmn.metamodel/dependencies
RUN bash compile.sh


# BUILD GLSP Server part
WORKDIR /usr/src/app/open-bpmn/
RUN mvn clean install -DskipTest
Expand Down
Binary file not shown.
26 changes: 26 additions & 0 deletions open-bpmn.metamodel/dependencies/compile.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@echo off
setlocal enabledelayedexpansion

REM Set the directory containing JAR files
set JAR_DIR=.

REM Set Maven coordinates
set GROUP_ID=com.discovery
set ARTIFACT_ID=discovery-bonita
set VERSION=1.0.0

REM Loop through all JAR files in the directory
for %%f in ("%JAR_DIR%\*.jar") do (
REM Extract the base name of the file (without extension)
set "BASE_NAME=%%~nf"

REM Install the JAR file using Maven Install Plugin
mvn install:install-file ^
-Dfile="%%f" ^
-DgroupId=%GROUP_ID% ^
-DartifactId=%ARTIFACT_ID%-%BASE_NAME% ^
-Dversion=%VERSION% ^
-Dpackaging=jar
)

endlocal
24 changes: 24 additions & 0 deletions open-bpmn.metamodel/dependencies/compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

# Directory containing JAR files
JAR_DIR="."

# Group ID, Artifact ID, and Version
GROUP_ID="com.discovery"
ARTIFACT_ID="discovery-bonita"
VERSION="1.0.0"

# Loop through all JAR files in the directory
for JAR_FILE in "$JAR_DIR"/*.jar;
do
# Extract the base name of the file (without extension)
BASE_NAME=$(basename "$JAR_FILE" .jar)

# Install the JAR file using Maven Install Plugin
mvn install:install-file \
-Dfile="$JAR_FILE" \
-DgroupId="$GROUP_ID" \
-DartifactId="$ARTIFACT_ID-$BASE_NAME" \
-Dversion="$VERSION" \
-Dpackaging=jar
done
Binary file not shown.
Binary file added open-bpmn.metamodel/dependencies/jaxb-api.jar
Binary file not shown.
Binary file added open-bpmn.metamodel/dependencies/open-xes.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added open-bpmn.metamodel/dependencies/org/OpenXES.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
39 changes: 32 additions & 7 deletions open-bpmn.metamodel/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.release>11</maven.compiler.release>
<local.repository.folder>${pom.basedir}/dependencies/</local.repository.folder>
</properties>

<build>
<plugins>

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
Expand All @@ -26,18 +28,18 @@
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>org.openbpmn.bpmn.discovery.BPMNDiscovery</mainClass>
<classpathPrefix>lib/</classpathPrefix>
<mainClass>org.openbpmn.bpmn.discovery.BPMNTransformation</mainClass>
<classpathPrefix>lib/*</classpathPrefix>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
</plugin>

</plugins>
</build>

<dependencies>
<dependency>
<groupId>org.glassfish.jaxb</groupId>
Expand All @@ -59,16 +61,39 @@
<artifactId>gson</artifactId>
<version>2.10</version>
</dependency>

<dependency>
<groupId>com.discovery</groupId>
<artifactId>discovery-bonita-bpmn-layout-generator</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.discovery</groupId>
<artifactId>discovery-bonita-javax.activation-api</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.discovery</groupId>
<artifactId>discovery-bonita-jaxb-api</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.discovery</groupId>
<artifactId>discovery-bonita-open-xes</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.discovery</groupId>
<artifactId>discovery-bonita-openxes-xstream</artifactId>
<version>1.0.0</version>
</dependency>
<!-- JUnit Tests -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>5.5.2</version>
<scope>test</scope>
</dependency>



</dependencies>


</project>
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ public static void main(String[] args) {
// example5();
// example6();
// three loops
// example0();
example8();
example0();
// example8();
// example0();
}
long endTime = System.nanoTime();
Expand All @@ -123,10 +123,10 @@ public static void main(String[] args) {

private static void example0() {
String output = path;
String startEventString = "Client application not submitted";
String dependencyRelationsString = "[\"Client application not submitted -> Submit application\", \"Submit application -> Receive application\", \"Receive application -> Review application for completeness and accuracy\", \"Review application for completeness and accuracy -> Send application back for correction\", \"Send application back for correction -> Submit application\", \"Review application for completeness and accuracy -> Check application against regulatory requirements\", \"Check application against regulatory requirements -> Reject application\", \"Reject application -> Inform client of rejection\", \"Inform client of rejection -> Application rejected\", \"Check application against regulatory requirements -> Create account\", \"Create account -> Notify client of successful account creation\", \"Notify client of successful account creation -> Account successfully created\", \"Submit application -> Application withdrawn\", \"Receive application -> Application withdrawn\", \"Review application for completeness and accuracy -> Application withdrawn\", \"Send application back for correction -> Application withdrawn\", \"Check application against regulatory requirements -> Application withdrawn\", \"Reject application -> Application withdrawn\", \"Inform client of rejection -> Application withdrawn\", \"Create account -> Application withdrawn\", \"Notify client of successful account creation -> Application withdrawn\"]";
String parallelRelationString = "[[\"Receive application\", \"Application withdrawn\"], [\"Review application for completeness and accuracy\", \"Application withdrawn\"], [\"Send application back for correction\", \"Application withdrawn\"], [\"Check application against regulatory requirements\", \"Application withdrawn\"], [\"Submit application\", \"Application withdrawn\"], [\"Reject application\", \"Application withdrawn\"], [\"Create account\", \"Application withdrawn\"], [\"Inform client of rejection\", \"Application withdrawn\"], [\"Application rejected\", \"Application withdrawn\"], [\"Notify client of successful account creation\", \"Application withdrawn\"], [\"Account successfully created\", \"Application withdrawn\"]]";
String elementInfoString = "{\"Client application not submitted\": {\"type\": \"start\", \"participant\": \"Client\"}, \"Account successfully created\": {\"type\": \"end\", \"participant\": \"Customer Service Department\"}, \"Application rejected\": {\"type\": \"end\", \"participant\": \"Compliance Department\"}, \"Application withdrawn\": {\"type\": \"end\", \"participant\": \"Client\"}, \"Submit application\": {\"type\": \"human\", \"participant\": \"Client\"}, \"Receive application\": {\"type\": \"human\", \"participant\": \"Customer Service Department\"}, \"Review application for completeness and accuracy\": {\"type\": \"human\", \"participant\": \"Customer Service Department\"}, \"Send application back for correction\": {\"type\": \"human\", \"participant\": \"Customer Service Department\"}, \"Check application against regulatory requirements\": {\"type\": \"human\", \"participant\": \"Compliance Department\"}, \"Reject application\": {\"type\": \"human\", \"participant\": \"Compliance Department\"}, \"Inform client of rejection\": {\"type\": \"human\", \"participant\": \"Compliance Department\"}, \"Create account\": {\"type\": \"service\", \"participant\": \"Compliance Department\"}, \"Notify client of successful account creation\": {\"type\": \"service\", \"participant\": \"Compliance Department\"}}";
String startEventString = "Applicant needs loan";
String dependencyRelationsString = "[\"Applicant needs loan -> Submit loan application form\", \"Submit loan application form -> Loan application submitted\", \"Receive loan application form -> Loan application received\", \"Review application -> Check application completeness\", \"Review application -> Determine eligibility\", \"Check application completeness -> Perform further assessments\", \"Determine eligibility -> Perform further assessments\", \"Perform further assessments -> Make decision on loan approval\", \"Make decision on loan approval -> Disburse loan\", \"Disburse loan -> Loan application submitted\", \"Check application completeness -> Request additional information\", \"Determine eligibility -> Request additional information\", \"Request additional information -> Loan application received\", \"Check application completeness -> Reject application\", \"Determine eligibility -> Reject application\", \"Reject application -> Loan application received\"]";
String parallelRelationString = "[[\"Check application completeness\", \"Determine eligibility\"]]";
String elementInfoString = "{\"Applicant needs loan\": {\"type\": \"start\", \"participant\": \"Applicant\"}, \"Loan application submitted\": {\"type\": \"end\", \"participant\": \"Applicant\"}, \"Loan application received\": {\"type\": \"end\", \"participant\": \"Loan Processing Department\"}, \"Submit loan application form\": {\"type\": \"human\", \"participant\": \"Applicant\"}, \"Receive loan application form\": {\"type\": \"human\", \"participant\": \"Loan Processing Department\"}, \"Review application\": {\"type\": \"human\", \"participant\": \"Loan Processing Department\"}, \"Determine eligibility\": {\"type\": \"human\", \"participant\": \"Loan Processing Department\"}, \"Check application completeness\": {\"type\": \"human\", \"participant\": \"Loan Processing Department\"}, \"Request additional information\": {\"type\": \"human\", \"participant\": \"Loan Processing Department\"}, \"Reject application\": {\"type\": \"human\", \"participant\": \"Loan Processing Department\"}, \"Perform further assessments\": {\"type\": \"human\", \"participant\": \"Loan Processing Department\"}, \"Make decision on loan approval\": {\"type\": \"human\", \"participant\": \"Loan Processing Department\"}, \"Disburse loan\": {\"type\": \"service\", \"participant\": \"Loan Processing Department\"}}";

List<String> startsEvents = new ArrayList<>();
startsEvents.add(startEventString);
Expand Down Expand Up @@ -154,7 +154,7 @@ private static void example0() {
endEvents.add(entry.getKey());
}
}

System.out.println(endEvents);
// Initialize the HashMap

DependencyGraph bpmnTransformation = new DependencyGraph();
Expand All @@ -169,15 +169,18 @@ private static void example0() {
bpmnTransformation.addVertex(targetId);
bpmnTransformation.addEdge(sourceId, targetId);
}

bpmnTransformation.startActivities = startsEvents;
bpmnTransformation.endActivities = endEvents;
bpmnTransformation.parallelism = parallelRelations;
bpmnTransformation.elementInformations = elementsInfo;
// System.out.println(bpmnTransformation.dependencyGraph.toString());
bpmnTransformation.findAndRemoveLoops();

// System.out.println(bpmnTransformation.dependencyGraph.toString());
System.out.println(bpmnTransformation.getDependenciesDFA());
try {
BPMNDiscovery bpmnDiscovery = new BPMNDiscovery(bpmnTransformation);
System.out.println(bpmnDiscovery.dependencies);
System.out.println(bpmnDiscovery.dependenciesGraph.getDependenciesDFA());
bpmnDiscovery.DependencyGraphToBPMN();
bpmnDiscovery.saveMode(output);
} catch (BPMNModelException e) {
Expand Down

0 comments on commit 8b9aa86

Please sign in to comment.