-
Notifications
You must be signed in to change notification settings - Fork 0
Development
- Java 8 JVM - at least version 8u171, but not Java 9 or higher.
- IntelliJ IDEA - supported versions 2017.x, 2018.x and 2019.x (with Kotlin plugin version 1.2.71).
- Gradle 4.10 - the gradlew script in the project will download it for you.
- Open IntelliJ.
- Open the folder
bpmnParser\as project in IntelliJ. - Make sure that the folder
src\is marked as Sources Root. - Click
File, thenProject Structure. UnderProject SDK:, set the project SDK by clickingNew..., clickingJDK, and navigating toC:\Program Files\Java\jdk1.8.0_XXXon Windows orLibrary/Java/JavaVirtualMachines/jdk1.8.XXXon MacOSX (where XXX is the latest minor version number). ClickApplyfollowed byOK.
For developing the bpmn parser:
- Inside of the main() function of the XmlReader.kt you have to set the path to the testing bpmn. The default value is choreo.bpmn as this is used by the adapter server.
- Run the
XmlReader.kt, which will generate a CorDapp project for the BPMN undermantichor-corda\cordapp__XXX\(XXX = id of the BPMN). - Open a terminal window in the
cordapp_XXXdirectory.
! For Windows: The project is build for the Unix platform.
! Therefore, you have to open the generated CorDapp as project in IntelliJ.
! Then delete the folder `.gradle` and the file `gradle-wrapper.properties`
! under `mantichor-corda\cordapp__XXX\gradle\wrapper`.
! Then click on `Import changes`.- Run the
buildGradle task to compile our CorDapp project:
Unix/Mac OSX:./gradlew build
Windows:gradlew.bat build - Run the
deployNodesGradle task to build four nodes with our CorDapp already installed on them:
Unix/Mac OSX:./gradlew deployNodes
Windows:gradlew.bat deployNodes - Start the nodes by running the following command:
Unix/Mac OSX: workflows-kotlin/build/nodes/runnodes
Windows: call workflows-kotlin/build/nodes/runnodes.bat - Each participant server needs to be started in its own terminal/command prompt, replace participantID with the specific participant id, e.g. participant_a:
Unix/Mac OSX: ./gradlew runparticipantIDServer
Windows: gradlew.bat runparticipantIDServer
+ Under `mantichor-corda\bpmnParser\` you will find the file `deployServer.txt`,
+ which the `XmlReader.kt` has also generated. There you have a list of the participants.The server that implements the defined interface lives inside the mantichor-corda\adapterServer\ folder. The index.js file contains the server. You need to have Node.js installed to run it. The server is completely written with libraries that Node.js provides. Therefore, additional installations are not required. To run it, open a terminal window and execute node index.js.
To test the Server refere to the defined interface and send the corresponding requests to http://localhost:8080. We recomment to use Postman to do that. For testing the projects, that are generated by the bpmn parser, you need to send the request to the corresponding corda node. For excuting a task corda implies a special structure:
http://localhost:50005/api/generatedBPMNID/TASKNAME?partyName0=O=FIRSTPARTICIPANTID, L=London, C=GB&partyName1=O=SECONDPARTICIPANTID, L=London, C=GB&...
For example you could run: http://localhost:50005/api/generatedchoreo/Task?partyName0=O=participant_a, L=London, C=GB&partyName1=O=participant_b, L=London, C=GB