| Auszug | ||
|---|---|---|
| ||
CAMT-Nuclet – 4.7.2 CAMT: Businessobjekt-Fassaden: Das CAMT-Nuclet arbeitet mit Wrapper-Objekte anstelle der nur dem Zielnuclet bekannten BusinessObjects (siehe Abschnitt 4.7.1). Daher muss bei der Int |
Sprache: Deutsch · English (in Aufbau)
Das CAMT-Nuclet arbeitet mit Wrapper-Objekte anstelle der nur dem Zielnuclet bekannten BusinessObjects (siehe Abschnitt 4.7.1). Daher muss bei der Integration des MT940-Nuclets …
| Status | ||||
|---|---|---|---|---|
|
| Status | ||||
|---|---|---|---|---|
|
| Status | ||||
|---|---|---|---|---|
|
| Status | ||||
|---|---|---|---|---|
|
| Panel | ||||||
|---|---|---|---|---|---|---|
| ||||||
Auf dieser Seite
|
...
Das CAMT-Nuclet arbeitet mit Wrapper-Objekte anstelle der nur dem Zielnuclet bekannten BusinessObjects (siehe Abschnitt 4.7.1). Daher muss bei der Integration des MT940-Nuclets dafür gesorgt werden, dass gewisse Datenbankzugriffe auf den tatsächlich genutzten Businessobjekte operieren können. D.h. die verwendeten Klassen und Attributnamen müssen bekannt sein. Die Bereitstellung erfolgt über businessobjektbezogene Fassaden.
...
Tabelle 4.7.2: Übersicht, Anpassungen in Fassaden-Klassen
In der Klasse CurrencyFacade müssen die Methoden getWrappedClass() und getIso4217CodeAttribute() implementiert werden:
...
| Codeblock | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
package org.nuclet.camt.facade;
import java.util.List;
import org.nuclos.api.businessobject.BusinessObject;
import org.nuclos.api.exception.BusinessException;
import org.nuclet.common.facade.AbstractFacade;
import org.nuclet.camt.facade.AbstractConditionsOfPaymentFacade;
import org.nuclet.camt.wrapper.AbstractConditionsOfPaymentWrapper;
import org.nuclet.camt.wrapper.ConditionsOfPaymentWrapper;
// @replace! Bitte bei Nuclet-Integration mit eigenem Code ersetzen!
//
// Beispiel:
//
// import org.nuclet.businessobject.ConditionsOfPayment;
/**
* Facade for Business Objects of type "ConditionsOfPayment"
*
*
* @version 1.0
* @date 10.02.2015
* @nuclet org.nuclet.CAMT054
* @nucletversion 1.0.0
* @sincenucletversion 1.0.0
* @since 10.02.2015
* @author frank.lehmann@nuclos.de
*
*/
public class ConditionsOfPaymentFacade<T extends BusinessObject> extends AbstractConditionsOfPaymentFacade<T> // @replace! AbstractConditionsOfPaymentFacade<ConditionsOfPayment>
{
private static final ConditionsOfPaymentFacade instance = new ConditionsOfPaymentFacade();
/**
* Liefert die Singleton-Instanz dieser Klasse
*
*/
public static ConditionsOfPaymentFacade getInstance()
{
return instance;
}
/**
* Wrap the actual currency objects inside an <code>AbstractCurrencyWrapper</code>
*
* @return the actual currency objects, wrapped inside an <code>AbstractCurrencyWrapper</code>
*
*/
public AbstractConditionsOfPaymentWrapper getConditionsOfPaymentWrapper(final BusinessObject boConditionsOfPayment)
{
// @replace!
//
// return new ConditionsOfPaymentWrapper(boConditionsOfPayment);
return new ConditionsOfPaymentWrapper(boConditionsOfPayment);
}
/**
* Get the class of the actual payment condition objects, i.e. the class wrapped by <code>ConditionsOfPaymentWrapper</code>
*
* @return the class of the actual payment condition objects, i.e. the class wrapped by <code>ConditionsOfPaymentWrapper</code>
*
*/
public Class<T> getWrappedClass() //@replace! public class<ConditionsOfPayment>
{
// @replace!
//
// return ConditionsOfPayment.class;
return null;
}
} |
In der Klasse ReferenceFacade müssen die Methode getWrappedClass() und getNuclosStateAttribute() implementiert werden:
...
Die Beschreibung zur Anpassung der beiden Methoden getSourceStates() und getDestinationStates() finden Sie im nächsten Abschnitt (4.7.3).
| Hinweis |
|---|
Bitte beachten Sie außerdem, dass das generische "<T>" in den Zeilen 48 und 139 entsprechend ersetzt werden muss. |
| Codeblock | ||||||||
|---|---|---|---|---|---|---|---|---|
| ||||||||
package org.nuclet.camt.facade;
import java.util.ArrayList;
import java.util.List;
import org.nuclos.api.UID;
import org.nuclos.api.businessobject.BusinessObject;
import org.nuclos.api.businessobject.Query;
import org.nuclos.api.businessobject.QueryOperation;
import org.nuclos.api.businessobject.SearchExpression;
import org.nuclos.api.businessobject.attribute.ForeignKeyAttribute;
import org.nuclos.api.businessobject.facade.Stateful;
import org.nuclos.api.context.JobContext;
import org.nuclos.api.context.RuleContext;
import org.nuclos.api.exception.BusinessException;
import org.nuclos.api.provider.QueryProvider;
import org.nuclos.api.provider.BusinessObjectProvider;
import org.nuclos.api.statemodel.State;
import org.nuclet.common.facade.AbstractFacade;
import org.nuclet.camt.facade.AbstractReferenceFacade;
import org.nuclet.camt.statemodel.ReferenceStatemodel;
import org.nuclet.camt.wrapper.AbstractReferenceWrapper;
import org.nuclet.camt.wrapper.ReferenceWrapper;
// @replace! Bitte bei Nuclet-Integration mit eigenem Code ersetzen!
//
// Beispiel:
//
// import org.nuclet.businesstemplate.ClientBilling;
/**
* Facade for Business Objects of type "Reference"
*
*
* @version 1.0
* @date 10.02.2015
* @nuclet org.nuclet.CAMT054
* @nucletversion 1.0.0
* @sincenucletversion 1.0.0
* @since 10.02.2015
* @author frank.lehmann@nuclos.de
*
*/
public class ReferenceFacade<T extends BusinessObject & Stateful> extends AbstractReferenceFacade<T> // @replace AbstractReferenceFacade<ClientBilling>
{
private static final ReferenceFacade instance = new ReferenceFacade();
/**
* Liefert die Singleton-Instanz dieser Klasse
*
*/
public static ReferenceFacade getInstance()
{
return instance;
}
/**
* Liefert eine Liste von Quellzuständen zum gegebenen Statuswechsel.
*
* @param stateChange Der Statuswechsel, repräsentiert durch ein Objekt vom Typ <code>StateChange</code>.
*
* @return eine Liste von Quellzuständen zum gegebenen Statuswechsel
*
*/
public List<State> getSourceStates(final ReferenceStatemodel.StateChange stateChange)
{
final List<State> lstSourceStates = new ArrayList<State>();
switch (stateChange) {
case PaymentReceived:
// @replace Bitte bei Nuclet-Integration mit eigenem Code ersetzen!
//
// Beispiel:
//
// lstSourceStates.add(ProcessClientBillingSM.State_AB);
// lstSourceStates.add(ProcessClientBillingSM.State_XY);
break;
default:
break;
}
return lstSourceStates;
}
/**
* Liefert den Zielzustand zum gegebenen Statuswechsel.
*
* @param stateChange Der Statuswechsel, repräsentiert durch ein Objekt vom Typ <code>StateChange</code>.
*
* @return der Zielzustand von Quellzuständen zum gegebenen Statuswechsel
*
*/
public State getDestinationState(final ReferenceStatemodel.StateChange stateChange)
{
switch (stateChange) {
case PaymentReceived:
// @replace Bitte bei Nuclet-Integration mit eigenem Code ersetzen!
//
// Beispiel:
//
// return ProcessClientBillingSM.State_ZZ;
//
return null;
default:
return null;
}
}
/**
* Wrap the actual reference objects inside an <code>AbstractReferenceWrapper</code>
*
* @return the actual reference objects, wrapped inside an <code>AbstractReferenceWrapper</code>
*
*/
public AbstractReferenceWrapper getWrapper(final Stateful boReference)
{
// @replace!
//
// return new ReferenceWrapper(boReference);
return new ReferenceWrapper(boReference);
}
/**
* Get the class of the actual reference objects, i.e. the class wrapped by <code>ReferenceWrapper</code>
*
* @return the class of the actual reference objects, i.e. the class wrapped by <code>ReferenceWrapper</code>
*
*/
public Class<T> getWrappedClass() // @replace public Class<ClientBilling> getWrappedClass()
{
// @replace!
//
// return ClientBilling.class;
return null;
}
/**
* Get the attribute <code>NuclosState</code> of the actual reference objects
*
* @return the attribute <code>NuclosState</code> of the actual reference objects
*
*/
public ForeignKeyAttribute<UID> getNuclosStateAttribute()
{
// @replace! Bitte bei Nuclet-Integration mit eigenem Code ersetzen!
//
// Beispiel:
//
// return ClientBilling.NuclosState;
return null;
}
} |
...