Commit 064e3d64 authored by Alzhan Turlybekov's avatar Alzhan Turlybekov
Browse files

use mapAuto and Hash

parent 6d442998
......@@ -2,18 +2,16 @@ import com.qoretechnologies.qorus.*;
import com.qoretechnologies.qorus.workflow.*;
import org.qore.lang.mapper.Mapper;
import org.qore.jni.Hash;
class BasicsExchangeRatesInsertToOrdersTableJava extends QorusNormalStep {
private final String mapperName = "basics-exchange-currency-orders";
@SuppressWarnings("unchecked")
public void primary() throws Throwable {
Mapper mapper = getMapper(mapperName);
Hash orders = (Hash)getStaticData("orders");
Object orders = getStaticData("orders");
try {
mapper.mapAll(orders);
mapper.mapAuto(orders);
} catch (Exception e) {
mapper.rollback();
throw e;
......
# This is a generated file, don't edit!
type: mapper
name: exchange-currency-api-mapper
desc: "prepares static data for BASICS-EXCHANGE-CURRENCY-WORKFLOW"
desc: prepares static data for BASICS-EXCHANGE-CURRENCY-WORKFLOW
author:
- Qore Technologies, s.r.o.
fields:
......@@ -133,99 +133,95 @@ options:
amount:
canBeNull: false
desc: amount
isChild: true
isCustom: true
level: 2
name: amount
parent: orders
parentPath: staticdata.orders
path: staticdata.orders.amount
type:
base_type: list<auto>
can_manage_fields: false
base_type: auto
can_manage_fields: true
fields: {}
mandatory: true
name: list<auto>
options:
qore.no_null: true
supported_options:
qore.no_null:
desc: >-
if True then NULL is not supported on
input if NOTHING is also not accepted
type: bool
typename: list
mandatory: false
name: auto
options: null
supported_options: null
typename: any
types_accepted:
- list<auto>
- any
types_returned:
- list<auto>
- any
currency_to_buy:
canBeNull: false
desc: currency_to_buy
isChild: true
isCustom: true
level: 2
name: currency_to_buy
parent: orders
parentPath: staticdata.orders
path: staticdata.orders.currency_to_buy
type:
base_type: list<auto>
can_manage_fields: false
base_type: auto
can_manage_fields: true
fields: {}
mandatory: true
name: list<auto>
options:
qore.no_null: true
supported_options:
qore.no_null:
desc: >-
if True then NULL is not supported on
input if NOTHING is also not accepted
type: bool
typename: list
mandatory: false
name: auto
options: null
supported_options: null
typename: any
types_accepted:
- list<auto>
- any
types_returned:
- list<auto>
- any
currency_to_sell:
canBeNull: false
desc: currency_to_sell
isChild: true
isCustom: true
level: 2
name: currency_to_sell
parent: orders
parentPath: staticdata.orders
path: staticdata.orders.currency_to_sell
type:
base_type: list<auto>
can_manage_fields: false
base_type: auto
can_manage_fields: true
fields: {}
mandatory: true
name: list<auto>
options:
qore.no_null: true
supported_options:
qore.no_null:
desc: >-
if True then NULL is not supported on
input if NOTHING is also not accepted
type: bool
typename: list
mandatory: false
name: auto
options: null
supported_options: null
typename: any
types_accepted:
- list<auto>
- any
types_returned:
- list<auto>
- any
id:
canBeNull: false
desc: id
isChild: true
isCustom: true
level: 2
name: id
parent: orders
parentPath: staticdata.orders
path: staticdata.orders.id
type:
base_type: list<auto>
can_manage_fields: false
base_type: auto
can_manage_fields: true
fields: {}
mandatory: true
name: list<auto>
options:
qore.no_null: true
supported_options:
qore.no_null:
desc: >-
if True then NULL is not supported on
input if NOTHING is also not accepted
type: bool
typename: list
mandatory: false
name: auto
options: null
supported_options: null
typename: any
types_accepted:
- list<auto>
- any
types_returned:
- list<auto>
- any
mandatory: true
name: hash<auto>
options:
......
......@@ -19,7 +19,7 @@ class BasicsExchangeCurrencyApiServiceJava extends QorusService {
}
// ==== GENERATED SECTION! DON'T EDIT! ==== //
public Object exchange(Map<String, Object> params) throws Throwable {
public Object exchange(Object params) throws Throwable {
return classConnections.Connection_1(params);
}
// ======== GENERATED SECTION END ========= //
......@@ -57,7 +57,7 @@ class ClassConnections_BasicsExchangeCurrencyApiServiceJava {
UserApi.logInfo("Connection_1 called with data: %y", params);
mapper = UserApi.getMapper("exchange-currency-api-mapper");
params = mapper.mapData((Map<String, Object>)params);
params = mapper.mapAuto(params);
UserApi.logInfo("calling createOrder: %y", params);
return callClassWithPrefixMethod("BBM_CreateOrder", "createWorkflowOrderConnector", params);
......
......@@ -11,11 +11,11 @@ public class BasicsExchangeCurrencyApiServiceTest {
private static Hash Order = new Hash();
public static void main(String[] args) throws Throwable {
Order.put("id", List.of(312345));
Order.put("currency_to_buy", List.of("czk"));
Order.put("currency_to_sell", List.of("eur"));
Order.put("amount", List.of(213));
Order.put("comment", List.of("test"));
Order.put("id", 12345);
Order.put("currency_to_buy", "czk");
Order.put("currency_to_sell", "eur");
Order.put("amount", 213);
Order.put("comment", "test");
QorusClientCore.init2();
QorusServiceTest test = new QorusServiceTest(ServiceName);
......
Markdown is supported
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