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

ederign pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-kie-tools.git


The following commit(s) were added to refs/heads/main by this push:
     new d558f9c3d4e KOGITO-9929: Filter and Timeout Tooltips show null instead 
of undefined (#2044)
d558f9c3d4e is described below

commit d558f9c3d4e1e9de66e544516b8ee5a0c130cf5b
Author: Dmitrii Tikhomirov <[email protected]>
AuthorDate: Wed Jan 17 11:14:05 2024 -0800

    KOGITO-9929: Filter and Timeout Tooltips show null instead of undefined 
(#2044)
---
 .../sw/resources/i18n/SWConstants.properties       |  4 +--
 .../sw/client/shapes/CallbackStateShape.java       | 10 ++++----
 .../stunner/sw/client/shapes/EventStateShape.java  |  6 ++---
 .../sw/client/shapes/ForEachStateShape.java        |  4 +--
 .../stunner/sw/client/shapes/HasActions.java       | 14 +++++------
 .../shapes/HasConditionsAndHasDataFilter.java      | 12 ++++-----
 .../stunner/sw/client/shapes/HasDataFilter.java    | 26 +++----------------
 .../stunner/sw/client/shapes/HasTranslation.java   |  7 +++---
 .../{HasTranslation.java => IsTruncatable.java}    | 29 +++++++++++++++++-----
 .../sw/client/shapes/OperationStateShape.java      |  4 +--
 .../sw/client/shapes/ParallelStateShape.java       |  4 +--
 .../stunner/sw/client/shapes/SleepStateShape.java  |  4 +--
 .../stunner/sw/client/shapes/SwitchStateShape.java |  4 +--
 .../stunner/sw/client/shapes/HasActionsTest.java   |  6 ++---
 .../sw/client/shapes/HasCollectionsTest.java       | 20 +++++++--------
 .../sw/client/shapes/HasDataFilterTest.java        | 18 +++++++-------
 .../client/shapes/HasEventAndDataFilterTest.java   | 10 ++++----
 17 files changed, 91 insertions(+), 91 deletions(-)

diff --git 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-api/src/main/resources/org/kie/workbench/common/stunner/sw/resources/i18n/SWConstants.properties
 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-api/src/main/resources/org/kie/workbench/common/stunner/sw/resources/i18n/SWConstants.properties
index 197b63661e0..0e4dedf9d44 100644
--- 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-api/src/main/resources/org/kie/workbench/common/stunner/sw/resources/i18n/SWConstants.properties
+++ 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-api/src/main/resources/org/kie/workbench/common/stunner/sw/resources/i18n/SWConstants.properties
@@ -320,7 +320,7 @@ 
org.kie.workbench.common.stunner.sw.definition.ActionTransition.property.name=Na
 InvalidTargetName.message=Transition from %s has invalid target.
 DuplicateStateName.message=%s state name is duplicated.
 
-Action.null=Action is null
+Action.null=Action is undefined
 Actions.null=No actions provided
 Action.name=Action name
 Action.function=Action functionRef
@@ -367,4 +367,4 @@ Condition.eventvalue=EventRef
 Input.collection=InputCollection
 Output.collection=OutputCollection
 Iteration.parameter=IterationParameter
-Foreach.batchsize=BatchSize
\ No newline at end of file
+Foreach.batchsize=BatchSize
diff --git 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/CallbackStateShape.java
 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/CallbackStateShape.java
index 3aca20882ad..c1a73613f3c 100644
--- 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/CallbackStateShape.java
+++ 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/CallbackStateShape.java
@@ -64,14 +64,14 @@ public class CallbackStateShape extends StateShape 
implements HasActions,
         if (state.getTimeouts() != null && state.getTimeouts() instanceof 
WorkflowTimeouts) {
             getView().addChild(new CornerIcon(CLOCK,
                                               CENTER_TOP,
-                                              getTranslation(TIMEOUT_EVENT) + 
": " + ((WorkflowTimeouts) state.getTimeouts()).getEventTimeout() + "\r\n"
-                                                      + 
getTranslation(TIMEOUT_STATE) + ": " + ((WorkflowTimeouts) 
state.getTimeouts()).getStateExecTimeout() + "\r\n"
-                                                      + 
getTranslation(TIMEOUT_ACTION) + ": " + ((WorkflowTimeouts) 
state.getTimeouts()).getActionExecTimeout()));
+                                              getTranslation(TIMEOUT_EVENT) + 
": " + truncate(((WorkflowTimeouts) state.getTimeouts()).getEventTimeout()) + 
"\r\n"
+                                                      + 
getTranslation(TIMEOUT_STATE) + ": " + truncate(((WorkflowTimeouts) 
state.getTimeouts()).getStateExecTimeout()) + "\r\n"
+                                                      + 
getTranslation(TIMEOUT_ACTION) + ": " + truncate(((WorkflowTimeouts) 
state.getTimeouts()).getActionExecTimeout())));
         }
 
         getView().addChild(new CornerIcon(EVENT,
                                           LEFT_FROM_RIGHT_TOP_CORNER,
-                                          getTranslation(EVENT_REFERENCE) + ": 
" + state.getEventRef()));
+                                          getTranslation(EVENT_REFERENCE) + ": 
" + truncate(state.getEventRef())));
 
         getView().addChild(new CornerIcon(SERVICE,
                                           RIGHT_TOP_CORNER,
@@ -82,7 +82,7 @@ public class CallbackStateShape extends StateShape implements 
HasActions,
                                               BOTTOM_FROM_RIGHT_TOP_CORNER,
                                               
getStateDataFilter(state.getStateDataFilter())
                                                       + "\r\n\r\n"
-                                                      + 
getEventFilter(state.getEventDataFilter())));
+                                                      + 
truncate(getEventFilter(state.getEventDataFilter()))));
         }
 
         if (null != state.getAction() && hasSubflows(new 
ActionNode[]{state.getAction()})) {
diff --git 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/EventStateShape.java
 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/EventStateShape.java
index ac03e3dca7d..9caae4392cb 100644
--- 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/EventStateShape.java
+++ 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/EventStateShape.java
@@ -54,9 +54,9 @@ public class EventStateShape extends StateShape implements 
HasDataFilter {
         if (state.getTimeouts() != null && state.getTimeouts() instanceof 
WorkflowTimeouts) {
             getView().addChild(new CornerIcon(CLOCK,
                                               RIGHT_TOP_CORNER,
-                                              getTranslation(TIMEOUT_EVENT) + 
": " + ((WorkflowTimeouts)state.getTimeouts()).getEventTimeout() + "\r\n"
-                                                      + 
getTranslation(TIMEOUT_STATE) + ": " + 
((WorkflowTimeouts)state.getTimeouts()).getStateExecTimeout() + "\r\n"
-                                                      + 
getTranslation(TIMEOUT_ACTION) + ": " + 
((WorkflowTimeouts)state.getTimeouts()).getActionExecTimeout()));
+                                              getTranslation(TIMEOUT_EVENT) + 
": " + truncate(((WorkflowTimeouts)state.getTimeouts()).getEventTimeout()) + 
"\r\n"
+                                                      + 
getTranslation(TIMEOUT_STATE) + ": " + 
truncate(((WorkflowTimeouts)state.getTimeouts()).getStateExecTimeout()) + "\r\n"
+                                                      + 
getTranslation(TIMEOUT_ACTION) + ": " + 
truncate(((WorkflowTimeouts)state.getTimeouts()).getActionExecTimeout())));
         }
 
         if (state.getStateDataFilter() != null) {
diff --git 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/ForEachStateShape.java
 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/ForEachStateShape.java
index c47f7c89c2f..44e372f4e9e 100644
--- 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/ForEachStateShape.java
+++ 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/ForEachStateShape.java
@@ -64,8 +64,8 @@ public class ForEachStateShape extends StateShape implements 
HasActions,
         if (state.getTimeouts() != null && state.getTimeouts() instanceof 
WorkflowTimeouts) {
             getView().addChild(new CornerIcon(CLOCK,
                                               LEFT_FROM_RIGHT_TOP_CORNER,
-                                              getTranslation(TIMEOUT_STATE) + 
": " + ((WorkflowTimeouts) state.getTimeouts()).getStateExecTimeout() + "\r\n"
-                                                      + 
getTranslation(TIMEOUT_ACTION) + ": " + ((WorkflowTimeouts) 
state.getTimeouts()).getActionExecTimeout()));
+                                              getTranslation(TIMEOUT_STATE) + 
": " + truncate(((WorkflowTimeouts) state.getTimeouts()).getStateExecTimeout()) 
+ "\r\n"
+                                                      + 
getTranslation(TIMEOUT_ACTION) + ": " + truncate(((WorkflowTimeouts) 
state.getTimeouts()).getActionExecTimeout())));
         }
 
         getView().addChild(new CornerIcon(SERVICE,
diff --git 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/HasActions.java
 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/HasActions.java
index fe36700218a..4785a36aeef 100644
--- 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/HasActions.java
+++ 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/HasActions.java
@@ -31,7 +31,7 @@ import static 
org.kie.workbench.common.stunner.sw.resources.i18n.SWConstants.ACT
 import static 
org.kie.workbench.common.stunner.sw.resources.i18n.SWConstants.ACTION_IS_SUBFLOW;
 import static 
org.kie.workbench.common.stunner.sw.resources.i18n.SWConstants.ACTION_NAME;
 
-public interface HasActions extends HasTranslation {
+public interface HasActions extends HasTranslation, IsTruncatable {
 
     default String getActionStringFromArray(ActionNode[] actions) {
         if (actions == null || actions.length == 0) {
@@ -53,29 +53,29 @@ public interface HasActions extends HasTranslation {
         }
 
         if (StringUtils.nonEmpty(action.getName())) {
-            return getTranslation(ACTION_NAME) + ": " + action.getName();
+            return getTranslation(ACTION_NAME) + ": " + 
truncate(action.getName());
         }
 
         if (action.getFunctionRef() != null) {
             if (action.getFunctionRef() instanceof String) {
-                return getTranslation(ACTION_IS_FUNC) + ": " + 
action.getFunctionRef();
+                return getTranslation(ACTION_IS_FUNC) + ": " + 
truncate(action.getFunctionRef().toString());
             }
 
             FunctionRef functionRef = (FunctionRef) action.getFunctionRef();
-            return getTranslation(ACTION_IS_FUNC) + ": " + 
functionRef.getRefName();
+            return getTranslation(ACTION_IS_FUNC) + ": " + 
truncate(functionRef.getRefName());
         }
 
         if (action.getEventRef() != null) {
-            return getTranslation(ACTION_IS_EVENT) + ": " + 
action.getEventRef().getConsumeEventRef();
+            return getTranslation(ACTION_IS_EVENT) + ": " + 
truncate(action.getEventRef().getConsumeEventRef());
         }
 
         if (action.getSubFlowRef() != null) {
             if (action.getSubFlowRef() instanceof String) {
-                return getTranslation(ACTION_IS_SUBFLOW) + ": " + 
action.getSubFlowRef();
+                return getTranslation(ACTION_IS_SUBFLOW) + ": " + 
truncate(action.getSubFlowRef().toString());
             }
 
             SubFlowRef subFlowRef = (SubFlowRef) action.getSubFlowRef();
-            return getTranslation(ACTION_IS_SUBFLOW) + ": " + 
subFlowRef.getWorkflowId();
+            return getTranslation(ACTION_IS_SUBFLOW) + ": " + 
truncate(subFlowRef.getWorkflowId());
         }
 
         return getTranslation(ACTION_IS_NULL);
diff --git 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/HasConditionsAndHasDataFilter.java
 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/HasConditionsAndHasDataFilter.java
index ed30963405a..4ddd3d9c115 100644
--- 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/HasConditionsAndHasDataFilter.java
+++ 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/HasConditionsAndHasDataFilter.java
@@ -6,15 +6,15 @@
  * to you 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. 
+ * under the License.
  */
 
 
@@ -44,7 +44,7 @@ public interface HasConditionsAndHasDataFilter extends 
HasDataFilter {
             conditionString.append(getTranslation(DATA_CONDITION_TRANSITION) + 
":\r\n");
             for (DataConditionTransition d : data) {
                 if (d.getName() != null && !d.getName().isEmpty()) {
-                    
conditionString.append(getTranslation(DATA_CONDITION_TRANSITION_NAME) + ": " + 
d.getName() + "\r\n");
+                    
conditionString.append(getTranslation(DATA_CONDITION_TRANSITION_NAME) + ": " + 
truncate(d.getName()) + "\r\n");
                 } else {
                     
conditionString.append(getTranslation(DATA_CONDITION_TRANSITION_VALUE) + ": " + 
truncate(d.getCondition()) + "\r\n");
                 }
@@ -56,9 +56,9 @@ public interface HasConditionsAndHasDataFilter extends 
HasDataFilter {
             conditionString.append(getTranslation(EVENT_CONDITION_TRANSITION) 
+ ":\r\n");
             for (EventConditionTransition event : events) {
                 if (event.getName() != null && !event.getName().isEmpty()) {
-                    
conditionString.append(getTranslation(EVENT_CONDITION_TRANSITION_NAME) + ": " + 
event.getName() + "\r\n");
+                    
conditionString.append(getTranslation(EVENT_CONDITION_TRANSITION_NAME) + ": " + 
truncate(event.getName()) + "\r\n");
                 } else {
-                    
conditionString.append(getTranslation(EVENT_CONDITION_TRANSITION_VALUE) + ": " 
+ event.eventRef + "\r\n");
+                    
conditionString.append(getTranslation(EVENT_CONDITION_TRANSITION_VALUE) + ": " 
+ truncate(event.eventRef) + "\r\n");
                 }
             }
             return conditionString.toString();
diff --git 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/HasDataFilter.java
 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/HasDataFilter.java
index 930d0663dc2..317d4f5885a 100644
--- 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/HasDataFilter.java
+++ 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/HasDataFilter.java
@@ -6,15 +6,15 @@
  * to you 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. 
+ * under the License.
  */
 
 
@@ -27,9 +27,7 @@ import static 
org.kie.workbench.common.stunner.sw.resources.i18n.SWConstants.DAT
 import static 
org.kie.workbench.common.stunner.sw.resources.i18n.SWConstants.DATA_FILTER_OUTPUT;
 import static 
org.kie.workbench.common.stunner.sw.resources.i18n.SWConstants.DATA_FILTER_PARAMETER;
 
-public interface HasDataFilter extends HasTranslation {
-
-    int DEFAULT_MAX_LENGTH_SIZE = 30;
+public interface HasDataFilter extends HasTranslation, IsTruncatable {
 
     default String getStateDataFilter(StateDataFilter filter) {
         if (filter == null) {
@@ -40,20 +38,4 @@ public interface HasDataFilter extends HasTranslation {
                 + "\r\n" + getTranslation(DATA_FILTER_OUTPUT) + ": " + 
truncate(filter.getOutput());
     }
 
-    default String truncate(String value) {
-        return truncate(value, DEFAULT_MAX_LENGTH_SIZE);
-    }
-
-    default String truncate(String value, int size) {
-        if (value == null) {
-            return value;
-        }
-
-        String result = value.trim();
-        if (result.length() <= size) {
-            return result;
-        }
-
-        return result.substring(0, size) + "...";
-    }
 }
diff --git 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/HasTranslation.java
 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/HasTranslation.java
index d3b73dc2995..23354b8ae43 100644
--- 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/HasTranslation.java
+++ 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/HasTranslation.java
@@ -6,15 +6,15 @@
  * to you 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. 
+ * under the License.
  */
 
 
@@ -23,4 +23,5 @@ package org.kie.workbench.common.stunner.sw.client.shapes;
 public interface HasTranslation {
 
     String getTranslation(String constant);
+
 }
diff --git 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/HasTranslation.java
 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/IsTruncatable.java
similarity index 62%
copy from 
packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/HasTranslation.java
copy to 
packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/IsTruncatable.java
index d3b73dc2995..fa2baffdc22 100644
--- 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/HasTranslation.java
+++ 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/IsTruncatable.java
@@ -6,21 +6,38 @@
  * to you 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. 
+ * under the License.
  */
 
-
 package org.kie.workbench.common.stunner.sw.client.shapes;
 
-public interface HasTranslation {
+public interface IsTruncatable {
+
+    int DEFAULT_MAX_LENGTH_SIZE = 30;
+
+
+    default String truncate(String value) {
+        return truncate(value, DEFAULT_MAX_LENGTH_SIZE);
+    }
+
+    default String truncate(String value, int size) {
+        if (value == null) {
+            return "undefined";
+        }
+
+        String result = value.trim();
+        if (result.length() <= size) {
+            return result;
+        }
 
-    String getTranslation(String constant);
+        return result.substring(0, size) + "...";
+    }
 }
diff --git 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/OperationStateShape.java
 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/OperationStateShape.java
index ce9d69ccc66..24730c3a7d6 100644
--- 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/OperationStateShape.java
+++ 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/OperationStateShape.java
@@ -62,8 +62,8 @@ public class OperationStateShape extends StateShape 
implements HasActions,
         if (state.getTimeouts() != null && state.getTimeouts() instanceof 
WorkflowTimeouts) {
             getView().addChild(new CornerIcon(CLOCK,
                                               LEFT_FROM_RIGHT_TOP_CORNER,
-                                              getTranslation(TIMEOUT_STATE) + 
": " + ((WorkflowTimeouts) state.getTimeouts()).getStateExecTimeout() + "\r\n"
-                                                      + 
getTranslation(TIMEOUT_ACTION) + ": " + ((WorkflowTimeouts) 
state.getTimeouts()).getActionExecTimeout()));
+                                              getTranslation(TIMEOUT_STATE) + 
": " + truncate(((WorkflowTimeouts) state.getTimeouts()).getStateExecTimeout()) 
+ "\r\n"
+                                                      + 
getTranslation(TIMEOUT_ACTION) + ": " + truncate(((WorkflowTimeouts) 
state.getTimeouts()).getActionExecTimeout())));
         }
 
         getView().addChild(new CornerIcon(SERVICE,
diff --git 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/ParallelStateShape.java
 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/ParallelStateShape.java
index 0e1fe459667..0cacd508e1a 100644
--- 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/ParallelStateShape.java
+++ 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/ParallelStateShape.java
@@ -60,8 +60,8 @@ public class ParallelStateShape extends StateShape implements 
HasDataFilter,
         if (state.getTimeouts() != null && state.getTimeouts() instanceof 
WorkflowTimeouts) {
             getView().addChild(new CornerIcon(CLOCK,
                                               LEFT_FROM_RIGHT_TOP_CORNER,
-                                              getTranslation(TIMEOUT_BRANCH) + 
": " + ((WorkflowTimeouts) state.getTimeouts()).getBranchExecTimeout() + "\r\n"
-                                                      + 
getTranslation(TIMEOUT_STATE) + ": " + ((WorkflowTimeouts) 
state.getTimeouts()).getStateExecTimeout()));
+                                              getTranslation(TIMEOUT_BRANCH) + 
": " + truncate(((WorkflowTimeouts) 
state.getTimeouts()).getBranchExecTimeout()) + "\r\n"
+                                                      + 
getTranslation(TIMEOUT_STATE) + ": " + truncate(((WorkflowTimeouts) 
state.getTimeouts()).getStateExecTimeout())));
         }
 
         getView().addChild(new CornerIcon(BRANCH,
diff --git 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/SleepStateShape.java
 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/SleepStateShape.java
index a6b645b83a4..5aedcdce577 100644
--- 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/SleepStateShape.java
+++ 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/SleepStateShape.java
@@ -33,7 +33,7 @@ import static 
org.kie.workbench.common.stunner.sw.client.shapes.icons.IconPath.C
 import static 
org.kie.workbench.common.stunner.sw.client.shapes.icons.IconPosition.RIGHT_TOP_CORNER;
 import static 
org.kie.workbench.common.stunner.sw.resources.i18n.SWConstants.SLEEP_DURATION;
 
-public class SleepStateShape extends StateShape {
+public class SleepStateShape extends StateShape implements IsTruncatable {
 
     public static final String ICON_COLOR = "#5752D1";
     public static final String ICON_SVG = 
"M54.24,53.11c3.71-4.77,5.92-10.77,5.92-17.28,0-15.56-12.61-28.17-28.17-28.17S3.83,20.27,3.83,35.83c0,6.49,2.19,12.46,5.87,17.22l-2.53,2.53c-1.63,1.63-1.8,4.46-.28,6.2,1.74,2,4.76,2.07,6.59,.24l2.8-2.8c4.49,3.02,9.9,4.79,15.71,4.79s11.17-1.75,15.65-4.74l2.75,2.75c1.63,1.63,4.46,1.8,6.2,.28,2-1.74,2.07-4.76,.24-6.59l-2.59-2.59Zm-13.09-8.11l-10.59-7.06c-.74-.4-1.18-1.22-1.18-2.11l-.1-15c0-1.47,1.28-2.65,2.65-2.65,1.57,0,2.75,1.18,2.75,2.65v13.58l9.
 [...]
@@ -48,7 +48,7 @@ public class SleepStateShape extends StateShape {
         SleepState state = (SleepState) element.getContent().getDefinition();
         getView().addChild(new CornerIcon(CLOCK,
                                           RIGHT_TOP_CORNER,
-                                          getTranslation(SLEEP_DURATION) + ": 
" + state.getDuration()));
+                                          getTranslation(SLEEP_DURATION) + ": 
" + truncate(state.getDuration())));
     }
 
     @Override
diff --git 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/SwitchStateShape.java
 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/SwitchStateShape.java
index 47847597d85..1e84fd48fc8 100644
--- 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/SwitchStateShape.java
+++ 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/main/java/org/kie/workbench/common/stunner/sw/client/shapes/SwitchStateShape.java
@@ -55,8 +55,8 @@ public class SwitchStateShape extends StateShape implements 
HasConditionsAndHasD
         if (state.getTimeouts() != null && state.getTimeouts() instanceof 
WorkflowTimeouts) {
             getView().addChild(new CornerIcon(CLOCK,
                                               LEFT_FROM_RIGHT_TOP_CORNER,
-                                              getTranslation(TIMEOUT_EVENT) + 
": " + ((WorkflowTimeouts) state.getTimeouts()).getEventTimeout() + "\r\n"
-                                                      + 
getTranslation(TIMEOUT_STATE) + ": " + ((WorkflowTimeouts) 
state.getTimeouts()).getStateExecTimeout()));
+                                              getTranslation(TIMEOUT_EVENT) + 
": " + truncate(((WorkflowTimeouts) state.getTimeouts()).getEventTimeout()) + 
"\r\n"
+                                                      + 
getTranslation(TIMEOUT_STATE) + ": " + truncate(((WorkflowTimeouts) 
state.getTimeouts()).getStateExecTimeout())));
         }
 
         if (state.getStateDataFilter() != null) {
diff --git 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/test/java/org/kie/workbench/common/stunner/sw/client/shapes/HasActionsTest.java
 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/test/java/org/kie/workbench/common/stunner/sw/client/shapes/HasActionsTest.java
index 2b69f0f69c4..677e6993942 100644
--- 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/test/java/org/kie/workbench/common/stunner/sw/client/shapes/HasActionsTest.java
+++ 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/test/java/org/kie/workbench/common/stunner/sw/client/shapes/HasActionsTest.java
@@ -72,7 +72,7 @@ public class HasActionsTest extends HasTranslationGeneralTest 
{
         FunctionRef functionRef = new FunctionRef();
         action.setFunctionRef(functionRef);
 
-        assertTranslations(TEST_STRING + ": " + "null",
+        assertTranslations(TEST_STRING + ": " + "undefined",
                            hasAction.getActionString(action),
                            "Action.function");
     }
@@ -96,7 +96,7 @@ public class HasActionsTest extends HasTranslationGeneralTest 
{
         ActionEventRef eventRef = new ActionEventRef();
         action.setEventRef(eventRef);
 
-        assertTranslations(TEST_STRING + ": " + "null",
+        assertTranslations(TEST_STRING + ": " + "undefined",
                            hasAction.getActionString(action),
                            "Action.event");
     }
@@ -131,7 +131,7 @@ public class HasActionsTest extends 
HasTranslationGeneralTest {
         SubFlowRef subFlowRef = new SubFlowRef();
         action.setSubFlowRef(subFlowRef);
 
-        assertTranslations(TEST_STRING + ": " + "null",
+        assertTranslations(TEST_STRING + ": " + "undefined",
                            hasAction.getActionString(action),
                            "Action.subflow");
     }
diff --git 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/test/java/org/kie/workbench/common/stunner/sw/client/shapes/HasCollectionsTest.java
 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/test/java/org/kie/workbench/common/stunner/sw/client/shapes/HasCollectionsTest.java
index 2c90470bf93..7975d594656 100644
--- 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/test/java/org/kie/workbench/common/stunner/sw/client/shapes/HasCollectionsTest.java
+++ 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/test/java/org/kie/workbench/common/stunner/sw/client/shapes/HasCollectionsTest.java
@@ -6,15 +6,15 @@
  * to you 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. 
+ * under the License.
  */
 
 
@@ -40,7 +40,7 @@ public class HasCollectionsTest extends 
HasTranslationGeneralTest {
 
     @Test
     public void testGetCollectionsAllNull() {
-        assertTranslations(TEST_STRING + ": null\r\n" + TEST_STRING + ": ∞",
+        assertTranslations(TEST_STRING + ": undefined\r\n" + TEST_STRING + ": 
∞",
                            hasCollections.getCollections(state),
                            INPUT_COLLECTION,
                            FOR_EACH_BATCH_SIZE);
@@ -67,7 +67,7 @@ public class HasCollectionsTest extends 
HasTranslationGeneralTest {
     @Test
     public void testGetCollectionsShortOutputCollection() {
         state.setOutputCollection(SHORT_VALUE);
-        assertTranslations(TEST_STRING + ": null\r\n" + TEST_STRING + ": " + 
SHORT_VALUE + "\r\n" + TEST_STRING + ": ∞",
+        assertTranslations(TEST_STRING + ": undefined\r\n" + TEST_STRING + ": 
" + SHORT_VALUE + "\r\n" + TEST_STRING + ": ∞",
                            hasCollections.getCollections(state),
                            INPUT_COLLECTION,
                            OUTPUT_COLLECTION,
@@ -77,7 +77,7 @@ public class HasCollectionsTest extends 
HasTranslationGeneralTest {
     @Test
     public void testGetCollectionsLongOutputCollection() {
         state.setOutputCollection(LONG_VALUE);
-        assertTranslations(TEST_STRING + ": null\r\n" + TEST_STRING + ": " + 
TRUNCATE_VALUE + "\r\n" + TEST_STRING + ": ∞",
+        assertTranslations(TEST_STRING + ": undefined\r\n" + TEST_STRING + ": 
" + TRUNCATE_VALUE + "\r\n" + TEST_STRING + ": ∞",
                            hasCollections.getCollections(state),
                            INPUT_COLLECTION,
                            OUTPUT_COLLECTION,
@@ -87,7 +87,7 @@ public class HasCollectionsTest extends 
HasTranslationGeneralTest {
     @Test
     public void testGetCollectionsIterationParam() {
         state.setIterationParam(SHORT_VALUE);
-        assertTranslations(TEST_STRING + ": null\r\n" + TEST_STRING + ": " + 
SHORT_VALUE + "\r\n" + TEST_STRING + ": ∞",
+        assertTranslations(TEST_STRING + ": undefined\r\n" + TEST_STRING + ": 
" + SHORT_VALUE + "\r\n" + TEST_STRING + ": ∞",
                            hasCollections.getCollections(state),
                            INPUT_COLLECTION,
                            ITERATION_PARAMETER,
@@ -97,7 +97,7 @@ public class HasCollectionsTest extends 
HasTranslationGeneralTest {
     @Test
     public void testGetCollectionsLongIterationParam() {
         state.setIterationParam(LONG_VALUE);
-        assertTranslations(TEST_STRING + ": null\r\n" + TEST_STRING + ": " + 
TRUNCATE_VALUE + "\r\n" + TEST_STRING + ": ∞",
+        assertTranslations(TEST_STRING + ": undefined\r\n" + TEST_STRING + ": 
" + TRUNCATE_VALUE + "\r\n" + TEST_STRING + ": ∞",
                            hasCollections.getCollections(state),
                            INPUT_COLLECTION,
                            ITERATION_PARAMETER,
@@ -107,7 +107,7 @@ public class HasCollectionsTest extends 
HasTranslationGeneralTest {
     @Test
     public void testIsDefaultBatchSizeInteger() {
         state.setBatchSize(Integer.valueOf(5));
-        assertTranslations(TEST_STRING + ": null\r\n" + TEST_STRING + ": 5",
+        assertTranslations(TEST_STRING + ": undefined\r\n" + TEST_STRING + ": 
5",
                            hasCollections.getCollections(state),
                            INPUT_COLLECTION,
                            FOR_EACH_BATCH_SIZE);
@@ -116,7 +116,7 @@ public class HasCollectionsTest extends 
HasTranslationGeneralTest {
     @Test
     public void testIsDefaultBatchSizeString() {
         state.setBatchSize("7");
-        assertTranslations(TEST_STRING + ": null\r\n" + TEST_STRING + ": 7",
+        assertTranslations(TEST_STRING + ": undefined\r\n" + TEST_STRING + ": 
7",
                            hasCollections.getCollections(state),
                            INPUT_COLLECTION,
                            FOR_EACH_BATCH_SIZE);
diff --git 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/test/java/org/kie/workbench/common/stunner/sw/client/shapes/HasDataFilterTest.java
 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/test/java/org/kie/workbench/common/stunner/sw/client/shapes/HasDataFilterTest.java
index b3fded7b664..4fc936cbf72 100644
--- 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/test/java/org/kie/workbench/common/stunner/sw/client/shapes/HasDataFilterTest.java
+++ 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/test/java/org/kie/workbench/common/stunner/sw/client/shapes/HasDataFilterTest.java
@@ -6,15 +6,15 @@
  * to you 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. 
+ * under the License.
  */
 
 
@@ -38,7 +38,7 @@ public class HasDataFilterTest extends 
HasTranslationGeneralTest {
         String in = "in";
         filter.setInput(in);
 
-        assertTranslations(TEST_STRING + ":\r\n" + TEST_STRING + ": in\r\n" + 
TEST_STRING + ": null",
+        assertTranslations(TEST_STRING + ":\r\n" + TEST_STRING + ": in\r\n" + 
TEST_STRING + ": undefined",
                            hasDataFilter.getStateDataFilter(filter),
                            "Datafilter.parameter",
                            "Datafilter.input",
@@ -51,7 +51,7 @@ public class HasDataFilterTest extends 
HasTranslationGeneralTest {
         String out = "out";
         filter.setOutput(out);
 
-        assertTranslations(TEST_STRING + ":\r\n" + TEST_STRING + ": null\r\n" 
+ TEST_STRING + ": out",
+        assertTranslations(TEST_STRING + ":\r\n" + TEST_STRING + ": 
undefined\r\n" + TEST_STRING + ": out",
                            hasDataFilter.getStateDataFilter(filter),
                            "Datafilter.parameter",
                            "Datafilter.input",
@@ -64,7 +64,7 @@ public class HasDataFilterTest extends 
HasTranslationGeneralTest {
         String in = "012345678901234567890123456789012345";
         filter.setInput(in);
 
-        assertTranslations(TEST_STRING + ":\r\n" + TEST_STRING + ": 
012345678901234567890123456789...\r\n" + TEST_STRING + ": null",
+        assertTranslations(TEST_STRING + ":\r\n" + TEST_STRING + ": 
012345678901234567890123456789...\r\n" + TEST_STRING + ": undefined",
                            hasDataFilter.getStateDataFilter(filter),
                            "Datafilter.parameter",
                            "Datafilter.input",
@@ -77,7 +77,7 @@ public class HasDataFilterTest extends 
HasTranslationGeneralTest {
         String out = "012345678901234567890123456789012345";
         filter.setOutput(out);
 
-        assertTranslations(TEST_STRING + ":\r\n" + TEST_STRING + ": null\r\n" 
+ TEST_STRING + ": 012345678901234567890123456789...",
+        assertTranslations(TEST_STRING + ":\r\n" + TEST_STRING + ": 
undefined\r\n" + TEST_STRING + ": 012345678901234567890123456789...",
                            hasDataFilter.getStateDataFilter(filter),
                            "Datafilter.parameter",
                            "Datafilter.input",
@@ -105,7 +105,7 @@ public class HasDataFilterTest extends 
HasTranslationGeneralTest {
         String in = "                                                          
                ";
         filter.setInput(in);
 
-        assertTranslations(TEST_STRING + ":\r\n" + TEST_STRING + ": \r\n" + 
TEST_STRING + ": null",
+        assertTranslations(TEST_STRING + ":\r\n" + TEST_STRING + ": \r\n" + 
TEST_STRING + ": undefined",
                            hasDataFilter.getStateDataFilter(filter),
                            "Datafilter.parameter",
                            "Datafilter.input",
@@ -118,7 +118,7 @@ public class HasDataFilterTest extends 
HasTranslationGeneralTest {
         String out = " ";
         filter.setOutput(out);
 
-        assertTranslations(TEST_STRING + ":\r\n" + TEST_STRING + ": null\r\n" 
+ TEST_STRING + ": ",
+        assertTranslations(TEST_STRING + ":\r\n" + TEST_STRING + ": 
undefined\r\n" + TEST_STRING + ": ",
                            hasDataFilter.getStateDataFilter(filter),
                            "Datafilter.parameter",
                            "Datafilter.input",
diff --git 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/test/java/org/kie/workbench/common/stunner/sw/client/shapes/HasEventAndDataFilterTest.java
 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/test/java/org/kie/workbench/common/stunner/sw/client/shapes/HasEventAndDataFilterTest.java
index 28533abfd74..e133c887bee 100644
--- 
a/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/test/java/org/kie/workbench/common/stunner/sw/client/shapes/HasEventAndDataFilterTest.java
+++ 
b/packages/serverless-workflow-diagram-editor/sw-editor/sw-editor-client/src/test/java/org/kie/workbench/common/stunner/sw/client/shapes/HasEventAndDataFilterTest.java
@@ -6,15 +6,15 @@
  * to you 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. 
+ * under the License.
  */
 
 package org.kie.workbench.common.stunner.sw.client.shapes;
@@ -61,7 +61,7 @@ public class HasEventAndDataFilterTest extends 
HasTranslationGeneralTest {
         filterData.setUseData(false);
 
         assertTranslations(TEST_STRING + ":\r\n"
-                        + TEST_STRING + ": null\r\n"
+                        + TEST_STRING + ": undefined\r\n"
                         + TEST_STRING + ": " + TO_STATE_DATA + "\r\n"
                         + TEST_STRING + ": false",
                 hasEventAndDataFilter.getEventFilter(filterData),
@@ -79,7 +79,7 @@ public class HasEventAndDataFilterTest extends 
HasTranslationGeneralTest {
 
         assertTranslations(TEST_STRING + ":\r\n"
                         + TEST_STRING + ": " + DATA + "\r\n"
-                        + TEST_STRING + ": null\r\n"
+                        + TEST_STRING + ": undefined\r\n"
                         + TEST_STRING + ": true",
                 hasEventAndDataFilter.getEventFilter(filterData),
                 "Eventfilter.parameter",


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


Reply via email to