Skip to content

Commit

Permalink
Update web modeler to latest bpmn-js version (16.4.0) (#198)
Browse files Browse the repository at this point in the history
* Update web modeler to latest bpmn-js version

* Update panel direction to be ltr (instead of rtl)

* Fix deploy to CWS error (had trouble fetching process name), update CSS

* Update history.css (history page css)

* Autowire process service

* Move away from thread?

* Autowire context?

* Remake context?

* Revert "Merge branch 'develop' into wg-update-web-modeler"

This reverts commit 2f310e0, reversing
changes made to 1cab3bf.

* Revert "Update history.css (history page css)"

This reverts commit 1cab3bf.

* Update history.css

* Revert "Revert "Merge branch 'develop' into wg-update-web-modeler""

This reverts commit 7356fb9.

* Revert changes to CwsTask.java
  • Loading branch information
wcgunter authored Feb 20, 2024
1 parent afdb965 commit ceeecbe
Show file tree
Hide file tree
Showing 4 changed files with 161,065 additions and 76,365 deletions.
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

0 comments on commit ceeecbe

Please sign in to comment.