Skip to content

Commit

Permalink
Merge branch 'main' of github.com:flowable/flowable-engine into flowa…
Browse files Browse the repository at this point in the history
…ble-release-7.2.0
  • Loading branch information
tijsrademakers committed Oct 4, 2024
2 parents 642f3f2 + 0c95ab1 commit 3e402c1
Show file tree
Hide file tree
Showing 214 changed files with 3,747 additions and 366 deletions.
9 changes: 2 additions & 7 deletions .github/workflows/sql-server.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@ jobs:
strategy:
fail-fast: false
matrix:
mssql: [2017-latest-ubuntu, 2019-latest]
include:
- mssql: 2017-latest-ubuntu
healthRunnable: /opt/mssql-tools/bin/sqlcmd
- mssql: 2019-latest
healthRunnable: /opt/mssql-tools18/bin/sqlcmd -C
mssql: [2019-latest, 2022-latest]
services:
mssql:
image: mcr.microsoft.com/mssql/server:${{ matrix.mssql }}
Expand All @@ -35,7 +30,7 @@ jobs:
- 1433/tcp
# needed because the mssql container does not provide a health check
options: >-
--health-cmd="${{ matrix.healthRunnable }} -S localhost -U sa -P flowableStr0ngPassword -l 30 -Q \"SELECT 1\" || exit 1"
--health-cmd="/opt/mssql-tools18/bin/sqlcmd -C -S localhost -U sa -P flowableStr0ngPassword -l 30 -Q \"SELECT 1\" || exit 1"
--health-start-period 10s
--health-interval 10s
--health-timeout 5s
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ CREATE INDEX ACT_IDX_APP_DEF_DPLY ON ACT_APP_APPDEF(DEPLOYMENT_ID_);
CREATE UNIQUE INDEX ACT_IDX_APP_DEF_UNIQ ON ACT_APP_APPDEF(KEY_, VERSION_, TENANT_ID_);

insert into ACT_GE_PROPERTY
values ('app.schema.version', '7.1.0.1', 1);
values ('app.schema.version', '7.1.0.2', 1);
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ CREATE INDEX ACT_IDX_APP_DEF_DPLY ON ACT_APP_APPDEF(DEPLOYMENT_ID_);
CREATE UNIQUE INDEX ACT_IDX_APP_DEF_UNIQ ON ACT_APP_APPDEF(KEY_, VERSION_, TENANT_ID_);

insert into ACT_GE_PROPERTY
values ('app.schema.version', '7.1.0.1', 1);
values ('app.schema.version', '7.1.0.2', 1);
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ CREATE NONCLUSTERED INDEX ACT_IDX_APP_DEF_DPLY ON ACT_APP_APPDEF(DEPLOYMENT_ID_)
CREATE UNIQUE NONCLUSTERED INDEX ACT_IDX_APP_DEF_UNIQ ON ACT_APP_APPDEF(KEY_, VERSION_, TENANT_ID_);

insert into ACT_GE_PROPERTY
values ('app.schema.version', '7.1.0.1', 1);
values ('app.schema.version', '7.1.0.2', 1);
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ ALTER TABLE ACT_APP_DEPLOYMENT MODIFY DEPLOY_TIME_ datetime(3);
CREATE UNIQUE INDEX ACT_IDX_APP_DEF_UNIQ ON ACT_APP_APPDEF(KEY_, VERSION_, TENANT_ID_);

insert into ACT_GE_PROPERTY
values ('app.schema.version', '7.1.0.1', 1);
values ('app.schema.version', '7.1.0.2', 1);
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ CREATE INDEX ACT_IDX_APP_DEF_DPLY ON ACT_APP_APPDEF(DEPLOYMENT_ID_);
CREATE UNIQUE INDEX ACT_IDX_APP_DEF_UNIQ ON ACT_APP_APPDEF(KEY_, VERSION_, TENANT_ID_);

insert into ACT_GE_PROPERTY
values ('app.schema.version', '7.1.0.1', 1);
values ('app.schema.version', '7.1.0.2', 1);
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ CREATE INDEX ACT_IDX_APP_DEF_DPLY ON ACT_APP_APPDEF(DEPLOYMENT_ID_);
CREATE UNIQUE INDEX ACT_IDX_APP_DEF_UNIQ ON ACT_APP_APPDEF(KEY_, VERSION_, TENANT_ID_);

