This application is tailored to handle all requests from WoPeD to generate a PNML-String from a given Text.
URL | Description |
---|---|
https://woped.dhbw-karlsruhe.de/t2p/ | Embedded UI |
https://woped.dhbw-karlsruhe.de/t2p/swagger-ui/ | Swagger UI |
URL | Description |
---|---|
https://github.com/tfreytag/P2T | Process2Text Webservice |
https://github.com/tfreytag/WoPeD | WoPeD-Client |
URL | Description |
---|---|
https://hub.docker.com/r/woped/text2process | Docker Hub |
- OpenJDK 11 or higher
- Apache Maven
- Git
- IntelliJ IDEA
- WordNet
- Start the application.
- Navigate to
http://localhost:8081/t2p/swagger-ui.
- Insert your business process description in the body of the
POST /t2p/generatePNML
endpoint.
- Start the application.
- Navigate to
http://localhost:8081/t2p/
. - Insert your business process description into the second text area and click on
generate
.
- Start the application.
- Follow the installation instructions of the WoPeD-Client (
https://github.com/tfreytag/WoPeD
). - Start WoPeD-Client and.
- Open the configuration and navigate to
NLP Tools
. Adapt theText2Process
configuration:Server host
:localhost
Port
:8081
URI
:/t2p
- Test your configuration.
- Close the configuration.
- Navigate to
Analyse
->Translate to process model
and execute. The text will now be transformed by your locally started T2P webservice.
- Pull our pre-build docker image from docker hub (see above).
- Run this image on your server.
- Build your own docker image with the Dockerfile.
- Run this image on your server.
It is recommended to use IntelliJ IDE.
The next step is resolving the missing dependencies of the project. There three tasks are necessary.
First of all you need to ad the projects lib folder as library.
This is done by clicking it with the right mouse button and choosing "Add as Library".
It will open a new dialogue in which you need to ensure that the library is just included into the project not on a global level.
The second step is to ensure, that all the third party libraries a imported by Maven. Therefore you need to perform a right click on the project and then do a mouseover on Maven and choose reimport from the opening submenu.
This could take some time to finish, because the stanford models are quite large.
The third and last step is checking whether the proper jdk is used or not.
File -> Project structure will open a new dialogue.
Now go to the project view and check the SDK and language settings.
You need to configure a enviroment variable on your system to make sure the T2P-WebService can find the WordNet dictionary. Therefore we use WORDNET_HOME the same way you are familiar with from JAVA_HOME.
WORDNET_HOME=C:\Program Files (x86)\WordNet\2.1
Finally it is time to give it a try. You can find the main file in the source package. The are two ways to start the application. On the one hand you can click on the play button at the upper right connor in your IDE or on the other it is possible to run it by clicking right on the WoPeDText2ProcessApplication-Class.
Maven will automatically compile the source code to a runnable application. After that the SpringBootServer will start and load the configuration given by the application.properties file. After a short time of loading the server will listen to the port and root path you configured.
The first thing you need to know, the api is using a Rosponse-Object (/src/main/java/de/dhbw/text2process/helper/Response.java)
The controller is located here (/src/main/java/de/dhbw/text2process/controller/T2PController.java)
This is converted to a json String. If there are any errors during the NLP processing the exceptions and the stacktrace are stored in this generic Response as well as the correct result.
Use getResponse() to extract the generated process.
If you want to call the API then use the Swagger-UI mentions above to identify the correct URI. You will get
This is what you have to do in Java to implement the T2P-Interface to your code:
BufferedReader bufferedReader = new BufferedReader(
new InputStreamReader(connection.getInputStream())
);
StringBuilder responseJson = new StringBuilder();
String responseLine;
// Reading the incoming json line by line and transforming it to a single String
while ((responseLine = bufferedReader.readLine()) != null) {
responseJson.append(responseLine.trim());
}
String processModelXmlString = responseJson.toString();
Now you can do what ever you like with the String in your Java application.