You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by il...@apache.org on 2026/10/10 07:19:39 UTC

(syncope) branch 4_0_X updated (1c0156effb -> 66833c5171)

This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a change to branch 4_0_X
in repository https://gitbox.apache.org/repos/asf/syncope.git


    from 1c0156effb Upgrading CXF
     new 336c146fa5 flowable:expression is not needed
     new 66833c5171 Bump org.openapitools:openapi-generator-maven-plugin

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../core/flowable/impl/FlowableDeployUtils.java    | 44 +++++++++++++++++++---
 .../syncope/core/logic/init/FlowableLoader.java    |  4 +-
 pom.xml                                            |  2 +-
 3 files changed, 40 insertions(+), 10 deletions(-)


(syncope) 01/02: flowable:expression is not needed

Posted by il...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch 4_0_X
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit 336c146fa580f3026357a971e5de7eea1daecbba
Author: Francesco Chicchiriccò <il...@apache.org>
AuthorDate: Sat Oct 10 08:10:57 2026 +0200

    flowable:expression is not needed
---
 .../core/flowable/impl/FlowableDeployUtils.java    | 44 +++++++++++++++++++---
 .../syncope/core/logic/init/FlowableLoader.java    |  4 +-
 2 files changed, 39 insertions(+), 9 deletions(-)

diff --git a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableDeployUtils.java b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableDeployUtils.java
index 4c087a6c99..08e6d0303f 100644
--- a/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableDeployUtils.java
+++ b/ext/flowable/flowable-bpmn/src/main/java/org/apache/syncope/core/flowable/impl/FlowableDeployUtils.java
@@ -18,12 +18,16 @@
  */
 package org.apache.syncope.core.flowable.impl;
 
+import static org.flowable.bpmn.constants.BpmnXMLConstants.ATTRIBUTE_TASK_SERVICE_EXPRESSION;
+import static org.flowable.bpmn.constants.BpmnXMLConstants.FLOWABLE_EXTENSIONS_NAMESPACE;
+
 import com.fasterxml.jackson.databind.json.JsonMapper;
 import com.fasterxml.jackson.databind.node.ObjectNode;
 import java.io.ByteArrayInputStream;
+import java.io.IOException;
 import java.io.InputStream;
-import java.io.InputStreamReader;
 import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamConstants;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
 import org.apache.syncope.core.workflow.api.WorkflowException;
@@ -48,12 +52,41 @@ public final class FlowableDeployUtils {
         XML_INPUT_FACTORY.setProperty(XMLInputFactory.SUPPORT_DTD, Boolean.FALSE);
     }
 
+    private static boolean containsExpression(final byte[] xml) throws XMLStreamException, IOException {
+        try (ByteArrayInputStream in = new ByteArrayInputStream(xml)) {
+            XMLStreamReader xtr = XML_INPUT_FACTORY.createXMLStreamReader(in);
+            try {
+                while (xtr.hasNext()) {
+                    if (xtr.next() == XMLStreamConstants.START_ELEMENT) {
+                        for (int i = 0; i < xtr.getAttributeCount(); i++) {
+                            if (FLOWABLE_EXTENSIONS_NAMESPACE.equals(xtr.getAttributeNamespace(i))
+                                    && ATTRIBUTE_TASK_SERVICE_EXPRESSION.equals(xtr.getAttributeLocalName(i))) {
+
+                                return true;
+                            }
+                        }
+                    }
+                }
+                return false;
+            } finally {
+                xtr.close();
+            }
+        }
+    }
+
     public static Deployment deployDefinition(
             final ProcessEngine engine, final String resourceName, final byte[] definition) {
 
         try {
-            return engine.getRepositoryService().createDeployment().
-                    addInputStream(resourceName, new ByteArrayInputStream(definition)).deploy();
+            if (containsExpression(definition)) {
+                throw new WorkflowException("Attribute flowable:expression is not allowed");
+            }
+        } catch (IOException | XMLStreamException e) {
+            throw new WorkflowException("While checking " + resourceName, e);
+        }
+
+        try {
+            return engine.getRepositoryService().createDeployment().addBytes(resourceName, definition).deploy();
         } catch (FlowableException e) {
             throw new WorkflowException("While importing " + resourceName, e);
         }
@@ -62,10 +95,9 @@ public final class FlowableDeployUtils {
     public static void deployModel(final ProcessEngine engine, final ProcessDefinition procDef) {
         XMLStreamReader xtr = null;
         try (InputStream bpmnStream = engine.getRepositoryService().
-                getResourceAsStream(procDef.getDeploymentId(), procDef.getResourceName());
-             InputStreamReader isr = new InputStreamReader(bpmnStream)) {
+                getResourceAsStream(procDef.getDeploymentId(), procDef.getResourceName())) {
 
-            xtr = XML_INPUT_FACTORY.createXMLStreamReader(isr);
+            xtr = XML_INPUT_FACTORY.createXMLStreamReader(bpmnStream);
             BpmnModel bpmnModel = new BpmnXMLConverter().convertToBpmnModel(xtr);
 
             Model model = engine.getRepositoryService().newModel();
diff --git a/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/init/FlowableLoader.java b/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/init/FlowableLoader.java
index 83376a3a1c..8d18986a52 100644
--- a/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/init/FlowableLoader.java
+++ b/ext/flowable/logic/src/main/java/org/apache/syncope/core/logic/init/FlowableLoader.java
@@ -18,7 +18,6 @@
  */
 package org.apache.syncope.core.logic.init;
 
-import java.io.ByteArrayInputStream;
 import java.io.IOException;
 import java.io.InputStream;
 import java.util.List;
@@ -79,8 +78,7 @@ public class FlowableLoader implements SyncopeCoreLoader {
 
             // Only loads process definition from file if not found in repository
             if (processes.isEmpty()) {
-                processEngine.getRepositoryService().createDeployment().addInputStream(
-                        userWorkflowDef.getFilename(), new ByteArrayInputStream(wfDef)).deploy();
+                FlowableDeployUtils.deployDefinition(processEngine, userWorkflowDef.getFilename(), wfDef);
 
                 ProcessDefinition procDef = processEngine.getRepositoryService().createProcessDefinitionQuery().
                         processDefinitionKey(FlowableRuntimeUtils.WF_PROCESS_ID).latestVersion().


(syncope) 02/02: Bump org.openapitools:openapi-generator-maven-plugin

Posted by il...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

ilgrosso pushed a commit to branch 4_0_X
in repository https://gitbox.apache.org/repos/asf/syncope.git

commit 66833c5171f74b99aa2d884935e0dd4aa586c58f
Author: dependabot[bot] <49...@users.noreply.github.com>
AuthorDate: Fri Oct 9 23:08:16 2026 +0000

    Bump org.openapitools:openapi-generator-maven-plugin
    
    Bumps org.openapitools:openapi-generator-maven-plugin from 7.25.0 to 7.26.0.
    
    ---
    updated-dependencies:
    - dependency-name: org.openapitools:openapi-generator-maven-plugin
      dependency-version: 7.26.0
      dependency-type: direct:production
      update-type: version-update:semver-minor
    ...
    
    Signed-off-by: dependabot[bot] <su...@github.com>
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index 9f841edf59..d80ed5d025 100644
--- a/pom.xml
+++ b/pom.xml
@@ -1745,7 +1745,7 @@ under the License.
         <plugin>
           <groupId>org.openapitools</groupId>
           <artifactId>openapi-generator-maven-plugin</artifactId>
-          <version>7.25.0</version>
+          <version>7.26.0</version>
         </plugin>
 
         <plugin>