insert into ACT_GE_PROPERTY
values ('app.schema.version', '7.1.0.1', 1);
values ('app.schema.version', '7.1.0.2', 1);
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
update ACT_GE_PROPERTY set VALUE_ = '7.1.0.2' where NAME_ = 'app.schema.version';
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,9 @@ public interface BpmnXMLConstants {
public static final String ATTRIBUTE_TASK_SERVICE_STORE_RESULT_AS_TRANSIENT = "storeResultVariableAsTransient";

public static final String ATTRIBUTE_TASK_EXTERNAL_WORKER_TOPIC = "topic";
public static final String ATTRIBUTE_TASK_EXTERNAL_WORKER_DO_NOT_INCLUDE_VARIABLES = "doNotIncludeVariables";
public static final String ELEMENT_EXTERNAL_WORKER_IN_PARAMETER = "externalWorkerInParameter";
public static final String ELEMENT_EXTERNAL_WORKER_OUT_PARAMETER = "externalWorkerOutParameter";

public static final String ATTRIBUTE_TASK_HTTP_PARALLEL_IN_SAME_TRANSACTION = "parallelInSameTransaction";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -597,6 +597,10 @@ protected void writeConditionalDefinition(Event parentEvent, ConditionalEventDef

if (StringUtils.isNotEmpty(conditionalDefinition.getConditionExpression())) {
xtw.writeStartElement(ELEMENT_CONDITION);
if (conditionalDefinition.getConditionLanguage() != null) {
xtw.writeAttribute(XSI_PREFIX, XSI_NAMESPACE, "type", "tFormalExpression");
BpmnXMLUtil.writeDefaultAttribute(BpmnXMLConstants.ATTRIBUTE_SCRIPT_LANGUAGE, conditionalDefinition.getConditionLanguage(), xtw);
}
xtw.writeCharacters(conditionalDefinition.getConditionExpression());
xtw.writeEndElement();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import javax.xml.stream.XMLStreamWriter;

import org.apache.commons.lang3.StringUtils;
import org.flowable.bpmn.constants.BpmnXMLConstants;
import org.flowable.bpmn.converter.util.BpmnXMLUtil;
import org.flowable.bpmn.model.BaseElement;
import org.flowable.bpmn.model.BpmnModel;
Expand Down Expand Up @@ -66,6 +67,9 @@ protected void writeAdditionalChildElements(BaseElement element, BpmnModel model
if (StringUtils.isNotEmpty(sequenceFlow.getConditionExpression())) {
xtw.writeStartElement(ELEMENT_FLOW_CONDITION);
xtw.writeAttribute(XSI_PREFIX, XSI_NAMESPACE, "type", "tFormalExpression");
if (sequenceFlow.getConditionLanguage() != null) {
BpmnXMLUtil.writeDefaultAttribute(BpmnXMLConstants.ATTRIBUTE_SCRIPT_LANGUAGE, sequenceFlow.getConditionLanguage(), xtw);
}
xtw.writeCData(sequenceFlow.getConditionExpression());
xtw.writeEndElement();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
import org.flowable.bpmn.converter.child.BaseChildElementParser;
import org.flowable.bpmn.converter.child.EventInParameterParser;
import org.flowable.bpmn.converter.child.EventOutParameterParser;
import org.flowable.bpmn.converter.child.ExternalWorkerInParameterParser;
import org.flowable.bpmn.converter.child.ExternalWorkerOutParameterParser;
import org.flowable.bpmn.converter.child.InParameterParser;
import org.flowable.bpmn.converter.child.OutParameterParser;
import org.flowable.bpmn.converter.export.FieldExtensionExport;
Expand All @@ -51,7 +53,8 @@ public class ServiceTaskXMLConverter extends BaseBpmnXMLConverter {

protected Map<String, BaseChildElementParser> caseServiceChildParserMap = new HashMap<>();
protected Map<String, BaseChildElementParser> sendEventServiceChildParserMap = new HashMap<>();

protected Map<String, BaseChildElementParser> externalWorkerTaskChildParserMap = new HashMap<>();

protected static final List<ExtensionAttribute> defaultServiceTaskAttributes = Arrays.asList(
new ExtensionAttribute(ATTRIBUTE_TYPE),
new ExtensionAttribute(ATTRIBUTE_TASK_SERVICE_CLASS),
Expand Down Expand Up @@ -89,6 +92,12 @@ public ServiceTaskXMLConverter() {
sendEventServiceChildParserMap.put(eventInParameterParser.getElementName(), eventInParameterParser);
EventOutParameterParser eventOutParameterParser = new EventOutParameterParser();
sendEventServiceChildParserMap.put(eventOutParameterParser.getElementName(), eventOutParameterParser);

// External Worker
ExternalWorkerInParameterParser externalWorkerInParameterParser = new ExternalWorkerInParameterParser();
externalWorkerTaskChildParserMap.put(externalWorkerInParameterParser.getElementName(), externalWorkerInParameterParser);
ExternalWorkerOutParameterParser externalWorkerOutParameterParser = new ExternalWorkerOutParameterParser();
externalWorkerTaskChildParserMap.put(externalWorkerOutParameterParser.getElementName(), externalWorkerOutParameterParser);
}

@Override
Expand Down Expand Up @@ -248,6 +257,10 @@ protected void writeExternalTaskAdditionalAttributes(ExternalWorkerServiceTask e
if (StringUtils.isNotEmpty(externalWorkerTask.getSkipExpression())) {
writeQualifiedAttribute(ATTRIBUTE_TASK_SERVICE_SKIP_EXPRESSION, externalWorkerTask.getSkipExpression(), xtw);
}

if (externalWorkerTask.isDoNotIncludeVariables()) {
writeQualifiedAttribute(ATTRIBUTE_TASK_EXTERNAL_WORKER_DO_NOT_INCLUDE_VARIABLES, String.valueOf(externalWorkerTask.isDoNotIncludeVariables()), xtw);
}
}


Expand Down Expand Up @@ -303,7 +316,8 @@ protected boolean writeExtensionChildElements(BaseElement element, boolean didWr

} else if (element instanceof SendEventServiceTask) {
return writeSendServiceExtensionChildElements(element, didWriteExtensionStartElement, xtw);

} else if (element instanceof ExternalWorkerServiceTask) {
return writeExternalWorkerTaskExtensionChildElements(element, didWriteExtensionStartElement, xtw);
} else {
return writeServiceTaskExtensionChildElements((ServiceTask) element, didWriteExtensionStartElement, xtw);
}
Expand Down Expand Up @@ -360,6 +374,14 @@ protected boolean writeSendServiceExtensionChildElements(BaseElement element, bo
return didWriteExtensionStartElement;
}

protected boolean writeExternalWorkerTaskExtensionChildElements(BaseElement element, boolean didWriteExtensionStartElement, XMLStreamWriter xtw) throws Exception {
ExternalWorkerServiceTask externalWorkerTask = (ExternalWorkerServiceTask) element;
didWriteExtensionStartElement = BpmnXMLUtil.writeIOParameters(ELEMENT_EXTERNAL_WORKER_IN_PARAMETER, externalWorkerTask.getInParameters(), didWriteExtensionStartElement, xtw);
didWriteExtensionStartElement = BpmnXMLUtil.writeIOParameters(ELEMENT_EXTERNAL_WORKER_OUT_PARAMETER, externalWorkerTask.getOutParameters(), didWriteExtensionStartElement, xtw);

return didWriteExtensionStartElement;
}

protected boolean writeCaseServiceTaskExtensionChildElements(BaseElement element, boolean didWriteExtensionStartElement, XMLStreamWriter xtw) throws Exception {
CaseServiceTask caseServiceTask = (CaseServiceTask) element;
didWriteExtensionStartElement = BpmnXMLUtil.writeIOParameters(ELEMENT_IN_PARAMETERS, caseServiceTask.getInParameters(), didWriteExtensionStartElement, xtw);
Expand Down Expand Up @@ -432,8 +454,11 @@ protected void convertSendEventServiceTaskXMLProperties(SendEventServiceTask sen

protected void convertExternalWorkerTaskXMLProperties(ExternalWorkerServiceTask externalWorkerServiceTask, BpmnModel bpmnModel, XMLStreamReader xtr) throws Exception {
externalWorkerServiceTask.setTopic(BpmnXMLUtil.getAttributeValue(ATTRIBUTE_TASK_EXTERNAL_WORKER_TOPIC, xtr));
externalWorkerServiceTask.setDoNotIncludeVariables(
Boolean.parseBoolean(BpmnXMLUtil.getAttributeValue(ATTRIBUTE_TASK_EXTERNAL_WORKER_DO_NOT_INCLUDE_VARIABLES, xtr))
);

parseChildElements(getXMLElementName(), externalWorkerServiceTask, bpmnModel, xtr);
parseChildElements(getXMLElementName(), externalWorkerServiceTask, externalWorkerTaskChildParserMap, bpmnModel, xtr);
}

protected void convertHttpServiceTaskXMLProperties(HttpServiceTask httpServiceTask, BpmnModel bpmnModel, XMLStreamReader xtr) throws Exception {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,11 @@ public String getElementName() {

@Override
public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement, BpmnModel model) throws Exception {
if (!(parentElement instanceof SequenceFlow)) {
if (!(parentElement instanceof SequenceFlow sequenceFlow)) {
return;
}

((SequenceFlow) parentElement).setConditionExpression(xtr.getElementText().trim());
sequenceFlow.setConditionLanguage(xtr.getAttributeValue(null, ATTRIBUTE_SCRIPT_LANGUAGE));
sequenceFlow.setConditionExpression(xtr.getElementText().trim());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ public String getElementName() {

@Override
public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement, BpmnModel model) throws Exception {
if (!(parentElement instanceof ConditionalEventDefinition)) {
if (!(parentElement instanceof ConditionalEventDefinition conditionalEventDefinition)) {
return;
}

((ConditionalEventDefinition) parentElement).setConditionExpression(xtr.getElementText().trim());
conditionalEventDefinition.setConditionLanguage(xtr.getAttributeValue(null, ATTRIBUTE_SCRIPT_LANGUAGE));
conditionalEventDefinition.setConditionExpression(xtr.getElementText().trim());
}

@Override
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.flowable.bpmn.converter.child;

import javax.xml.stream.XMLStreamReader;

import org.flowable.bpmn.converter.util.BpmnXMLUtil;
import org.flowable.bpmn.model.BaseElement;
import org.flowable.bpmn.model.BpmnModel;
import org.flowable.bpmn.model.ExternalWorkerServiceTask;
import org.flowable.bpmn.model.IOParameter;

/**
* @author Valentin Zickner
*/
public class ExternalWorkerInParameterParser extends BaseChildElementParser {

@Override
public String getElementName() {
return ELEMENT_EXTERNAL_WORKER_IN_PARAMETER;
}

@Override
public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement, BpmnModel model) throws Exception {
IOParameter parameter = BpmnXMLUtil.parseInIOParameter(xtr);
if (parameter != null) {
((ExternalWorkerServiceTask) parentElement).getInParameters().add(parameter);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.flowable.bpmn.converter.child;

import javax.xml.stream.XMLStreamReader;

import org.flowable.bpmn.converter.util.BpmnXMLUtil;
import org.flowable.bpmn.model.BaseElement;
import org.flowable.bpmn.model.BpmnModel;
import org.flowable.bpmn.model.ExternalWorkerServiceTask;
import org.flowable.bpmn.model.IOParameter;

/**
* @author Valentin Zickner
*/
public class ExternalWorkerOutParameterParser extends BaseChildElementParser {

@Override
public String getElementName() {
return ELEMENT_EXTERNAL_WORKER_OUT_PARAMETER;
}

@Override
public void parseChildElement(XMLStreamReader xtr, BaseElement parentElement, BpmnModel model) throws Exception {
IOParameter parameter = BpmnXMLUtil.parseOutIOParameter(xtr);
((ExternalWorkerServiceTask) parentElement).getOutParameters().add(parameter);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,14 @@
</annotation>
</attribute>

<attribute name="doNotIncludeVariables" type="boolean">
<annotation>
<documentation>
Mark an external worker task to explicit not include the variables.
</documentation>
</annotation>
</attribute>

<element name="field">
<annotation>
<documentation>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import org.flowable.bpmn.model.BpmnModel;
import org.flowable.bpmn.model.ExternalWorkerServiceTask;
import org.flowable.bpmn.model.FlowElement;
import org.flowable.bpmn.model.IOParameter;
import org.flowable.editor.language.xml.util.BpmnXmlConverterTest;

class ExternalWorkerServiceTaskConverterTest {
Expand All @@ -32,5 +33,15 @@ void validateModel(BpmnModel model) {
assertThat(externalWorkerServiceTask.getTopic()).isEqualTo("topic");
assertThat(externalWorkerServiceTask.getSkipExpression()).isEqualTo("skipExpression");
assertThat(externalWorkerServiceTask.isExclusive()).isTrue();

assertThat(externalWorkerServiceTask.getInParameters()).hasSize(1);
IOParameter inParameter = externalWorkerServiceTask.getInParameters().get(0);
assertThat(inParameter.getSource()).isEqualTo("description");
assertThat(inParameter.getTarget()).isEqualTo("theDescription");
assertThat(externalWorkerServiceTask.getOutParameters()).hasSize(1);
IOParameter outParameter = externalWorkerServiceTask.getOutParameters().get(0);
assertThat(outParameter.getSource()).isEqualTo("theResult");
assertThat(outParameter.getTarget()).isEqualTo("result");

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
<sequenceFlow sourceRef="start" targetRef="externalWorkerServiceTask"/>
<serviceTask id="externalWorkerServiceTask" flowable:type="external-worker" name="External worker task" flowable:skipExpression="skipExpression"
flowable:topic="topic">
<extensionElements>
<flowable:externalWorkerInParameter source="description" target="theDescription"/>
<flowable:externalWorkerOutParameter source="theResult" target="result"/>
</extensionElements>
</serviceTask>
<sequenceFlow sourceRef="externalWorkerServiceTask" targetRef="end"/>
<endEvent id="end"/>
Expand Down
4 changes: 2 additions & 2 deletions modules/flowable-bpmn-layout/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@
<artifactId>jcl-over-slf4j</artifactId>
</dependency>
<dependency>
<groupId>org.tinyjee.jgraphx</groupId>
<groupId>com.github.vlsi.mxgraph</groupId>
<artifactId>jgraphx</artifactId>
<version>1.10.4.1</version>
<version>4.2.2</version>
</dependency>
<dependency>
<groupId>junit</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ protected void handleSequenceFlow() {
boundaryEdgeStyle.put(mxConstants.STYLE_EXIT_Y, 1.0);
boundaryEdgeStyle.put(mxConstants.STYLE_ENTRY_X, 0.5);
boundaryEdgeStyle.put(mxConstants.STYLE_ENTRY_Y, 1.0);
boundaryEdgeStyle.put(mxConstants.STYLE_EDGE, mxEdgeStyle.orthConnector);
boundaryEdgeStyle.put(mxConstants.STYLE_EDGE, mxEdgeStyle.OrthConnector);
graph.getStylesheet().putCellStyle(STYLE_BOUNDARY_SEQUENCEFLOW, boundaryEdgeStyle);

for (SequenceFlow sequenceFlow : sequenceFlows.values()) {
Expand Down Expand Up @@ -304,7 +304,7 @@ protected void handleAssociations() {
boundaryEdgeStyle.put(mxConstants.STYLE_EXIT_Y, 1.0);
boundaryEdgeStyle.put(mxConstants.STYLE_ENTRY_X, 0.5);
boundaryEdgeStyle.put(mxConstants.STYLE_ENTRY_Y, 1.0);
boundaryEdgeStyle.put(mxConstants.STYLE_EDGE, mxEdgeStyle.orthConnector);
boundaryEdgeStyle.put(mxConstants.STYLE_EDGE, mxEdgeStyle.OrthConnector);
graph.getStylesheet().putCellStyle(STYLE_BOUNDARY_SEQUENCEFLOW, boundaryEdgeStyle);

for (Association association : associations.values()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
public class ConditionalEventDefinition extends EventDefinition {

protected String conditionExpression;
protected String conditionLanguage;

public String getConditionExpression() {
return conditionExpression;
Expand All @@ -27,6 +28,14 @@ public void setConditionExpression(String conditionExpression) {
this.conditionExpression = conditionExpression;
}

public String getConditionLanguage() {
return conditionLanguage;
}

public void setConditionLanguage(String conditionLanguage) {
this.conditionLanguage = conditionLanguage;
}

@Override
public ConditionalEventDefinition clone() {
ConditionalEventDefinition clone = new ConditionalEventDefinition();
Expand All @@ -37,5 +46,6 @@ public ConditionalEventDefinition clone() {
public void setValues(ConditionalEventDefinition otherDefinition) {
super.setValues(otherDefinition);
setConditionExpression(otherDefinition.getConditionExpression());
setConditionLanguage(otherDefinition.getConditionLanguage());
}
}
Loading

0 comments on commit 3e402c1

Please sign in to comment.