Skip to content

Commit

Permalink
moving transformations
Browse files Browse the repository at this point in the history
  • Loading branch information
elguardian committed Jun 6, 2024
1 parent e3c25f0 commit 3dc0844
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import org.jbpm.bpmn2.core.Lane;
import org.jbpm.bpmn2.core.SequenceFlow;
import org.jbpm.bpmn2.core.Signal;
import org.jbpm.compiler.canonical.builtin.ReturnValueEvaluatorBuilderService;
import org.jbpm.compiler.xml.Handler;
import org.jbpm.compiler.xml.Parser;
import org.jbpm.compiler.xml.ProcessBuildData;
Expand All @@ -49,6 +50,8 @@
import org.jbpm.process.core.context.variable.Variable;
import org.jbpm.process.core.context.variable.VariableScope;
import org.jbpm.process.core.datatype.DataTypeResolver;
import org.jbpm.process.instance.impl.MVELInterpretedReturnValueEvaluator;
import org.jbpm.process.instance.impl.ReturnValueEvaluator;
import org.jbpm.ruleflow.core.RuleFlowProcess;
import org.jbpm.ruleflow.core.WorkflowElementIdentifierFactory;
import org.jbpm.util.PatternConstants;
Expand Down Expand Up @@ -572,7 +575,11 @@ private Transformation readTransformation(Element parent) {
String lang = element.get().getAttribute("language");
String expression = element.get().getTextContent();

return new Transformation(lang, expression);
ReturnValueEvaluator evaluator = null;
if (lang.toLowerCase().contains("mvel")) {
evaluator = new MVELInterpretedReturnValueEvaluator(expression);
}
return new Transformation(lang, expression, evaluator);
}

protected List<DataDefinition> readSources(org.w3c.dom.Node parent, Function<String, DataDefinition> variableResolver) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public XPATHReturnValueEvaluator() {
super("XPath", "true()");
}

public XPATHReturnValueEvaluator(final String expression) {
public XPATHReturnValueEvaluator(String expression) {
super("XPath", expression);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
</operation>
</interface>

<process processType="Private" isExecutable="true" id="ServiceProcess" name="Service Process" >
<process processType="Private" isExecutable="true" id="ServiceProcessWithMvelCollectionTransformation" name="Service Process" tns:packageName="org.jbpm.bpmn2.service" >
<extensionElements>
<tns:import name="java.util.Arrays"/>
</extensionElements>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</operation>
</interface>

<process processType="Private" isExecutable="true" id="ServiceProcessWithMvelJaxbTransformation" name="Service Process" >
<process processType="Private" isExecutable="true" id="ServiceProcessWithMvelJaxbTransformation" name="Service Process" tns:packageName="org.jbpm.bpmn2.service" >
<extensionElements>
<tns:import name="jakarta.xml.bind.JAXBContext"/>
<tns:import name="java.io.StringReader"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
</operation>
</interface>

<process processType="Private" isExecutable="true" id="ServiceProcessWithMvelTransformation" name="Service Process" >
<process processType="Private" isExecutable="true" id="ServiceProcessWithMvelTransformation" name="Service Process" tns:packageName="org.jbpm.bpmn2.service">

<!-- process variables -->
<property id="s" itemSubjectRef="_sItem"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

<itemDefinition id="_xItem" structureRef="String" />

<process processType="Private" isExecutable="true" id="Minimal" name="Minimal Process" tns:packageName="com.sample" >
<process processType="Private" isExecutable="true" id="SignalStartWithTransformation" name="Minimal Process" tns:packageName="org.jbpm.bpmn2.start" >

<!-- process variables -->
<property id="x" itemSubjectRef="_xItem"/>
Expand Down

0 comments on commit 3dc0844

Please sign in to comment.