Commit 193f6ef3 authored by David Nichols's avatar David Nichols
Browse files

training updates after feedback from Robert Pelz from Atos on the Java version

parent fe02016c
......@@ -8,6 +8,9 @@
In this example the **omquser** datasource connection will be used. Before it can be used tables should be prepared. To do that a user schema module can be used which is described in the next chapter.
**NOTE** You must create the `omquser` datasource in Qorus before you can deploy the user schema. The `omquser.qconn.yaml`
file contains a definition of an `omquser` datasource, however it assumes that there is an accessible PostgreSQL database already present called `omquser`. Ensure that this database is created or update the file to reference another accessible database with a user with read and write permissions on the DB.
## Database Preparation
### User Schema Management
......
......@@ -98,9 +98,9 @@ code: BasicsExchangeRatesInsertToOrdersTableJava.java
Code:
```java
import com.qoretechnologies.qorus.*;
import com.qoretechnologies.qorus.workflow.*;
import org.qore.lang.mapper.Mapper;
import qore.OMQ.UserApi.*;
import qore.OMQ.UserApi.Workflow.*;
import qore.Mapper.Mapper;
import org.qore.jni.Hash;
......
......@@ -2,7 +2,7 @@
## Service Defintion
This service exposes exchange method providing creation of exchange orders. The exchange method do nothing more then preparing order data and creating an order of **BASICS-EXCHANGE-CURRENCY-WORKFLOW**. It uses the `CreateOrder` building block, which allows users to implement workflow order creation logic without any need for coding. The building block inside calls [**createOrder()**](https://qoretechnologies.com/manual/qorus/latest/qorus/classOMQ_1_1UserApi_1_1UserApi.html#a6cadda1e1395c915f157c661dec76d3a) method and passes prepared order data. There is orders key in order data containing a list with one order received from a request. The hash order has the following format:
This service exposes exchange method providing creation of exchange orders. The exchange method do nothing more then preparing order data and creating an order of **BASICS-EXCHANGE-CURRENCY-WORKFLOW**. It uses the `BBM_CreateOrder` building block, which allows users to implement workflow order creation logic without any need for coding. The building block inside calls the [**createOrder()**](https://qoretechnologies.com/manual/qorus/latest/qorus/classOMQ_1_1UserApi_1_1UserApi.html#a6cadda1e1395c915f157c661dec76d3a) method and passes the prepared order data to it. There is an `orders` key in the order data containing a list with one order received from a request. The order hash has the following format:
```
"id": integer,
......@@ -16,12 +16,14 @@ The service logic is implemented using `class-connections` (building block conne
![alt-text](img/class_connections.gif)
As shown in the above animation one connection is created for connecting service's exchange method with the `createOrder` method of the building-block. Also the mappper that was created in the previous tutorial is used.
As shown in the above animation one connection is created for connecting service's exchange method with the `createOrder` method of the building-block. Also the mapper that was created in the previous tutorial is used.
The `CreateOrder` building block provides several configuration items in order to control its behaviour, at least the `create-workflow-name` configuration item should be set:
![alt-text](img/config_items.gif)
The mapper used to map the input to the workflow static data is `exchange-currency-api-mapper-1.0.qmapper.yaml`, using output type `/qorus-api/workflows/create-order/request` which is what the `BBM_CreateOrder` building block requires. The mapper creates custom fields under the `staticdata` key to give structure to the workflow's static data, and also uses custom fields for the input corresponding to the data provided by the call to the `exchange()` method. Open the mapper in the IDE to check its structure.
## Testing
Once the service is loaded to Qorus it can be tested in Qorus UI. To do that, in the **services** tab by click on the **detail** button of the item containing **basics-simple-service** name. It'll show the details of the service. Then click on the **execute** button in the **methods** tab and fill the arguments as in the screenshots below:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment