Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Wiki Markup
{noprint}
{float:right\|width=300px\|background=lightgrey\|border=solid blue 2px\|margin=10px\|padding=8px}*Contents*
{toc:all=true|depth=4|excerpt=true|indent=14px}
{float}\\
{noprint}\\

*Document Logs*
*Change log:*
|| *Date:* || *Author:* || *Version:* || *Changes:* || Completed || Ext. || Int. || Is in Core ||
| {page-info:created-date\|dateFormat=dd MMMM yyyy}\\ | {page-info:created-user}\\ | 0.1 | Doc. created | No | | | |
*Terms and definitions:*
|| Terms/definitions: || Meaning: ||
| TBD | To be defined |
| N/A | Not applicable |
\---- 

h2. 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.

h2. 2 - Introduction to Functionality

The Electra Logistics Engine handles the order placing and the  retrieval of the order status from Electra.

The Electra Logistic for Generic Orders uses the generic order framework in core. While the Electra Logistic Engine project uses the shop order and webshop.

h2. 3 - API

The Electra Logistic for Generic Orders is located in

<dependency>
&nbsp; <groupId>com.cdrator.integration.logistics</groupId>
&nbsp; <artifactId>rator-logistics-dk-electra-generic</artifactId>
</dependency>

The way to invoke functionality in the project is through Actions, which there are presently two of

h5. PlaceOrder

For placing a new order an Electra

{code}@Action
@Description("Place a generic order to Electra")
public class PlaceOrder {

	/**
	 * Place an order at Electra
	 *
	 * Possible outcomes:
	 * DONE: Succesfull
	 * ERROR: unexpected error
	 *
	 * @param order
	 * @return
	 * @throws Exception
	 */
	@ActionMethod
	@ReturnValue(description = @Description("String: DONE, ERROR"))
	public String execute(GenericOrder order) throws Exception {}{code}
The order must have
* 1-\* order lines, which have DESCRIPTION, PRODUCTNUMBER and optional QUANTITY in parameters. If no quantity is present, '1' will be send
* a valid deliveryAddress, which have FULLNAME, ADDRESS1, CITY, ZIP. Optional COMPANY.
* a valid ACCOUNT, used to find brand
* an ORDER_NUMBER

If no errors occurred which communicating with Electra the ACTION will return "DONE", other wise it will return "ERROR".

h6. Place order response logging

The responseParameters on the GENERIC_ORDER object are always updated with the latest reply for Electra.

Allways set: *ResponseCode*, *ResponseDescription* \- Did the communication with the gateway go OK

h5. Order status

Used to query Electra for a status on an order

{code}@Action
@Description("Get order status at Electra")
public class OrderStatus {

	/**
	 * Action that will get the order status for an order at Electra.
	 * The outcome is a string that will tell the caller what action to perform.
	 * DONE: The order was successfully packaged and sent. An ICC and package IDs have been updated in the order responseParameters
	 * RETRY: The order is still not processed at Electra
	 * CANCELLED: The order was cancelled
	 * ERROR: There was an unexpected error.
	 *
	 * @param order
	 * @return
	 * @throws Exception
	 */
	@ActionMethod
	@ReturnValue(description = @Description("String: DONE, RETRY, CANCELLED, ERROR"))
	public String execute(GenericOrder order) throws Exception {}{code}
The order must have
* a valid ACCOUNT, used to find brand
* an ORDER_NUMBER, used to query Electra

The action can return 4 different strings

*DONE*: When all order lines on an order are fulfilled, Electra responds that the order have been delivered and the action returns 'DONE'&nbsp;

*RETRY*: If the order is still being processed by Electra the ACTION returns 'RETRY'

*CANCELLED*: If the order have been cancelled, the ACTION will return 'CANCELLED'

*ERROR*: If something unexpected occurs 'ERROR' is returned.

h6. Order status response logging

*{+}GenericOrder{+}*


The responseParameters on the GENERIC_ORDER object are always updated with the latest reply for Electra.

Allways set: *ResponseCode*, *ResponseDescription* \- Did the communication with the gateway go OK

If the order was delivered("DONE") these are also set:


*OrderStatusCode*,*OrderStatusDescription* \- Order description

*PackageIds* \- Tracking Ids

*{+}GenericOrderLine{+}*

If the response contains Serial numbers like ICC's those will be place upon the GENERIC_ORDER_LINE response parameter with the name 'SERIAL_NUMBER'


*SERIAL_NUMBER* \- ICCColon numberseperated iflist theof orderSerialNumbers line was a type SIMexample 'SERIAL_NUMBER=1234' or 'SERIAL_NUMBER=1234:122424'


h5. Soap client log

The project used the SOAP_CLIENT_LOG to save the XML being sent to and from Electra



h2. 4 - Configuration

Parameters under ENGINE.LOGISTICS.ELECTRA
|| Key || Default || Description || Optional ||
| WSDL_PATH | | Absolute path for the WSDL file for the engine. Mandatory. | No |

h2. 5 - Operational Considerations


h3. Security

At time of writing Electra validates incoming requests based upon the senders IP. No other security is used.