Skip to content

Commit

Permalink
upgrade imixs-workflow 6.1.0 - code formatting (#167)
Browse files Browse the repository at this point in the history
rsoika committed Dec 16, 2024
1 parent f6765be commit 36a7d05
Showing 15 changed files with 104 additions and 83 deletions.
6 changes: 4 additions & 2 deletions imixs-adapters-datev/pom.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.imixs.workflow</groupId>
<artifactId>imixs-adapters</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>
</parent>
<artifactId>imixs-adapters-datev</artifactId>
<name>Imixs DATEV Adapter</name>
6 changes: 4 additions & 2 deletions imixs-adapters-e-invoice/pom.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.imixs.workflow</groupId>
<artifactId>imixs-adapters</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>
</parent>
<artifactId>imixs-adapters-e-invoice</artifactId>
<name>Imixs eInvoice Adapter</name>
6 changes: 4 additions & 2 deletions imixs-adapters-kafka/pom.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.imixs.workflow</groupId>
<artifactId>imixs-adapters</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>
</parent>
<artifactId>imixs-adapters-kafka</artifactId>
<name>Imixs-Workflow Kafka Adapter</name>
Original file line number Diff line number Diff line change
@@ -7,13 +7,6 @@
import java.util.logging.Logger;
import java.util.regex.Pattern;

import jakarta.annotation.PostConstruct;
import jakarta.ejb.ConcurrencyManagement;
import jakarta.ejb.ConcurrencyManagementType;
import jakarta.ejb.Singleton;
import javax.enterprise.event.Observes;
import jakarta.xml.bind.JAXBException;

import org.apache.kafka.clients.producer.KafkaProducer;
import org.apache.kafka.clients.producer.Producer;
import org.apache.kafka.clients.producer.ProducerConfig;
@@ -27,6 +20,13 @@
import org.imixs.workflow.exceptions.ProcessingErrorException;
import org.imixs.workflow.xml.XMLDocumentAdapter;

import jakarta.annotation.PostConstruct;
import jakarta.ejb.ConcurrencyManagement;
import jakarta.ejb.ConcurrencyManagementType;
import jakarta.ejb.Singleton;
import jakarta.enterprise.event.Observes;
import jakarta.xml.bind.JAXBException;

/**
* The ProducerService is a Kafka client that publishes workflow events to the
* Kafka cluster.
@@ -121,10 +121,10 @@ public void onProcess(@Observes ProcessingEvent documentEvent) {

logger.info("...consuming ProcssingEvent (model:" + modelPattern + ") -> send new kafka event...");
try {
sendWorkitem(documentEvent.getDocument());
sendWorkitem(documentEvent.getDocument());
} catch (AdapterException e) {
// convert Adapter Exception into runtime Exception!
throw new ProcessingErrorException(e.getErrorContext() , e.getErrorCode(), e.getMessage(),e);
throw new ProcessingErrorException(e.getErrorContext(), e.getErrorCode(), e.getMessage(), e);
}
}

@@ -138,7 +138,7 @@ public void onProcess(@Observes ProcessingEvent documentEvent) {
* The value is a serialized version of the workitem.
*
* @param workitem
* @throws AdapterException
* @throws AdapterException
*/
public void sendWorkitem(ItemCollection workitem) throws AdapterException {
String uid = workitem.getUniqueID();
6 changes: 4 additions & 2 deletions imixs-adapters-ldap/pom.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.imixs.workflow</groupId>
<artifactId>imixs-adapters</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>
</parent>
<artifactId>imixs-adapters-ldap</artifactId>

6 changes: 4 additions & 2 deletions imixs-adapters-odf/pom.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.imixs.workflow</groupId>
<artifactId>imixs-adapters</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>
</parent>
<artifactId>imixs-adapters-odf</artifactId>
<name>Imixs ODF Adapter</name>
6 changes: 4 additions & 2 deletions imixs-adapters-poi/pom.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.imixs.workflow</groupId>
<artifactId>imixs-adapters</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>
</parent>
<artifactId>imixs-adapters-poi</artifactId>
<name>Imixs POI Adapter</name>
6 changes: 4 additions & 2 deletions imixs-adapters-qrcode/pom.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.imixs.workflow</groupId>
<artifactId>imixs-adapters</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>
</parent>
<artifactId>imixs-adapters-qrcode</artifactId>

9 changes: 5 additions & 4 deletions imixs-adapters-sepa/pom.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.imixs.workflow</groupId>
<artifactId>imixs-adapters</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>
</parent>
<artifactId>imixs-adapters-sepa</artifactId>
<name>Imixs SEPA Adapter</name>
@@ -19,7 +21,7 @@
<groupId>org.imixs.workflow</groupId>
<artifactId>imixs-workflow-engine</artifactId>
</dependency>

<dependency>
<groupId>org.imixs.workflow</groupId>
<artifactId>imixs-workflow-faces</artifactId>
@@ -30,7 +32,6 @@
<artifactId>imixs-marty</artifactId>
</dependency>



<!-- tiny java lib for iban/bic validation -->
<dependency>
Original file line number Diff line number Diff line change
@@ -37,7 +37,6 @@
import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.imixs.workflow.FileData;
import org.imixs.workflow.ItemCollection;
import org.imixs.workflow.Model;
import org.imixs.workflow.WorkflowKernel;
import org.imixs.workflow.engine.DocumentService;
import org.imixs.workflow.engine.ModelService;
@@ -51,6 +50,7 @@
import org.imixs.workflow.exceptions.PluginException;
import org.imixs.workflow.exceptions.ProcessingErrorException;
import org.imixs.workflow.exceptions.QueryException;
import org.openbpmn.bpmn.BPMNModel;

import jakarta.ejb.EJB;
import jakarta.inject.Inject;
@@ -107,10 +107,13 @@ public ItemCollection run(ItemCollection configuration) throws SchedulerExceptio
int taskID = configuration.getItemValueInteger(SepaWorkflowService.ITEM_INITIAL_TASK);
try {
// fetch the initial event
Model model = modelService.getModel(modelVersion);
ItemCollection event = model.getEvent(taskID, SepaWorkflowService.EVENT_START);
ItemCollection task = model.getTask(taskID);

BPMNModel model = modelService.getModelManager().getModel(modelVersion);
// ItemCollection event = model.getEvent(taskID,
// SepaWorkflowService.EVENT_START);
ItemCollection event = modelService.getModelManager().findEventByID(model, taskID, taskID);
// ItemCollection task = model.getTask(taskID);
ItemCollection task = modelService.getModelManager().findTaskByID(model, taskID);

// load the report
ItemCollection report = reportService.findReport(event.getItemValueString("txtReportName"));
if (report == null) {
@@ -274,7 +277,7 @@ public ItemCollection run(ItemCollection configuration) throws SchedulerExceptio
sepaWorkflowService.logMessage("Failed: " + e.getMessage(), configuration, sepaExport);
sepaExport.event(SepaWorkflowService.EVENT_FAILED);
workflowService.processWorkItem(sepaExport);

} catch (AccessDeniedException | ProcessingErrorException | PluginException | ModelException e1) {
throw new SchedulerException(SepaWorkflowService.REPORT_ERROR,
"Failed to execute sepa report '" + reportName + "' : " + e.getMessage(), e);
@@ -284,7 +287,7 @@ public ItemCollection run(ItemCollection configuration) throws SchedulerExceptio
// in all other cases we stop the processing
try {
if (sepaExport == null) {
// build the sepa export workitem....
// build the sepa export workitem....
sepaExport = new ItemCollection().model(modelVersion).task(taskID);
sepaExport.replaceItemValue(WorkflowKernel.CREATED, new Date());
sepaExport.replaceItemValue(WorkflowKernel.MODIFIED, new Date());
@@ -293,7 +296,7 @@ public ItemCollection run(ItemCollection configuration) throws SchedulerExceptio
sepaWorkflowService.logMessage("Failed: " + e.getMessage(), configuration, sepaExport);
sepaExport.event(SepaWorkflowService.EVENT_FAILED);
workflowService.processWorkItem(sepaExport);

} catch (AccessDeniedException | ProcessingErrorException | PluginException | ModelException e1) {
throw new SchedulerException(SepaWorkflowService.REPORT_ERROR,
"Failed to execute sepa report '" + reportName + "' : " + e.getMessage(), e);
Original file line number Diff line number Diff line change
@@ -36,7 +36,6 @@
import java.util.regex.Pattern;

import org.imixs.workflow.ItemCollection;
import org.imixs.workflow.Model;
import org.imixs.workflow.WorkflowKernel;
import org.imixs.workflow.engine.DocumentService;
import org.imixs.workflow.engine.ModelService;
@@ -48,6 +47,7 @@
import org.imixs.workflow.exceptions.ProcessingErrorException;
import org.imixs.workflow.exceptions.QueryException;
import org.imixs.workflow.util.XMLParser;
import org.openbpmn.bpmn.BPMNModel;

import jakarta.annotation.security.DeclareRoles;
import jakarta.annotation.security.RunAs;
@@ -80,7 +80,7 @@ public class SepaWorkflowService {
public static final int EVENT_REMOVE_REF = 200;

public static final String INVOICE_UPDATE = "invoice_update";
public static final String LINK_PROPERTY = "$workitemref";
public static final String LINK_PROPERTY = "";

public static final String ITEM_MODEL_VERSION = "_model_version";
public static final String ITEM_INITIAL_TASK = "_initial_task";
@@ -386,8 +386,10 @@ public ItemCollection createNewSEPAExport(String key, ItemCollection workitem, I
}

// set workflow group name from the Task Element to identify document in xslt
Model model = modelService.getModel(modelVersion);
ItemCollection task = model.getTask(taskID);
BPMNModel model = modelService.getModelManager().getModel(modelVersion);
ItemCollection task = modelService.getModelManager().findTaskByID(model, taskID);

// model.openDefaultProces().fin(type);.getTask(taskID);
String modelTaskGroupName = task.getItemValueString("txtworkflowgroup"); // DO NOT CHANGE!
sepaExport.setItemValue(WorkflowKernel.WORKFLOWGROUP, modelTaskGroupName);

6 changes: 4 additions & 2 deletions imixs-adapters-wopi/pom.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.imixs.workflow</groupId>
<artifactId>imixs-adapters</artifactId>
<version>3.0.4-SNAPSHOT</version>
<version>3.1.0-SNAPSHOT</version>
</parent>
<artifactId>imixs-adapters-wopi</artifactId>

Original file line number Diff line number Diff line change
@@ -29,19 +29,19 @@

import java.util.logging.Logger;

import jakarta.annotation.PostConstruct;
import jakarta.enterprise.context.ConversationScoped;
import jakarta.enterprise.event.Observes;
import jakarta.inject.Inject;
import jakarta.inject.Named;

import org.eclipse.microprofile.config.inject.ConfigProperty;
import org.imixs.jwt.JWTException;
import org.imixs.workflow.FileData;
import org.imixs.workflow.faces.data.WorkflowEvent;
import org.imixs.workflow.faces.fileupload.FileUploadController;
import org.imixs.workflow.faces.util.ResourceBundleHandler;

import jakarta.annotation.PostConstruct;
import jakarta.enterprise.context.ConversationScoped;
import jakarta.enterprise.event.Observes;
import jakarta.inject.Inject;
import jakarta.inject.Named;

/**
* The WopiController is a front end controller providing the access endpoint
* for a file.
@@ -80,7 +80,7 @@ public class WopiController implements Serializable {
@Inject
@ConfigProperty(name = "wopi.options", defaultValue = "none")
String wopiOptions;

@Inject
WopiAccessHandler wopiAccessHandler;

@@ -165,18 +165,17 @@ public String getWopiAccessURL(String uniqueid, String file, String userid, Stri
logger.warning("...no wopi client endpoint found!");
return null;
}

// cut onlyoffice hints
if (baseURL.indexOf("&<rs=")>-1) {
baseURL=baseURL.substring(0,baseURL.indexOf("&<rs="));
if (baseURL.indexOf("&<rs=") > -1) {
baseURL = baseURL.substring(0, baseURL.indexOf("&<rs="));
}

// add optional WOPI Params (e.g. thm=2
if (wopiOptions != null && !"none".equals(wopiOptions)) {
baseURL=baseURL+"&"+wopiOptions;
baseURL = baseURL + "&" + wopiOptions;
}


// test file extension
String[] extensions = wopiFileExtensions.split(",");
boolean supported = false;
@@ -201,7 +200,7 @@ public String getWopiAccessURL(String uniqueid, String file, String userid, Stri

String token = generateAccessToken(userid, username);
baseURL = baseURL + "WOPISrc=" + wopiHostEndpoint + uniqueid + "/files/" + file + "&access_token=" + token;

logger.fine("WOP Access URL=" + baseURL);
return baseURL;
}
Loading

0 comments on commit 36a7d05

Please sign in to comment.