Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Unknown macro: {noprint}
Unknown macro: {float}

Contents


Document Logs
Change log:

Date:

Author:

Version:

Changes:

Completed

Ext.

Int.

Is in Core

Unknown macro: {page-info}


Unknown macro: {page-info}


0.1

Doc. created

No

 

 

 

Terms and definitions:

Terms/definitions:

Meaning:

TBD

To be defined

N/A

Not applicable

---- 

1 - Purpose of Document

This document provides the overall technical details and design of implementing and using the functionality as specified in section 2 - Introduction. This document will not cover implementation details – for this the code base should be inspected.

2 - Introduction to Functionality

Brightpoint is a logistic provider who services multiple countries

The implementation can be found at

https://svn.cdrator.com/svn/dev/integration/logistics/EU/BrightPoint/trunk

Maven dependency

<groupId>com.cdrator.integration.logistics</groupId>

<artifactId>rator-logistics-eu-brightpoint</artifactId>

It is SOAP based, and works through placing an order and then polling for the status of the order.

3 - API

There are two ways to use the implementation either through a direct java call, or through an action in a workflow

Java API

Brightpoint have a Java API located in the class com.CDRator.billing.logistics.brightpoint.BrightPointFacade.java

There are three public methods./**

  • PlaceOrder on the BrightPoint gateway
    *
  • @param data All the information needed to place an order
  • @return
  • @throws SysException
    */
    public OrderV20Response placeOrder(PlaceOrderData data) throws SysException {}

/**
 * Get Orders based upon the order number, as generated in CDRator system.
 *
 * @param treeData information needed to make the request
 * @param purchaseNumber The order numbers for fetch orders for.
 * @return
 * @throws SysException
 */
public ArrayOfOrderhead getOrderHistoryByPurchaseNumber(ParameterTreeData treeData, List<String> purchaseNumber)
            throws SysException {}

/**
 * Get Orders from a given date till now.
 *
 * @param treeData information needed to make the request
 * @param date
 * @return
 * @throws SysException
*/
public ArrayOfOrderheadV2 getOrderHistoryByDate(ParameterTreeData treeData, Date date) throws SysException {}
ExampleBrightPointFacade facade = new BrightPointFacade();
OrderV20Response response = facade.placeOrder(data);

Action API

The action API is to be used from a workflow.

PlaceOrder Action

Used for placing an order at Brightpoint@Action
@Description("Place a generic order to BrightPoint")
public class PlaceOrder {

@ActionMethod
@ReturnValue(description = @Description("String: DONE, VALIDATION_ERROR, CONNECTION_ERROR"))
public String execute(GenericOrder order) throws Exception {}
The input is a generic order which must have

GenericOrder:

  • It needs a valid Account, used to find brand
  • A valid deliveryAddress, COMPANY, FIRSTNAME, LASTNAME, STREET, STREETNUMBER, FLOOR, FLOOTUNIT, ZIP, CITY, PHONE
  • STOCK_CODE in the parameter map on the order to set the deliverycategory
  • 1-* order lines. Each of these lines must have a valid productNumber, description, orderlinenumber, TotalExclVat, and a parameter called QUANTITY, if quantity not set a default of 1 will be used

4 - Engine

The Brightpoint project contains an engine used for polling Brightpoint for status on an order called BrightPointPollOrderEngine

The package is located at com.CDRator.billing.logistics.brightpoint.engine.BrightPointPollOrderEngine and it extends engine branded and uses the ENGINE_PARAMETER_PATH='ENGINE.LOGISTICS.BRIGHT_POINT'.

The engine for loop over at GenericOrders in status Processing.

