Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update web modeler to latest bpmn-js version (16.4.0) #198

Merged
merged 15 commits into from
Feb 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 32 additions & 32 deletions cws-tasks/src/main/java/jpl/cws/task/CwsTask.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
/**
* Abstract base class for all CWS built-in (and custom user-added) task
* implementations.
*
*
*/
public abstract class CwsTask implements JavaDelegate {

Expand Down Expand Up @@ -55,32 +55,32 @@ public CwsTask() {
* 1) initializes parameters
* 2) runs the task implementation
* 3) throws any qualified exceptions
*
*
*/
public void execute(final DelegateExecution execution) {
this.execution = execution;

// setup tags on logging
log.setProcTags(getProcDefKey(execution),
execution.getProcessInstanceId(),
execution.getProcessInstanceId(),
execution.getActivityInstanceId());

try {
// setup base params
throwOnTruncatedVariableBoolean = getBooleanParam(
throwOnTruncatedVariable, "throwOnTruncatedVariable",
DEFAULT_THROW_ON_TRUNCATED_VARIABLE);

// Evaluate preCondition.
// If preCondition passes, then execute task,
// otherwise skip task execution.
if (evaluateTaskPreCondition()) {
setOutputVariable("preConditionPassed", true);

// get params
log.trace("INITIALIZING PARAMETERS FOR TASK: " + this);
initParams();

// execute the task
log.trace("EXECUTING TASK: " + this);
executeTask();
Expand All @@ -91,25 +91,25 @@ public void execute(final DelegateExecution execution) {
} catch (BpmnError e) {
log.warn("Propagating BpmnError(" + e.getErrorCode() + ")...");
setOutputVariable("bpmnErrorMessage", e.getErrorCode());

// We saw an error, but we want to check with Camunda because this is by-passing our end-event listener
notifyWorkerOfFailedProcess();

throw e; // propagate so engine can handle (if boundary catch defined)
} catch (Throwable t) {
log.error("Unexpected Throwable while executing " + this, t);
setOutputVariable("unexpectedErrorMessage", t.getMessage());

notifyWorkerOfFailedProcess();

// wrap and propagate so engine can (if boundary catch defined) handle
throw new BpmnError(UNEXPECTED_ERROR);
} finally {
// cleanup
this.execution = null;
}
}


private void notifyWorkerOfFailedProcess() {
log.debug("notifying workers of failed process...");
Expand All @@ -128,8 +128,8 @@ public void run() {
}
}).start();
}


private String getProcDefKey(final DelegateExecution execution) {
String procDefKey = "UNKNOWN";

Expand Down Expand Up @@ -159,34 +159,34 @@ private String getProcDefKey(final DelegateExecution execution) {

/**
* Implementation must be filled out by subclasses.
*
*
*/
protected abstract void initParams() throws Exception;

/**
* Implementation must be filled out by subclasses.
*
*
*/
protected abstract void executeTask() throws Exception;

/**
* Evaluates the task preCondition.
*
*
* @return true if preCondition passes false if preCondition fails
*
*
* @throws Exception if unexpected exception occurs
* @throws BpmnError if process is to be determined.
*/
private boolean evaluateTaskPreCondition() throws Exception {

if (!getBooleanParam(preCondition, "preCondition",
DEFAULT_PRE_CONDITION)) {

// Check special case for preCondition is "none" and pass as true
if (preCondition != null && preCondition.getValue(execution).equals("none")) {
return true;
}

log.warn("preCondition was not satisfied");
PreConditionFailBehavior failBehavior = PreConditionFailBehavior
.valueOf(getStringParam(onPreConditionFail,
Expand Down Expand Up @@ -269,7 +269,7 @@ protected String getStringParam(Expression expression, String paramName)
}

protected String getStringParam(Expression expression, String paramName,
String defaultValue) throws Exception {
String defaultValue) throws Exception {
if (expression == null) {
// return default
return defaultValue;
Expand All @@ -292,7 +292,7 @@ protected Boolean getBooleanParam(Expression expression, String paramName)
}

protected Boolean getBooleanParam(Expression expression, String paramName,
Boolean defaultValue) throws Exception {
Boolean defaultValue) throws Exception {
if (expression == null) {
// return default
return defaultValue;
Expand Down Expand Up @@ -322,7 +322,7 @@ protected Integer getIntegerParam(Expression expression, String paramName)
}

protected Integer getIntegerParam(Expression expression, String paramName,
Integer defaultValue) throws Exception {
Integer defaultValue) throws Exception {
if (expression == null) {
// return default
return defaultValue;
Expand Down Expand Up @@ -352,7 +352,7 @@ protected Long getLongParam(Expression expression, String paramName)
}

protected Long getLongParam(Expression expression, String paramName,
Long defaultValue) throws Exception {
Long defaultValue) throws Exception {
if (expression == null) {
// return default
return defaultValue;
Expand Down Expand Up @@ -384,7 +384,7 @@ protected Float getFloatParam(Expression expression, String paramName)
}

protected Float getFloatParam(Expression expression, String paramName,
Float defaultValue) throws Exception {
Float defaultValue) throws Exception {
if (expression == null) {
// return default
return defaultValue;
Expand Down Expand Up @@ -414,7 +414,7 @@ protected Double getDoubleParam(Expression expression, String paramName)
}

protected Double getDoubleParam(Expression expression, String paramName,
Double defaultValue) throws Exception {
Double defaultValue) throws Exception {
if (expression == null) {
// return default
return defaultValue;
Expand All @@ -437,10 +437,10 @@ private Double getDoubleValue(Object value, String paramName)
/**
* For now only supports Map<String,String> but may want to support
* generics/others in future...
*
*
*/
protected Map<String, String> getMapParam(Expression expression,
String paramName) throws Exception {
String paramName) throws Exception {
if (expression == null) {
// no default, so throw exception
throw new Exception("Mandatory parameter '" + paramName + "' not specified");
Expand All @@ -449,7 +449,7 @@ protected Map<String, String> getMapParam(Expression expression,
}

protected Map<String, String> getMapParam(Expression expression,
String paramName, Map<String, String> defaultValue)
String paramName, Map<String, String> defaultValue)
throws Exception {
if (expression == null) {
// return default
Expand Down Expand Up @@ -482,4 +482,4 @@ private Map<String, String> getMapValue(Object value, String paramName)
}
}

}
}
24 changes: 12 additions & 12 deletions cws-ui/src/main/webapp/css/history.css
Original file line number Diff line number Diff line change
Expand Up @@ -61,34 +61,34 @@ summary {
}

.proc-var-flex-main {
margin-bottom: 10px;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
margin-bottom: 10px;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
justify-content: flex-start;
align-items: center;
}

.proc-var-flex-main-sub-1 {
align-self: start;
display: flex;
flex-wrap: nowrap;
display: flex;
flex-wrap: nowrap;
justify-content: space-between;
}

.proc-var-flex-main-sub-2 {
width: 150px;
word-wrap: break-word;
width: 160px;
word-wrap: break-word;
overflow: hidden;
}

.proc-var-flex-main-sub-3 {
width: 200px;
width: 300px;
word-wrap: break-word;
}

.proc-var-flex-btn {
align-self: start;
align-self: start;
}

#logDataNest {
Expand All @@ -97,4 +97,4 @@ summary {

.procInstId-cell {
width: 300px;
}
}
Loading
Loading