Versionen im Vergleich

Schlüssel

  • Diese Zeile wurde hinzugefügt.
  • Diese Zeile wurde entfernt.
  • Formatierung wurde geändert.

...

Codeblock
languagejava
titleorg.nuclet.mt940.job.MT940Importer
	
public MT940Importer(final JobContext context, 
        final String strMT940Directory,
        final String strMT940ReferenceType)
    {

        super(context, strMT940Directory, strMT940ReferenceType);

        // @replace!
        //
        // Replace with your own logic and/or your own parser here, if you 
        // need more specific behaviour.
        //
        this.logic = new MT940Logic(context, strMT940ReferenceType);

        this.parser = new MT940Parser(context);

    }

 

Der Java-Sourcecode ist mit @replace!-Tags an all jenen Stellen markiert, wo anwendungsspezifisches Verhalten hinzugefügt werden kann. Dazu mehr im nächsten Abschnitt "Integration".

...

Codeblock
languagejava
titleorg.nuclet.mt940.job.MT940ImportJob
 
@Rule(name="MT940 Import Job", description="MT940 Import Job")
 public class MT940ImportJob implements JobRule 
 {
     // @replace!
     //
     // Configure the constants MT940_DIRECTORY, MT940_REFERENCE_TYPE with your own values:
     //
     private static final String MT940_DIRECTORY = "/opt/nuclets/data/mt940";
     private static final String MT940_REFERENCE_TYPE = "SINGLE"; // supported values are: { SINGLE, MULTIPLE }
  
    (...)
  }

Info

Anmerkung: Dieser Schritt wird in einer zukünfigen Version entfallen, d.h. sobald die neue Nuclos-API das Auslesen von System-Parametern unterstützt. Sobald dies der Fall ist, wird diese Anpasung über Schritt 7 geregelt (s.o.).

...

Codeblock
languagejava
titleorg.nuclet.mt940.MT940Importer
 /**
   * Process the reference, that has been linked to a bank transaction, accordingly
   * 
   * @note This method has to be filled with application specific behaviour, 
   * e.g. new calculations or further state changes on client billings, in case 
   * client billings were the objects to be referenced by bank transactions
   * 
   * @param reference a BusinessObject that has just been linked to a bank transaction
   * 
   * @throws BusinessException might be thrown by implementing classes in case of errors 
   * or other exceptions
   *
   */
  protected void processReference(final BusinessObject reference) throws BusinessException
  {
      // @replace!
      //
      // Insert your code segment here that is to be executed on the references business object, 
      // e.g. if your bank transactions are linked to client billings and the Nuclos-entity 
      // representing your client billings was named "Client Billing", you would go on operating 
      // an oject of type "ClientBilling" here:
      //
      // ClientBilling clientBilling = (ClientBilling)reference;
      // clientBilling.setIsReferenced(Boolean.TRUE);
      // clientBilling.setIncomingBankTransactionAt(new Date));
      // clientBilling.setAmountOpen(...);
      //
      // StatemodelProvider.changeState(clientBilling, ClientBillingSM.State_N);
      //
  }

 

c) MT940Logic

Die Methode getReferences() wird vor dem Importvorgang ausgeführt. Sie dient dazu, alle bereits existierenden Objekte einzulesen, die beim Import der Bankumsätze als mögliche Referenzobjekte herangezogen werden sollen (bspw. Kundenrechnungen, die noch offen sind und nicht bereits zu einem Bankumsatz zugeordnet wurden).

...

Codeblock
languagejava
titleorg.nuclet.mt940.logic.MT90Logic
  
 /**
   * Fetches all references that need to be considered during the MT940 import process, e.g.
   * all open client billings/invoices that have not yet been linked to other bank transactions
   * 
   * @note A dummy implementation of <code>org.nuclet.mt940.logic.AbstractMt940Logic</code> has 
   * been  provided with this class here, its methods are meant to be implemented with user 
   * specific behaviour.
   * 
   * @return all references that need to be considered during the MT940 import process; the return
   * value comes as as <code>Map</code> in which the <code>BusinessObject</code> represents the
   * map's key while the text, which is meant to be used to link the reference to a bank
   * transaction, represents the map's value
   * 
   * @throws BusinessException might be thrown in case of errors or other exceptions
   *
   */
  public Map<BusinessObject, String> getReferences() throws BusinessException
  {
      final HashMap<BusinessObject, String> mpReferences = new HashMap<BusinessObject, String>();
        
      // @replace!
      // Please, replace this code fragment here with your specific code fitting your needs.
      // 
      // - MT940Reference is just a placeholder for the BusinessObject you'd like to use.
      // - If your aim was to link your client billings to your bank transactions, the client 
      //    billings being represented by the Nuclos-entity "Client Billing", you would use the 
      //    related BusinessObject-class "ClientBilling" here.
      // - Please, expand the query below to a more specific form.
      //
      // - A specific code example could look like this:
      //
      //   Query<ClientBilling> qryGetReferences = QueryProvider.create(ClientBilling.class);                        
      //
      //   qryGetReferences.where(ClientBilling.IsOpen.eq(Boolean.TRUE))
      //       .and(ClientBilling.HasReferencebeenSet.eq(Boolean.FALSE))
      //       .and(ClientBilling.Date.gte(new Date()));
      //
      //   List<ClientBilling> lstReferences = QueryProvider.execute(qryGetReferences);                
      //
      //   for (final ClientBilling billing : lstReferences) {
      //       mpReference.put(billing, billing.getBillingNumber();
      //   }
      //
      //   return references;
      //           
      final Query<MT940Reference> qryGetReferences = QueryProvider.create(MT940Reference.class);                        
      final List<MT940Reference> lstReferences = QueryProvider.execute(qryGetReferences);
        
      for (final MT940Reference reference : lstReferences) {
          mpReferences.put(reference, reference.getReferenceNumber());
      }

      return mpReferences;   
  
 }


d) CheckBankTransactionRef

...