Class SepaWorkflowService
- Author:
- rsoika
- See Also:
-
SepaImportService
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final intstatic final intstatic final intstatic final intstatic final intstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final String -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncomputeKey(org.imixs.workflow.ItemCollection invoice, org.imixs.workflow.ItemCollection event) Helper Method to compute the grouping key from a workitem.org.imixs.workflow.ItemCollectioncreateNewSEPAExport(String key, org.imixs.workflow.ItemCollection workitem, org.imixs.workflow.ItemCollection event) Helper method to create a new SEPA Export workitemorg.imixs.workflow.ItemCollectionfindBankDataByPaymentType(String paymentType, org.imixs.workflow.ItemCollection configuration, String configType) This method returns a ItemColleciton containing the bank data (Name/IBAN/BIC) for a given configuration type (dbtr|cdtr)org.imixs.workflow.ItemCollectionfindSEPAExport(String key) Helper method verifies all open SEPA exports and returns the latest for the given key name.org.imixs.workflow.ItemCollectionfindSEPAExportByTask(String key, int taskID) Helper method verifies all open SEPA exports and returns the latest for the given key name.org.imixs.workflow.ItemCollectionharmonizeSEPAItem(org.imixs.workflow.ItemCollection invoice, String itemName) Remove characters like '&', '<' and '>' form sepa fieldsorg.imixs.workflow.ItemCollectionHelper method to load the SEPA scheduler configuration entity.org.imixs.workflow.ItemCollectionloadInvoice(String ref) Helper method to find and load a invoice on manager access level.voidlogMessage(String message, org.imixs.workflow.ItemCollection configuration, org.imixs.workflow.ItemCollection workitem) Creates a new log entry stored in the item _scheduler_log.voidprocessInvoices(org.imixs.workflow.ItemCollection sepaExport, List<org.imixs.workflow.ItemCollection> invoices, org.imixs.workflow.ItemCollection event, org.imixs.workflow.ItemCollection configuration) This method expects a list of Subprocess definitions.org.imixs.workflow.ItemCollectionprocessSEPAExport(org.imixs.workflow.ItemCollection datevExport) Helper method to process a SEPA Exprot with on manager access level.voidupdateCdtrDefaultData(org.imixs.workflow.ItemCollection workitem) This method adds the CDTR default information to a workitem if the workitem did not yet provide any creditor data.voidupdateDbtrDefaultData(org.imixs.workflow.ItemCollection workitem) This method adds the DBTR default information to a workitem if the workitem did not yet provide any debitor data.voidvalidateCdtrData(org.imixs.workflow.ItemCollection workitem) This method validates if the current workitem has cdtr data.voidvalidateDbtrData(org.imixs.workflow.ItemCollection workitem) This method validates if the current workitem has cdtr data.
-
Field Details
-
SEPA_CONFIGURATION
- See Also:
-
ERROR_MISSING_DATA
- See Also:
-
EVENT_START
public static final int EVENT_START- See Also:
-
EVENT_SUCCESS
public static final int EVENT_SUCCESS- See Also:
-
EVENT_FAILED
public static final int EVENT_FAILED- See Also:
-
EVENT_ADD_REF
public static final int EVENT_ADD_REF- See Also:
-
EVENT_REMOVE_REF
public static final int EVENT_REMOVE_REF- See Also:
-
INVOICE_UPDATE
- See Also:
-
LINK_PROPERTY
- See Also:
-
ITEM_MODEL_VERSION
- See Also:
-
ITEM_INITIAL_TASK
- See Also:
-
ITEM_PAYMENT_TYPE
- See Also:
-
ITEM_SEPA_REPORT
- See Also:
-
ITEM_DBTR_IBAN
- See Also:
-
ITEM_DBTR_BIC
- See Also:
-
ITEM_DBTR_NAME
- See Also:
-
ITEM_CDTR_IBAN
- See Also:
-
ITEM_CDTR_BIC
- See Also:
-
ITEM_CDTR_NAME
- See Also:
-
ITEM_DBTR_CONFIG
- See Also:
-
ITEM_CDTR_CONFIG
- See Also:
-
REPORT_ERROR
- See Also:
-
-
Constructor Details
-
SepaWorkflowService
public SepaWorkflowService()
-
-
Method Details
-
processInvoices
public void processInvoices(org.imixs.workflow.ItemCollection sepaExport, List<org.imixs.workflow.ItemCollection> invoices, org.imixs.workflow.ItemCollection event, org.imixs.workflow.ItemCollection configuration) throws org.imixs.workflow.exceptions.AccessDeniedException, org.imixs.workflow.exceptions.ProcessingErrorException, org.imixs.workflow.exceptions.PluginException, org.imixs.workflow.exceptions.ModelException This method expects a list of Subprocess definitions. The method updates and processes each existing invoice.The definition is expected in the following format (were regular expressions are allowed)
<sepa name="invoice_update"> <modelversion>1.0.0</modelversion> <task>100</task> <event>20</event> </sepa>- Parameters:
sepaExport- - sepa export workiteminvoices- - list of invoicesevent- - current sepa export event containing the invoice_update definition.- Throws:
org.imixs.workflow.exceptions.AccessDeniedExceptionorg.imixs.workflow.exceptions.ProcessingErrorExceptionorg.imixs.workflow.exceptions.PluginExceptionorg.imixs.workflow.exceptions.ModelException- See Also:
-
org.imixs.workflow.engine.plugins.SplitAndJoinPlugin.java
-
logMessage
public void logMessage(String message, org.imixs.workflow.ItemCollection configuration, org.imixs.workflow.ItemCollection workitem) Creates a new log entry stored in the item _scheduler_log. The log can be writen optional to the configuraiton and the workitem- Parameters:
message-configuration-
-
findBankDataByPaymentType
public org.imixs.workflow.ItemCollection findBankDataByPaymentType(String paymentType, org.imixs.workflow.ItemCollection configuration, String configType) This method returns a ItemColleciton containing the bank data (Name/IBAN/BIC) for a given configuration type (dbtr|cdtr)- Parameters:
paymentType- - name of the paymentconfiguration- - the sepa configuration documentconfigType- - the config type (ITEM_DBTR_CONFIG | ITEM_CDTR_CONFIG)- Returns:
-
computeKey
public String computeKey(org.imixs.workflow.ItemCollection invoice, org.imixs.workflow.ItemCollection event) throws org.imixs.workflow.exceptions.PluginException Helper Method to compute the grouping key from a workitem. The default key is the item "dbtr.iban". Optional the key can be overwritten by the model with a itemvalue expression provided in the event.Example:
<sepa-export name="key"> <itemvalue>dbtr.iban</itemvalue>-<itemvalue>currency</itemvalue> </sepa-export>The method throws a PluginException if the given invoice did not provide a dbtr.iban item.
- Returns:
- Throws:
org.imixs.workflow.exceptions.PluginException
-
createNewSEPAExport
public org.imixs.workflow.ItemCollection createNewSEPAExport(String key, org.imixs.workflow.ItemCollection workitem, org.imixs.workflow.ItemCollection event) throws org.imixs.workflow.exceptions.ModelException, org.imixs.workflow.exceptions.PluginException Helper method to create a new SEPA Export workitem- Parameters:
key-workitem-- Returns:
- Throws:
org.imixs.workflow.exceptions.ModelExceptionorg.imixs.workflow.exceptions.PluginException
-
processSEPAExport
public org.imixs.workflow.ItemCollection processSEPAExport(org.imixs.workflow.ItemCollection datevExport) throws org.imixs.workflow.exceptions.AccessDeniedException, org.imixs.workflow.exceptions.ProcessingErrorException, org.imixs.workflow.exceptions.PluginException, org.imixs.workflow.exceptions.ModelException Helper method to process a SEPA Exprot with on manager access level.- Parameters:
datevExport-- Returns:
- Throws:
org.imixs.workflow.exceptions.ModelExceptionorg.imixs.workflow.exceptions.PluginExceptionorg.imixs.workflow.exceptions.ProcessingErrorExceptionorg.imixs.workflow.exceptions.AccessDeniedException
-
findSEPAExportByTask
public org.imixs.workflow.ItemCollection findSEPAExportByTask(String key, int taskID) throws org.imixs.workflow.exceptions.QueryException Helper method verifies all open SEPA exports and returns the latest for the given key name. If no open SEPA export exists the method returns null.- Parameters:
key-taskID- - optional can be used to restrict the lookup for a specific task- Returns:
- Throws:
org.imixs.workflow.exceptions.QueryException
-
updateDbtrDefaultData
public void updateDbtrDefaultData(org.imixs.workflow.ItemCollection workitem) throws org.imixs.workflow.exceptions.PluginException This method adds the DBTR default information to a workitem if the workitem did not yet provide any debitor data. The data it read form the configuration dbtr list and the payment.type stored in the workitem.As payment can be distinguished between in and out. The method first test if the workitem contains a item
payment.out.type. If not the itempayment.typeis taken. In this way a workitem can provide different payment types for outgoing payments and incoming payments (direct debit).The method throws a PluginException in case not dbtr data is available
- Parameters:
workitem-- Throws:
org.imixs.workflow.exceptions.PluginException- - if dbtr data is missing
-
validateCdtrData
public void validateCdtrData(org.imixs.workflow.ItemCollection workitem) throws org.imixs.workflow.exceptions.PluginException This method validates if the current workitem has cdtr data. If not a exception is thrown.- Parameters:
workitem-- Throws:
org.imixs.workflow.exceptions.PluginException
-
updateCdtrDefaultData
public void updateCdtrDefaultData(org.imixs.workflow.ItemCollection workitem) throws org.imixs.workflow.exceptions.PluginException This method adds the CDTR default information to a workitem if the workitem did not yet provide any creditor data. The data it read form the configuration cdtr list and the payment.type stored in the workitem.As payment can be distinguished between in and out. The method first test if the worktiem contains a item
payment.in.type. If not the itempayment.typeis taken. In this way a workitem can provide different payment types for outgoing payments and incoming payments (direct debit).- Parameters:
workitem-- Throws:
org.imixs.workflow.exceptions.PluginException- - if cdtr data is missing
-
validateDbtrData
public void validateDbtrData(org.imixs.workflow.ItemCollection workitem) throws org.imixs.workflow.exceptions.PluginException This method validates if the current workitem has cdtr data. If not a exception is thrown.- Parameters:
workitem-- Throws:
org.imixs.workflow.exceptions.PluginException
-
findSEPAExport
public org.imixs.workflow.ItemCollection findSEPAExport(String key) throws org.imixs.workflow.exceptions.QueryException Helper method verifies all open SEPA exports and returns the latest for the given key name. If no open SEPA export exists the method returns null.This method does not restrict the lookup for a specific taskID. This is used for removal
- Parameters:
key-taskID- - optional can be used to restrict the lookup for a specific task- Returns:
- Throws:
org.imixs.workflow.exceptions.QueryException
-
harmonizeSEPAItem
public org.imixs.workflow.ItemCollection harmonizeSEPAItem(org.imixs.workflow.ItemCollection invoice, String itemName) Remove characters like '&', '<' and '>' form sepa fields- Parameters:
invoice-- Returns:
-
loadConfiguration
public org.imixs.workflow.ItemCollection loadConfiguration()Helper method to load the SEPA scheduler configuration entity. The method returns null if no scheduler configuration exits.- Returns:
-
loadInvoice
Helper method to find and load a invoice on manager access level.- Parameters:
ref-- Returns:
-