fixed customSerachController and DatevCargosoftImportAdapter

This commit is contained in:
Ralph Soika 2024-04-12 12:52:13 +02:00
parent 00566bbe62
commit f76c21d1d5
3 changed files with 23 additions and 26 deletions

View file

@ -4,6 +4,7 @@
### 1.2.18 (Development) ### 1.2.18 (Development)
- Fix in Archiv Suche CustomSearchController.java - requestscoped
### 1.2.17 ### 1.2.17

View file

@ -32,7 +32,7 @@ import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.logging.Logger; import java.util.logging.Logger;
import javax.enterprise.context.SessionScoped; import javax.enterprise.context.RequestScoped;
import javax.enterprise.event.Observes; import javax.enterprise.event.Observes;
import javax.inject.Inject; import javax.inject.Inject;
import javax.inject.Named; import javax.inject.Named;
@ -51,7 +51,8 @@ import org.imixs.workflow.office.views.SearchEvent;
*/ */
@Named @Named
@SessionScoped // @SessionScoped
@RequestScoped
public class CustomSearchController implements Serializable { public class CustomSearchController implements Serializable {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

View file

@ -31,7 +31,6 @@ import org.imixs.workflow.exceptions.PluginException;
import org.imixs.workflow.exceptions.ProcessingErrorException; import org.imixs.workflow.exceptions.ProcessingErrorException;
import org.imixs.workflow.exceptions.QueryException; import org.imixs.workflow.exceptions.QueryException;
import com.alexanderlogistics.CargosoftSplitAdapter;
import com.alexanderlogistics.InvoiceUtil; import com.alexanderlogistics.InvoiceUtil;
import com.alexanderlogistics.KreditorDebitorService; import com.alexanderlogistics.KreditorDebitorService;
@ -140,39 +139,35 @@ public class DatevCargosoftImportAdapter implements SignalAdapter {
throws AdapterException, PluginException { throws AdapterException, PluginException {
logger.info("...parse datev file import..."); logger.info("...parse datev file import...");
// Set default values
INITIAL_MODEL_VERSION = "rechnungsausgang-de-1.0";
INITIAL_TASK_ID = 5001;
INITIAL_EVENT_ID = 980;
// read the cargosoft import options // Try to read the optional cargosoft import options...
// ("rechnungsausgang-de-1.0").task(5001).event(980);
ItemCollection evalItemCollection = workflowService.evalWorkflowResult(event, "datev-cargosoft-import", ItemCollection evalItemCollection = workflowService.evalWorkflowResult(event, "datev-cargosoft-import",
workitem, workitem, false);
false); if (evalItemCollection != null) {
if (evalItemCollection == null) {
throw new PluginException(CargosoftSplitAdapter.class.getSimpleName(), CONFIG_ERROR,
"missing datev-cargosoft-import configuration in model event - please check model configuration");
}
INITIAL_MODEL_VERSION = evalItemCollection.getItemValueString("model"); INITIAL_MODEL_VERSION = evalItemCollection.getItemValueString("model");
if (INITIAL_MODEL_VERSION.isEmpty()) { if (INITIAL_MODEL_VERSION.isEmpty()) {
INITIAL_MODEL_VERSION = "rechnungsausgang-de-1.0"; INITIAL_MODEL_VERSION = "rechnungsausgang-de-1.0"; // set default
} }
INITIAL_TASK_ID = evalItemCollection.getItemValueInteger("task"); INITIAL_TASK_ID = evalItemCollection.getItemValueInteger("task");
if (INITIAL_TASK_ID == 0) { if (INITIAL_TASK_ID == 0) {
INITIAL_TASK_ID = 5001; INITIAL_TASK_ID = 5001; // set default
} }
INITIAL_EVENT_ID = evalItemCollection.getItemValueInteger("event"); INITIAL_EVENT_ID = evalItemCollection.getItemValueInteger("event");
if (INITIAL_EVENT_ID == 0) { if (INITIAL_EVENT_ID == 0) {
INITIAL_EVENT_ID = 980; INITIAL_EVENT_ID = 980; // set default
}
} }
try { try {
// Datei einlesen // Datei einlesen
List<String> log = readData(workitem); List<String> log = readData(workitem);
workitem.setItemValue("import.log", log); workitem.setItemValue("import.log", log);
} catch (ModelException e) { } catch (ModelException e) {
throw new AdapterException(PluginException.class.getSimpleName(), DatevImportAdapter.DATEV_IMPORT_ERROR, throw new AdapterException(PluginException.class.getSimpleName(), DatevImportAdapter.DATEV_IMPORT_ERROR,
"Failed to import datev data!", e); "Failed to import datev data!", e);
} }
return workitem; return workitem;
} }