Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into feat/pizza-e-vino
Browse files Browse the repository at this point in the history
  • Loading branch information
DaAnda97 committed Apr 13, 2023
2 parents 4fcb647 + 8807633 commit ffa0935
Show file tree
Hide file tree
Showing 61 changed files with 1,889 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,6 @@ The following ones are contained in this repository:
* [Pizza-order Showcase](./pizza-order-showcase)
* [Schema Client example](./schema-client-example)
* [Process Example](./process-example)
* [Customer Onboarding Showcase](./customer-onboarding-showcase)

More information can be found in [our documentation](https://miranum.com).
41 changes: 41 additions & 0 deletions customer-onboarding-showcase/customer-onboarding-frontend/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?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 https://maven.apache.org/xsd/maven-4.0.0.xsd">

<parent>
<groupId>io.miragon.miranum.consulting</groupId>
<artifactId>customer-onboarding-showcase</artifactId>
<version>0.1.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>
<groupId>io.miragon.miranum.consulting</groupId>
<artifactId>customer-onboarding-frontend</artifactId>
<name>customer-onboarding-frontend</name>
<description>customer-onboarding-frontend</description>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package io.miragon.miranum.examples.customer.onboarding;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class CustomerOnboardingFrontendApplication {
public static void main(String[] args) {
SpringApplication.run(CustomerOnboardingFrontendApplication.class, args);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
server:
port: 5050

miranum:
customer-onboarding-starter:
port: 5151
url: http://localhost:${miranum.customer-onboarding-starter.port}/api/place-application
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
.container {
display: flex;
flex-direction: column;
justify-content: center;
width: 500px;
}

.interaction-container {
margin: auto;
}

.jumbotron {
padding: 4rem 2rem 2rem 2rem;
margin-bottom: 0;
}

.input-group {
display: flex;
flex-direction: row;
align-items: flex-end;
gap: 10px;
}

.submit-button {
display: flex;
justify-content: right;
margin-top: 40px;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
$("#form").submit(async function (event) {
event.preventDefault();

const data = {
"name": $("#name").val(),
"email": $("#email").val(),
"address": $("#address").val(),
"income": $("#income").val(),
"employment": $("#employment").val()
};

fetch(processStarterURL,
{
method: "POST",
headers: {
"Content-Type": "application/json"
},
body: JSON.stringify(data)
}
).then(resp => {
console.log(resp.status);
if (resp.status === 201) {
return resp.json();
}
throw new Error("Application not successful");
}).then(resp => {
const text = `Your application was successful, you will be notified soon!`;
$('.response').append('<br><p style="border:2px solid green; text-align: center">' + text + '</p>');
cleanInputs();
}).catch(err => {
console.error(err);
$('.response').append('<br><p style="border:2px solid red; text-align: center">' + err + '</p>');
})
})
;

const cleanInputs = () => {
$('#form')[0].reset();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
<!doctype html>
<html>
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no">

<!-- Bootstrap CSS -->
<link rel="stylesheet"
href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css"
integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS"
crossorigin="anonymous">

<link rel="stylesheet"
href="css/style.css" th:src="@{/css/style.css}">
<title>ACME Onboarding</title>

<script th:inline="javascript">
/*<![CDATA[*/

const processStarterURL = /*[[${@environment.getProperty('miranum.customer-onboarding-starter.url')}]]*/ null;

/*]]>*/
</script>
</head>
<body>

<div class="container">
<div class="interaction-container">
<div class="jumbotron">
<h1 class="display-4">Welcome to ACME AG &#x26A1;</h1>
<p>On this website you can easily start a customer-onboarding-process!</p>
<hr class="my-4">
<form id="form">
<div class="input-group mb-3">
<label>Your name:</label>
<input required type="text" id="name" name="name" class="form-control" placeholder="John Doe"
aria-label="Type something" aria-describedby="button-addon2">
</div>
<div class="input-group mb-3">
<label>Email Address:</label>
<input required type="email" id="email" name="email" class="form-control" placeholder="[email protected]"
aria-label="Type something" aria-describedby="button-addon2">
</div>
<div class="input-group mb-3">
<label>Address to be provisioned:</label>
<input required type="text" id="address" name="address" class="form-control" placeholder="Street 1, 12345 City"
aria-label="Your address" aria-describedby="button-addon2">
</div>
<div class="input-group mb-3">
<label>Employment:</label>
<input required type="text" id="employment" name="employment" class="form-control" placeholder="permanent"
aria-label="Your name" aria-describedby="button-addon2">
</div>
<div class="input-group mb-3">
<label>Net income per year:</label>
<input required type="number" id="income" name="income" class="form-control" placeholder="10000"
aria-label="Your name" aria-describedby="button-addon2">
</div>
<div class="submit-button mb-3">
<input type="submit" value="Submit" class="btn btn-primary"/>
</div>
</form>
</div>
</div>
<div>
<div class="response"></div>
</div>
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js" th:src="@{https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js}"></script>
<script
src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js"
th:src="@{https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js}"
integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k"
crossorigin="anonymous"></script>
<script src="js/index.js" th:src="@{/js/index.js}"></script>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?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">

<artifactId>customer-onboarding-mail-c7</artifactId>
<name>customer-onboarding-mail-c7</name>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>

<parent>
<groupId>io.miragon.miranum.consulting</groupId>
<artifactId>customer-onboarding-mail</artifactId>
<version>0.1.0-SNAPSHOT</version>
</parent>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>

<dependency>
<groupId>io.miragon.miranum.consulting</groupId>
<artifactId>customer-onboarding-mail-core</artifactId>
<version>${project.version}</version>
</dependency>

<!--Miranum-->
<dependency>
<groupId>io.miragon.miranum</groupId>
<artifactId>worker-adapter-c7</artifactId>
<version>${miranum.version}</version>
</dependency>

<dependency>
<groupId>io.miragon.miranum</groupId>
<artifactId>element-templates-c7</artifactId>
<version>${miranum.version}</version>
</dependency>

<!--Camunda-->
<dependency>
<groupId>org.camunda.community</groupId>
<artifactId>camunda-engine-rest-client-complete-springboot-starter</artifactId>
<version>${camunda7.version}</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io.miragon.miranum.examples.customer.onboarding;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class CustomerOnboardingMailC7Application {

public static void main(String[] args) {
SpringApplication.run(CustomerOnboardingMailC7Application.class, args);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
camunda:
bpm:
client:
base-url: http://localhost:8080/engine-rest
autoDeploy:
enabled: false
disable-backoff-strategy: true
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?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">

<artifactId>customer-onboarding-mail-core</artifactId>
<name>customer-onboarding-mail-core</name>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>

<parent>
<groupId>io.miragon.miranum.consulting</groupId>
<artifactId>customer-onboarding-mail</artifactId>
<version>0.1.0-SNAPSHOT</version>
</parent>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
</dependency>
<dependency>
<groupId>io.miragon.miranum</groupId>
<artifactId>mail-core</artifactId>
<version>${miranum.version}</version>
</dependency>
<dependency>
<groupId>io.miragon.miranum</groupId>
<artifactId>worker-api</artifactId>
<version>${miranum.version}</version>
</dependency>
<dependency>
<groupId>io.miragon.miranum</groupId>
<artifactId>element-template-api</artifactId>
<version>${miranum.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package io.miragon.miranum.examples.customer.onboarding.adapter.in;

import io.miragon.miranum.connect.elementtemplate.api.ElementTemplateProperty;
import io.miragon.miranum.connect.elementtemplate.api.PropertyType;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor
@Getter
public class MailCommand {
@ElementTemplateProperty(type = PropertyType.STRING, notEmpty = true, label = "Name")
private String name;
@ElementTemplateProperty(type = PropertyType.STRING, notEmpty = true, label = "Email")
private String email;
@ElementTemplateProperty(type = PropertyType.STRING, notEmpty = true, label = "Subject")
private String content;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package io.miragon.miranum.examples.customer.onboarding.adapter.in;

import io.miragon.miranum.connect.elementtemplate.api.BPMNElementType;
import io.miragon.miranum.connect.elementtemplate.api.GenerateElementTemplate;
import io.miragon.miranum.connect.worker.api.Worker;
import io.miragon.miranum.integrations.mail.application.port.in.SendMailCommand;
import io.miragon.miranum.integrations.mail.application.port.in.SendMailUseCase;
import lombok.AllArgsConstructor;

@AllArgsConstructor
public class MiranumCustomerNotificationAdapter {

private final SendMailUseCase sendMailUseCase;

@Worker(type = "mailDelivery")
@GenerateElementTemplate(name = "Mail Delivery",
id = "mail-delivery",
type = "mailDelivery",
appliesTo = {BPMNElementType.BPMN_SERVICE_TASK},
version = 1)
public void notifyCustomer(MailCommand sendMailCommand) {
SendMailCommand mailCommand = SendMailCommandFactory.create(sendMailCommand);
sendMailUseCase.sendMail(mailCommand);
}
}
Loading

0 comments on commit ffa0935

Please sign in to comment.