summaryrefslogtreecommitdiffstats
path: root/Master/Daten- und Systemintegration/CamelPrototype/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'Master/Daten- und Systemintegration/CamelPrototype/src/main/java')
-rw-r--r--Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/FilenameGenerator.java9
-rw-r--r--Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/Main.java13
-rw-r--r--Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/OrderNormalizer.java26
-rw-r--r--Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/OrderRoutes.java74
-rw-r--r--Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/OrderSystem.java148
-rw-r--r--Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/OrderSystemAdaptor.java18
-rw-r--r--Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/OrderSystemDerby.java173
-rw-r--r--Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/OrderTransformer.java25
8 files changed, 486 insertions, 0 deletions
diff --git a/Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/FilenameGenerator.java b/Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/FilenameGenerator.java
new file mode 100644
index 0000000..fbf4e04
--- /dev/null
+++ b/Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/FilenameGenerator.java
@@ -0,0 +1,9 @@
+package de.h_da.fbi.dsi.ws0910.camelprototype;
+
+import org.apache.camel.Exchange;
+
+public class FilenameGenerator {
+ public String getFilename(Exchange exchange) {
+ return "ordermail-"+exchange.getIn().getHeader("orderno")+".txt";
+ }
+}
diff --git a/Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/Main.java b/Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/Main.java
new file mode 100644
index 0000000..e3b4315
--- /dev/null
+++ b/Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/Main.java
@@ -0,0 +1,13 @@
+package de.h_da.fbi.dsi.ws0910.camelprototype;
+
+public final class Main {
+
+ private Main() {
+ // do nothing here
+ }
+
+ public static void main(String[] args) throws Exception {
+ org.apache.camel.spring.Main.main(args);
+ }
+
+}
diff --git a/Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/OrderNormalizer.java b/Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/OrderNormalizer.java
new file mode 100644
index 0000000..f7dc857
--- /dev/null
+++ b/Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/OrderNormalizer.java
@@ -0,0 +1,26 @@
+package de.h_da.fbi.dsi.ws0910.camelprototype;
+
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.model.dataformat.CsvDataFormat;
+
+public class OrderNormalizer extends RouteBuilder{
+ @Override
+ public void configure() throws Exception {
+ from("direct:new-orders-in")
+ .choice()
+ .when(header("from").isEqualTo(constant("csvinput")))
+ //csv order transformer
+ // convert CSV-File to InputNewOrder that further processing expects
+ .unmarshal(new CsvDataFormat())
+ .bean(OrderTransformer.class, "transformFromCsv")
+ // put the InputNewOrder into the channel
+ .to("direct:normalized-orders")
+
+ .when(header("from").isEqualTo(constant("cxf")))
+ // webservice order transformer
+ // we need to convert the CXF payload to InputNewOrder that further processing expects
+ .convertBodyTo(InputNewOrder.class)
+ // put the InputNewOrder into the channel
+ .to("direct:normalized-orders");
+ }
+}
diff --git a/Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/OrderRoutes.java b/Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/OrderRoutes.java
new file mode 100644
index 0000000..19686c7
--- /dev/null
+++ b/Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/OrderRoutes.java
@@ -0,0 +1,74 @@
+package de.h_da.fbi.dsi.ws0910.camelprototype;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+import org.apache.camel.builder.RouteBuilder;
+
+public class OrderRoutes extends RouteBuilder {
+ //OrderSystemAdaptor orderSysAdaptor = new OrderSystemAdaptor();
+ private String email_authuser = null;
+ private String email_authpw = null;
+ private String email_recipient = null;
+
+ public OrderRoutes() {
+ this("neworders@eisy.net.eu.org","crasher@smtp.eisy.net.eu.org","crashm3");
+ }
+ public OrderRoutes(String email_recipient,String email_authuser,String email_authpw) {
+ super();
+ this.email_recipient = email_recipient;
+ this.email_authuser = email_authuser;
+ this.email_authpw = email_authpw;
+ }
+
+ public void configure() throws Exception {
+ // endpoint to our CXF webservice
+ String cxfEndpoint = "cxf://http://localhost:8080/camelprototype/webservices/order"
+ + "?serviceClass=de.h_da.fbi.dsi.ws0910.camelprototype.OrderEndpoint"
+ + "&wsdlURL=OrderService.wsdl";
+
+ from(cxfEndpoint)
+ // set header field to keep track of requester
+ .setHeader("from",constant("cxf"))
+ .to("direct:new-orders-in");
+ from("file://target/csvinput?recursive=true&delete=true")
+ .setHeader("from",constant("csvinput"))
+ .to("direct:new-orders-in");
+
+ from("direct:normalized-orders")
+ // pass the new order to the order management system gateway
+ // function integration
+ .processRef("ordersystemadaptor")
+ // send the notification email
+ .to("direct:sendordermail")
+ // CBR: if the order was sent by a webservice request
+ .choice()
+ .when(header("from").isEqualTo("cxf"))
+ // send a response back to webservice client
+ // return OK as response
+ .process(new Processor() {
+ public void process(Exchange exchange) throws Exception {
+ OutputNewOrder res = new OutputNewOrder();
+ res.setStatus("0");
+ res.setMessage((String) exchange.getIn().getHeader("orderno"));
+ exchange.getOut().setBody(res,OutputNewOrder.class);
+ }
+ })
+ .otherwise().end();
+
+ // generate order mail file
+ from("direct:sendordermail")
+ // set the file name
+ .setHeader("CamelFileName", bean(FilenameGenerator.class,"getFilename"))
+ // and create the mail body using velocity templating
+ .to("velocity:OrderMailBody.vm")
+ // and store the file
+ .to("file://target/ordermails/");
+
+ // from the file -> send email
+ from("file://target/ordermails/?move=sent")
+ // set the subject of the email
+ .setHeader("subject", constant("New Order notification"))
+ // send the email
+ .to("smtp://"+email_authuser+"?password="+email_authpw+"&to="+email_recipient);
+ }
+}
diff --git a/Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/OrderSystem.java b/Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/OrderSystem.java
new file mode 100644
index 0000000..28a06d2
--- /dev/null
+++ b/Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/OrderSystem.java
@@ -0,0 +1,148 @@
+package de.h_da.fbi.dsi.ws0910.camelprototype;
+
+import java.sql.CallableStatement;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+public class OrderSystem {
+
+ private static final String DB_NAME = "jdbc:hsqldb:file:target/db/orderDB";
+ private static final String DB_USER="sa";
+ private static final String DB_PASSWORD="";
+ private static final String DB_DRV = "org.hsqldb.jdbcDriver";
+
+ private static final String CREATE_ORDERTBL_SQL = "CREATE TABLE \"orders\" (" +
+ "orderid INT generated by default as identity (start with 1) PRIMARY KEY, "+
+ "customerno VARCHAR(50) NOT NULL, " +
+ "order_created_ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP )";
+ private static final String CREATE_ORDERPOSTBL_SQL = "CREATE TABLE \"orderpos\" (" +
+ "orderposid INT generated by default as identity (start with 1) PRIMARY KEY, "+
+ "orderid INT NOT NULL, "+
+ "articleno VARCHAR(50) NOT NULL,"+
+ "articlename VARCHAR(50) NOT NULL,"+
+ "amount INT NOT NULL )";
+
+ private static final String ORDER_INSERT_SQL = "INSERT INTO \"orders\" " +
+ "(orderid,customerno) VALUES(null,?)";
+ private static final String ORDERPOS_INSERT_SQL = "INSERT INTO \"orderpos\" " +
+ "(orderposid,orderid,articleno,articlename,amount) VALUES(null,?,?,?,?)";
+ private Connection con = null;
+ private static OrderSystem theInstance = null;
+
+ public static OrderSystem getInstance() throws ClassNotFoundException, SQLException {
+ if(theInstance == null) {
+ theInstance = new OrderSystem();
+ }
+ return theInstance;
+ }
+
+ public OrderSystem() throws ClassNotFoundException, SQLException {
+ Class.forName(DB_DRV);
+ initDB();
+ }
+
+ private void initDB() throws SQLException {
+ try {
+ Statement stmt = getDbConnection().createStatement();
+ ResultSet rs = getDbConnection().getMetaData().getTables(null,null, "orders", null);
+ if(!rs.next()) stmt.execute(CREATE_ORDERTBL_SQL);
+ rs = getDbConnection().getMetaData().getTables(null,null, "orderpos", null);
+ if(!rs.next()) stmt.execute(CREATE_ORDERPOSTBL_SQL);
+ stmt.close();
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ }
+ private Connection getDbConnection() {
+ if (con == null) {
+ try {
+ con = DriverManager.getConnection(DB_NAME,DB_USER,DB_PASSWORD);
+ } catch (SQLException sqle) {
+ sqle.printStackTrace();
+ //throw new RuntimeException("Error connecting to DB",sqle);
+ }
+ }
+ return con;
+ }
+
+ private String insertNewOrder(InputNewOrder newOrder) {
+ int orderNo = -1;
+ try {
+ PreparedStatement pStmt = getDbConnection().prepareStatement(ORDER_INSERT_SQL);
+ pStmt.setString(1, newOrder.getCustomerNo());
+ pStmt.execute();
+ CallableStatement cstmt = getDbConnection().prepareCall("{CALL IDENTITY()}");
+ ResultSet row = cstmt.executeQuery();
+ if(row.next()) {
+ orderNo = row.getInt(1);
+ }
+ row.close();
+ cstmt.close();
+ if (orderNo != -1) {
+ for(OrderPosition pos : newOrder.getOrderpositions()) {
+ pStmt = getDbConnection().prepareStatement(ORDERPOS_INSERT_SQL);
+ int j = 0;
+ pStmt.setInt(++j, orderNo);
+ pStmt.setString(++j, pos.getArticleNo());
+ pStmt.setString(++j, pos.getArticle());
+ pStmt.setInt(++j, pos.getAmount());
+ pStmt.executeUpdate();
+ }
+ }
+ pStmt.close();
+ } catch (SQLException sqle) {
+ sqle.printStackTrace();
+ }
+ return Integer.toString(orderNo);
+ }
+
+ public synchronized String handleNewOrder(InputNewOrder newOrder) {
+ String orderNum = insertNewOrder(newOrder);
+ return orderNum;
+ }
+ public synchronized void dumpOrders() {
+ StringBuilder dump = new StringBuilder();
+ try {
+ dump.append("=============================\n");
+ dump.append("\tStart Order Dump\n");
+ dump.append("=============================\n");
+ dump.append("OrderID").append("\t").append("CustNo").append("\t");
+ dump.append("ArtNo").append("\t").append("Article").append("\t\t");
+ dump.append("Amount").append("\t").append("Created on").append("\n");
+ dump.append("--------------------------------------------------------\n");
+ Statement stmt = getDbConnection().createStatement();
+ String sql = "SELECT * from \"orders\" AS o JOIN \"orderpos\" AS op ON o.orderid = op.orderid";
+ ResultSet rs = stmt.executeQuery(sql);
+ while(rs.next()) {
+ dump.append(rs.getString("orderid")).append("\t");
+ dump.append(rs.getString("customerno")).append("\t");
+ dump.append(rs.getString("articleno")).append("\t");
+ dump.append(rs.getString("articlename")).append("\t");
+ dump.append(rs.getString("amount")).append("\t");
+ dump.append(rs.getTimestamp("order_created_ts")).append("\n");
+ }
+ rs.close();
+ stmt.close();
+ dump.append("=============================\n");
+ dump.append("\tFinish Order Dump\n");
+ dump.append("=============================\n");
+ System.out.println(dump.toString());
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ }
+ public synchronized void shutdown() {
+ try {
+ Statement stmt = getDbConnection().createStatement();
+ stmt.execute("SHUTDOWN");
+ stmt.close();
+ theInstance = null;
+ } catch (SQLException sqle) {
+ sqle.printStackTrace();
+ }
+ }
+}
diff --git a/Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/OrderSystemAdaptor.java b/Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/OrderSystemAdaptor.java
new file mode 100644
index 0000000..551454b
--- /dev/null
+++ b/Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/OrderSystemAdaptor.java
@@ -0,0 +1,18 @@
+package de.h_da.fbi.dsi.ws0910.camelprototype;
+
+import org.apache.camel.Exchange;
+import org.apache.camel.Processor;
+
+public class OrderSystemAdaptor implements Processor{
+ private OrderSystem ordersystem;
+ public OrderSystemAdaptor(OrderSystem ordersystem) {
+ super();
+ this.ordersystem = ordersystem;
+ }
+ public void process(Exchange exchange) throws Exception {
+ InputNewOrder newOrder = exchange.getIn().getBody(InputNewOrder.class);
+ // here happens functional integration of a legacy system
+ String orderNum =ordersystem.handleNewOrder(newOrder);
+ exchange.getIn().setHeader("orderno", orderNum);
+ }
+}
diff --git a/Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/OrderSystemDerby.java b/Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/OrderSystemDerby.java
new file mode 100644
index 0000000..dff0acf
--- /dev/null
+++ b/Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/OrderSystemDerby.java
@@ -0,0 +1,173 @@
+package de.h_da.fbi.dsi.ws0910.camelprototype;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+public class OrderSystemDerby {
+
+ private static final String DB_URL = "jdbc:derby:;databaseName=orderDB;create=true;";
+ private static final String DB_DRV = "org.apache.derby.jdbc.EmbeddedDriver";
+
+ private static final String CREATE_ORDERTBL_SQL = "CREATE TABLE \"orders\" (" +
+ "orderid INT generated by default as identity (start with 1) PRIMARY KEY, "+
+ "customerno VARCHAR(50) NOT NULL, " +
+ "order_created_ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP )";
+ private static final String CREATE_ORDERPOSTBL_SQL = "CREATE TABLE \"orderpos\" (" +
+ "orderposid INT generated by default as identity (start with 1) PRIMARY KEY, "+
+ "orderid INT NOT NULL, "+
+ "articleno VARCHAR(50) NOT NULL,"+
+ "articlename VARCHAR(50) NOT NULL,"+
+ "amount INT NOT NULL )";
+
+ private static Connection con = null;
+
+ static {
+ String dbdir = System.getProperty("user.dir");
+ dbdir += System.getProperty("file.separator")+"target";
+ dbdir += System.getProperty("file.separator")+"db";
+ System.setProperty("derby.system.home", dbdir);
+ try {
+ Class.forName(DB_DRV);
+
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+ initDB();
+ }
+
+ private static void initDB() {
+ try {
+ Statement stmt = getDbConnection().createStatement();
+ ResultSet rs = getDbConnection().getMetaData().getTables(null,"APP", "orders", null);
+ if(!rs.next()) stmt.execute(CREATE_ORDERTBL_SQL);
+ rs = getDbConnection().getMetaData().getTables(null,"APP", "orderpos", null);
+ if(!rs.next()) stmt.execute(CREATE_ORDERPOSTBL_SQL);
+ stmt.close();
+ } catch (SQLException e) {
+ if(!e.getSQLState().equals("X0Y32")) {
+ e.printStackTrace();
+ }
+ }
+ }
+ private static Connection getDbConnection() {
+ if (con == null) {
+ try {
+ con = DriverManager.getConnection(DB_URL);
+ } catch (SQLException sqle) {
+ sqle.printStackTrace();
+ if(!sqle.getSQLState().equals("XBM0J")) {
+ try {
+ Class.forName(DB_DRV);
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+ try {
+ con = DriverManager.getConnection(DB_URL);
+ } catch (SQLException e) {
+ e.printStackTrace();
+ throw new RuntimeException("Error connecting to DB",sqle);
+ }
+ initDB();
+ } else {
+ shutdown();
+ try {
+ con = DriverManager.getConnection(DB_URL);
+ } catch (SQLException e) {
+ e.printStackTrace();
+ throw new RuntimeException("Error connecting to DB",sqle);
+ }
+ }
+ } catch (NullPointerException npe) {
+ try {
+ Class.forName(DB_DRV);
+ } catch (ClassNotFoundException e) {
+ e.printStackTrace();
+ }
+ initDB();
+ }
+ }
+ return con;
+ }
+
+ private static String insertNewOrder(InputNewOrder newOrder) {
+ int orderNo = -1;
+ try {
+ Statement stmt = getDbConnection().createStatement();
+ String sql = "INSERT INTO \"orders\" (customerno) VALUES('"+newOrder.getCustomerNo()+"')";
+ stmt.executeUpdate(sql, Statement.RETURN_GENERATED_KEYS);
+ ResultSet row = stmt.getGeneratedKeys();
+ if(row.next()) {
+ orderNo = row.getInt(1);
+ }
+ row.close();
+ if (orderNo != -1) {
+
+ for(OrderPosition pos : newOrder.getOrderpositions()) {
+ sql = "INSERT INTO \"orderpos\" " +
+ "(orderid,articleno,articlename,amount) " +
+ "VALUES("+orderNo+",'"+pos.getArticleNo()+"','"
+ +pos.getArticle()+"',"+pos.getAmount()+")";
+ stmt.executeUpdate(sql);
+ }
+ }
+ stmt.close();
+ } catch (SQLException sqle) {
+ sqle.printStackTrace();
+ }
+ return Integer.toString(orderNo);
+ }
+
+ public static String handleNewOrder(InputNewOrder newOrder) {
+ String orderNum = insertNewOrder(newOrder);
+ return orderNum;
+ }
+ public static void dumpOrders() {
+ StringBuilder dump = new StringBuilder();
+ try {
+ dump.append("=============================\n");
+ dump.append("\tStart Order Dump\n");
+ dump.append("=============================\n");
+ dump.append("OrderID").append("\t").append("CustNo").append("\t");
+ dump.append("ArtNo").append("\t").append("Article").append("\t\t");
+ dump.append("Amount").append("\t").append("Created on").append("\n");
+ dump.append("--------------------------------------------------------\n");
+ Statement stmt = getDbConnection().createStatement();
+ String sql = "SELECT * from \"orders\" AS o JOIN \"orderpos\" AS op ON o.orderid = op.orderid";
+ ResultSet rs = stmt.executeQuery(sql);
+ while(rs.next()) {
+ dump.append(rs.getString("orderid")).append("\t");
+ dump.append(rs.getString("customerno")).append("\t");
+ dump.append(rs.getString("articleno")).append("\t");
+ dump.append(rs.getString("articlename")).append("\t");
+ dump.append(rs.getString("amount")).append("\t");
+ dump.append(rs.getTimestamp("order_created_ts")).append("\n");
+ }
+ rs.close();
+ stmt.close();
+ dump.append("=============================\n");
+ dump.append("\tFinish Order Dump\n");
+ dump.append("=============================\n");
+ System.out.println(dump.toString());
+ } catch (SQLException e) {
+ e.printStackTrace();
+ }
+ }
+ public static void shutdown() {
+ boolean gotSQLExc = false;
+ try {
+ DriverManager.getConnection("jdbc:derby:;shutdown=true");
+ } catch (SQLException se) {
+ if ( se.getSQLState().equals("XJ015") ) {
+ gotSQLExc = true;
+ }
+ }
+ if (!gotSQLExc) {
+ System.out.println("Database did not shut down normally");
+ } else {
+ System.out.println("Database shut down normally");
+ }
+ }
+}
diff --git a/Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/OrderTransformer.java b/Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/OrderTransformer.java
new file mode 100644
index 0000000..6c27c7b
--- /dev/null
+++ b/Master/Daten- und Systemintegration/CamelPrototype/src/main/java/de/h_da/fbi/dsi/ws0910/camelprototype/OrderTransformer.java
@@ -0,0 +1,25 @@
+package de.h_da.fbi.dsi.ws0910.camelprototype;
+
+import java.util.List;
+import org.apache.camel.Exchange;
+
+public class OrderTransformer {
+ public void transformFromCsv(Exchange ex) {
+ String filename = ex.getIn().getHeader("CamelFileName",String.class);
+ // csv format will generate a List<List<String>> as body
+ // to avoid unchecked casting this ugly thing is necessary
+ List<?> lines = (List<?>) ex.getIn().getBody();
+ InputNewOrder res = new InputNewOrder();
+ String customerNo = filename.split("\\.")[0];
+ res.setCustomerNo(customerNo);
+ for(Object line: lines) {
+ List<?> cols = (List<?>) line;
+ OrderPosition orderPos = new OrderPosition();
+ orderPos.articleNo = (String) cols.get(0);
+ orderPos.article = (String) cols.get(1);
+ orderPos.amount = Integer.parseInt((String) cols.get(2));
+ res.getOrderpositions().add(orderPos);
+ }
+ ex.getIn().setBody(res);
+ }
+}