FixedLength

The FixedLength Outbound generator combines sql-based and model-based outbound generation to give the flexibility of either using SQL's or Models to pass on to the FixedLength generator. The generator then uses that to create one or more fixedLengthRows.

Procedure 16.11. Generating an outbound FixedLength

  1. Create an Outbound Interface

    Platform uses Outbound Interfaces to generate data in FixedLength format. Choose format type as FixedLength
    images/download/attachments/144836087/FixLenOutboundInterface-version-1-modificationdate-1645137186000-api-v2.png

  2. Configure the generator for generating the FixedLength outbound.

    The generator can be either Model-based or Net-change based implementation to retrieve the models accordingly and the generator will be used to generate the FixedLengthRow from the corresponding models.
    images/download/attachments/144836087/FixLenOutboundGenerator-version-1-modificationdate-1645137196000-api-v2.png
    The generator should implement its default constructor which should invoke the superclass parameterized constructor:

    public SampleFixLenGenerator() {
    super("ZPTS", "Order.xml");
    }
  3. Converting ModelList to FixLenRows

  4. The generator class must provide the implementation for converting ModelList to List<FixLenRow>. This is done by overriding the method generateRows(List<? extends Model> modelList) which returns List<FixLenRow>.

    @Override
    protected List<FixLenRow> generateRows(List< ? extends Model> modelList) {
    List<FixLenRow> fixLenRows = new ArrayList<FixLenRow>();
    for(Model model : modelList) {
    Order order = (Order)model;
    for(OrderLineItem oLineItem : order.getOrderLineItems()) {
    FixLenRow row = createFixLenRow();
    row.addField(SampleFixLenConstants.FIELD_DLQ_NUMBER, order.getOrderNumber());
    row.addField(SampleFixLenConstants.FIELD_CUSTOMER_REFERENCE, oLineItem.getItemName());
    row.addField(SampleFixLenConstants.FIELD_QUANTITY_TO_DELIVER,String.valueOf(oLineItem.getShippedQuantity()));
    row.addField(SampleFixLenConstants.SUPPLIER_ACCOUNT_NUMBER,order.getPaymentTerms());
    row.addField(SampleFixLenConstants.FIELD_ORDER_NUMBER,1,order.getReferenceOrderNumber());
    row.addField(SampleFixLenConstants.FIELD_ORDER_NUMBER,2,order.getParentOrderNumber());
    if(order.getTotalVolume()!=0) {
    row.addField(SampleFixLenConstants.FIELD_ORDER_NUMBER,3,String.valueOf(order.getTotalVolume()));
    }
    fixLenRows.add(row);
    }
    }
    return fixLenRows;
    }


  5. For every inbound fixedLength row generated, there will be a messageDetail entry created which will record all the details. This gets created only if the outbound generation is successful. In case there are any errors while generating any FixLenRows, then messageDetail entries are not created. The error will be thrown from the generator and it will be logged.

  6. Invoking the FixLen outbound interface

    FixedLength outbound generation leverages Platform’s Integration Subscription feature.
    images/download/attachments/144836087/FixLenSubscriptionTab-version-1-modificationdate-1645137211000-api-v2.png