  1. It will then poll Brightpoint for status on the orders.
  2. it will update the GenericOrder responseParameters with a BRIGHTPOINT_STATUS=xxxxxxx
  3. if the response for an order contains tracking_ids those will be added to the GenericOrder responseParameters in a semicolon list TRACKING_ID=xx:yy:zz
  4. If an GenericOrderLine have been delivered the GenericOrderLine responseParameters will also have DELIVERED=TRUE
  5. If the response for a line contains additional information(ESN, ICC...) that information will be added to the GenericOrderLine responseParameters in a semicolon seperated list SERIAL=xx:yy:zz
  6. If 1-* lines on a genericOrder have been delivered the engine will invoke the hookpoint specified on the GenericOrder. It is then up to the workflow to determine if the action should be taken on partially delivered order, or we should just keep polling.
  7. If an order is fully delivered in on go, the hookpoint on the GenericOrder will still be invoked.
Engine Specific Properties

Some properties in the configuration file are specifically for engines, and are shown in the format below:

wrapper.java.mainclass

com.CDRator.billing.engine.GenericEngineStarter

 

This property specifies the java path for CDRator engine starter. Mainclass property must be specified in order to start the engine framework.

 

 

wrapper.app.parameter.1

-S

 

The -S property is optional. But it is a parameter for the GenericEngineStarter which enables the engine starter to make a sleep just before it stops. The reason for this is that in cases where the engine has nothing to do, it can complete very quickly. The Windows NT Service environment might see this as a possible failure and will do a failure count. When the count reaches a specific number, it will halt completely and has to be restarted manually.

 

 

wrapper.app.parameter.2

10

 

Number of seconds engine starter must sleep before it stops.

 

 

wrapper.app.parameter.3

-P

 

Specifies that the next parameter is to start the engine.

 

 

wrapper.app.parameter.4

com.CDRator.billing.logistics.brightpoint.engine.BrightPointPollOrderEngine

 

Specifies the java path of the engine that the generic engine starter must start.

 

 

wrapper.app.parameter.5

Name of the engine

 

Name of the engine

wrapper.app.parameter.6

Number of instances

 

Number of instances

wrapper.app.parameter.7

PartnerCode

 

This is a reference to PARTNER_CODE on GenericOrder table. This basically chooses which generic orders to pick up

As for the actions all the parameters in the configuration section needs to be setup

5 - Logging

The Logistic implementation will save the XML sent to and from Brightpoint to the table called SOAP_CLIENT_LOG.

6 - Configuration

Needed for polling for status of an order

ENGINE.LOGISTICS.BRIGHT_POINT.USERNAME = username

ENGINE.LOGISTICS.BRIGHT_POINT.PASSWORD = password

ENGINE.LOGISTICS.BRIGHT_POINT.ORDER_CHECK_URL = order check end point

Needed for placing an order

ENGINE.LOGISTICS.BRIGHT_POINT.USERNAME = username

ENGINE.LOGISTICS.BRIGHT_POINT.PASSWORD = password

ENGINE.LOGISTICS.BRIGHT_POINT.ORDER_URL = place order end point

ENGINE.LOGISTICS.BRIGHT_POINT.MESSAGE_TYPE = message type (example WEBSERVICE)
ENGINE.LOGISTICS.BRIGHT_POINT.DECIMAL_DELIMETER = decimal delimeter , or .
ENGINE.LOGISTICS.BRIGHT_POINT.CURRENCY_CODE = SEK, DKK, NOK
ENGINE.LOGISTICS.BRIGHT_POINT.ALLOW_BACK_ORDER = (FALSE = Hold shipment until complete; TRUE =Send the order when any product is in stock)
ENGINE.LOGISTICS.BRIGHT_POINT.SITE =site in the body (example SE100)
ENGINE.LOGISTICS.BRIGHT_POINT.ORDER_TYPE =order type, now always set to WWW
ENGINE.LOGISTICS.BRIGHT_POINT.COUNTRY_CODE =country code in the header,default is DK
ENGINE.LOGISTICS.BRIGHT_POINT.SEND_SMS_NOTIFICATION =Enables/Disables sms notification regarding shop order
ENGINE.LOGISTICS.BRIGHT_POINT.INSTANCE = Instance in the header (example SEPROD)

7 - Version

Version

Released

Changes

1.0.2

15-05-2013 14:51:23

ERAICE-667 Changed the engine so that it now uses orderline number to match an orderline in the xml to a generic order line

1.0.1

14-05-2013 10:53:48

ERAICE-651 Changed the SReceiverDeliveryAddress1, SReceiverDeliveryAddress2 and setSReceiverName logic

1.0

01-05-2013 15:03:50

First stable release


  • No labels