Skip to content

Commit

Permalink
upgrade config and docu
Browse files Browse the repository at this point in the history
issue #4
  • Loading branch information
rsoika committed Jun 16, 2024
1 parent f733871 commit b904f58
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 70 deletions.
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ services:
POSTGRES_CONNECTION: "jdbc:postgresql://db/workflow"
MODEL_DEFAULT_DATA: "/home/imixs/model/ticket-en-1.0.0.bpmn"
MODEL_DEFAULT_DATA_OVERWRITE: "true"
# Metrics
METRICS_ENABLED: "true"
# Payara-Micor ENV
MP_OPENAPI_SERVERS: "http://localhost:8080"
# MP_OPENAPI_SERVERS: "http://localhost:8080"
ports:
- "8080:8080"

Expand Down
6 changes: 5 additions & 1 deletion src/main/java/org/imixs/microservice/ImixsApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@

package org.imixs.microservice;

import org.eclipse.microprofile.openapi.annotations.OpenAPIDefinition;
import org.eclipse.microprofile.openapi.annotations.info.Info;

import jakarta.ws.rs.ApplicationPath;
import jakarta.ws.rs.core.Application;

Expand All @@ -38,7 +41,8 @@
* @version 1.0
*/

@ApplicationPath("/")
@OpenAPIDefinition(info = @Info(title = "Imixs-Microservice", version = "3.0.0"))
@ApplicationPath("/api")
public class ImixsApplication extends Application {

public static final String ENV_IMIXS_MODEL = "IMIXS_MODEL";
Expand Down
10 changes: 1 addition & 9 deletions src/main/resources/META-INF/microprofile-config.properties
Original file line number Diff line number Diff line change
@@ -1,10 +1,2 @@
# packages
mp.openapi.scan.packages=org.imixs.workflow.jaxrs,org.imixs.workflow.xml

mp.openapi.servers.path./api=https://xyz.io/v1

#openapi.ui.swaggerUiTheme=monokai
openapi.ui.copyrightBy=Imixs
openapi.ui.title=Imixs Workflow
openapi.ui.swaggerHeaderVisibility=hidden
openapi.ui.serverVisibility=visible
#mp.openapi.scan.packages=org.imixs.microservice,org.imixs.workflow.jaxrs,org.imixs.workflow.xml
6 changes: 3 additions & 3 deletions src/main/webapp/WEB-INF/beans.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://xmlns.jcp.org/xml/ns/javaee"
<beans xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee http://xmlns.jcp.org/xml/ns/javaee/beans_2_0.xsd"
bean-discovery-mode="all" version="2.0">
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/beans_3_0.xsd"
bean-discovery-mode="all" version="3.0">
</beans>
7 changes: 0 additions & 7 deletions src/main/webapp/WEB-INF/ejb-jar.xml

This file was deleted.

8 changes: 4 additions & 4 deletions src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"
version="3.0">
<web-app xmlns="https://jakarta.ee/xml/ns/jakartaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd"
version="6.0">
<display-name>Imixs-Microservice</display-name>
<welcome-file-list>
<welcome-file>/index.html</welcome-file>
Expand Down
117 changes: 72 additions & 45 deletions src/main/webapp/index.html
Original file line number Diff line number Diff line change
@@ -1,51 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Imixs-Microservice</title>
<meta name="viewport"
content="width=device-width, initial-scale=1, minimum-scale=1" />
<meta http-equiv="content-type" content="text/html;charset=UTF-8" />
<title>Imixs-Microservice</title>
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />

<link type="text/css;charset=UTF-8" rel="stylesheet" media="all"
href="imixs-basic.css" />
<link type="text/css;charset=UTF-8" rel="stylesheet" media="all"
href="imixs-layout.css" />
<link rel="stylesheet" href="./fonts/typicons.min.css" />
<link type="text/css;charset=UTF-8" rel="stylesheet" media="all" href="imixs-basic.css" />
<link type="text/css;charset=UTF-8" rel="stylesheet" media="all" href="imixs-layout.css" />
<link rel="stylesheet" href="./fonts/typicons.min.css" />

<link type="text/css;charset=UTF-8" rel="stylesheet" media="all"
href="imixs-microservice.css" />
<link type="text/css;charset=UTF-8" rel="stylesheet" media="all" href="imixs-microservice.css" />


<style>
</style>
<style>
</style>
</head>

<body>

<div id="header">
<div class="row">

<div id="imixs-servicenav">
<ul>
<li><a href="./index.html"><span
class="typcn typcn-home-outline"></span>Home</a></li>
<li><a href="./index.html"><span class="typcn typcn-home-outline"></span>Home</a></li>

<li><a href="https://github.com/imixs/imixs-microservice"
target="_blank"><span class="typcn typcn-social-github"></span>Source
<li><a href="https://github.com/imixs/imixs-microservice" target="_blank"><span
class="typcn typcn-social-github"></span>Source
Code</a></li>

<li><a href="http://www.imixs.org" target="_blank"><span
class="typcn typcn-world"></span>imixs-workflow</a></li>
class="typcn typcn-world"></span>imixs-workflow</a></li>

</ul>
</div>

<div id="imixs-header">
<div id="imixs-logo"></div>
<div id="imixs-branding">
<span class="imixs-brandingtext1">Imixs Workflow</span> <span
class="imixs-brandingtext3">...the open source workflow
<span class="imixs-brandingtext1">Imixs Workflow</span> <span class="imixs-brandingtext3">...the
open source workflow
technology for business applications</span>
<p>
<span class="imixs-brandingtext2">Microservice</span>
Expand All @@ -69,24 +65,36 @@
<h1>Welcome to Imixs-Workflow</h1>
<p>

The <a href="https://github.com/imixs/imixs-microservice"
target="_blank">Imixs-Microservice project</a> encapsulates the <a
href="http://www.imixs.org" target="_blank">Imixs-Workflow
The <a href="https://github.com/imixs/imixs-microservice" target="_blank">Imixs-Microservice
project</a> encapsulates the <a href="http://www.imixs.org" target="_blank">Imixs-Workflow
Engine</a> into a RESTful web service interface. The
Imixs-Microservice can be bound to any business application,
independent from the technology behind. In this architectural style
the business logic can be changed without changing a single line of
code.
</p>


<h2>OpenAPI</h2>
<p>Imixs-Microservice is based on Eclipse Microprofile and supports the <a
href="https://download.eclipse.org/microprofile/microprofile-open-api-3.0/microprofile-openapi-spec-3.0.html">MicroProfile
OpenAPI Specification 3.0</a>.
You can open the OpenAPI documentation at <a href="/openapi">http://localhost:8080/openapi</a>.
</p>
<p>
In addition the project provides a Swagger UI for easy testing:
</p>
<img src="openapi-ui.png" style="width: 800px;margin: 20px;" />
<p>
You can open the UI in your browser: <a href="/api/openapi-ui"
target="_blank">http://localhost:8080/api/openapi-ui</a>:
</p>

<h2>How to Deploy a BPMN Model</h2>
<p>
After you have setup the Imixs-Workfow Microservice you can deploy
a workflow Model. A workflow model can be created using the <a
href="http://www.imixs.org/doc/modelling/index.html"
target="_blank">Imixs-BPMN eclipse Plugin</a>. A workflow Model
href="http://www.imixs.org/doc/modelling/index.html" target="_blank">Imixs-BPMN eclipse
Plugin</a>. A workflow Model
can be deployed into the Imixs-Workflow using the 'Model-REST
service' interface. You can deploy the default 'Ticket Workflow'
using the curl command: <br />
Expand All @@ -101,17 +109,35 @@ <h2>Verify Model</h2>

<p>
To verify if the model was deployed successfully you can check the
deployed model version with the Rest API: <a href="./api/model"
target="_blank" class="sample-url">http://[YOURSERVER]/api/model</a>
deployed model version with the Rest API: <a href="./api/model" target="_blank"
class="sample-url">http://[YOURSERVER]/api/model</a>

</p>


<h2>Create a Process Instance</h2>
<p>To create a new process instance you can POST a JSON Object
to the Imixs-Microservice in the following way:</p>
<p>To create a new process instance you can POST a XML Object
to the Imixs-Microservice in the following :</p>


<pre><code style="background-color: transparent;color: #000;">&lt;document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
&lt;item name="$modelversion"&gt;&lt;value xsi:type="xs:string"&gt;1.0&lt;/value&gt;&lt;/item&gt;
&lt;item name="$taskid"&gt;&lt;value xsi:type="xs:int"&gt;1000&lt;/value&gt;&lt;/item&gt;
&lt;item name="$eventid"&gt;&lt;value xsi:type="xs:int"&gt;10&lt;/value&gt;&lt;/item&gt;
&lt;item name="_subject"&gt;
&lt;value xsi:type="xs:string"&gt;some data...&lt;/value&gt;
&lt;value xsi:type="xs:string"&gt;more data...&lt;/value&gt;
&lt;/item&gt;
&lt;/document&gt;
</code></pre>

<pre><code style="background-color: transparent;color: #000;">curl --user admin:adminadmin -H "Content-Type: application/xml" -H 'Accept: application/xml' -d \
To post the XML request, you can use the OpenAI UI from your browser: <a href="/api/openapi-ui"
target="_blank">http://localhost:8080/api/openapi-ui</a>

<br /><br />
or you can even use simply a `curl` command from your command line:

<pre><code style="background-color: transparent;color: #000;">curl --user admin:adminadmin -H "Content-Type: application/xml" -H 'Accept: application/xml' -d \
'&lt;document xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema"&gt;
&lt;item name="$modelversion"&gt;&lt;value xsi:type="xs:string"&gt;1.0&lt;/value&gt;&lt;/item&gt;
&lt;item name="$taskid"&gt;&lt;value xsi:type="xs:int"&gt;1000&lt;/value&gt;&lt;/item&gt;
Expand All @@ -122,18 +148,18 @@ <h2>Create a Process Instance</h2>
&lt;/item&gt;
&lt;/document&gt;' \
http://localhost:8080/api/workflow/workitem
</code></pre>
<p>The result can be verified by the following GET URI:</p>
<a href="./api/workflow/tasklist/creator/admin"
target="_blank" class="sample-url">http://[YOURSERVER]/api/tasklist/creator/admin</a>
<p>
<a href="https://github.com/imixs/imixs-microservice">See
</code></pre>

<p>The result can be verified by the following GET URI:</p>

<a href="./api/workflow/tasklist/creator/admin" target="_blank"
class="sample-url">http://[YOURSERVER]/api/tasklist/creator/admin</a>


<p>
<a href="https://github.com/imixs/imixs-microservice">See
the Imixs-Microservice Project on GitHub for further Information.</a>
</p>
</p>
</div>


Expand All @@ -145,4 +171,5 @@ <h2>Create a Process Instance</h2>
<p></p>
</div>
</body>

</html>
Binary file added src/main/webapp/openapi-ui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b904f58

Please sign in to comment.