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

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


The following commit(s) were added to refs/heads/main by this push:
     new bf981935de [incubator-kie-issues#2043] Fix text annotation (#4008)
bf981935de is described below

commit bf981935de14c29aa2d2b53a407af1e516eacd86
Author: Alisha Mohamed Ali <[email protected]>
AuthorDate: Thu Aug 14 19:29:24 2025 +0530

    [incubator-kie-issues#2043] Fix text annotation (#4008)
    
    * DBACLD-186768:Fix: add BPMN TextAnnotation support
    
    * DBACLD-186768:Fix: add BPMN TextAnnotation support
    
    * DBACLD-186768:Fix: add BPMN TextAnnotation support
    
    * DBACLD-186768:Fix: add BPMN TextAnnotation support
    
    * added unit test for BPMN TextAnnotation support
    
    * added unit test for BPMN TextAnnotation support
    
    * added license headers
    
    ---------
    
    Co-authored-by: Alisha Mohamed Ali <[email protected]>
---
 .../java/org/jbpm/bpmn2/core/TextAnnotation.java   |  58 +++++++
 .../org/jbpm/bpmn2/xml/AbstractNodeHandler.java    |   2 +
 .../org/jbpm/bpmn2/xml/BPMNSemanticModule.java     |   1 +
 .../java/org/jbpm/bpmn2/xml/MetaDataHandler.java   |   4 +
 .../java/org/jbpm/bpmn2/xml/ProcessHandler.java    |  24 ++-
 .../java/org/jbpm/bpmn2/xml/SubProcessHandler.java |   8 +-
 .../org/jbpm/bpmn2/xml/TextAnnotationHandler.java  | 101 +++++++++++++
 .../main/java/org/jbpm/ruleflow/core/Metadata.java |   1 +
 .../textAnnotation/BPMN2-TaskTextAnnotation.bpmn2  | 167 +++++++++++++++++++++
 .../textAnnotation/BPMN2-TextAnnotation.bpmn2      | 119 +++++++++++++++
 .../textAnnotation/BPMN2-TimerTxtAnnotation.bpmn2  | 167 +++++++++++++++++++++
 .../java/org/jbpm/bpmn2/TextAnnotationTest.java    |  62 ++++++++
 12 files changed, 705 insertions(+), 9 deletions(-)

diff --git 
a/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/core/TextAnnotation.java 
b/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/core/TextAnnotation.java
new file mode 100644
index 0000000000..0dff86f2fc
--- /dev/null
+++ b/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/core/TextAnnotation.java
@@ -0,0 +1,58 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * 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.
+ */
+package org.jbpm.bpmn2.core;
+
+import java.io.Serializable;
+import java.util.HashMap;
+import java.util.Map;
+
+public class TextAnnotation implements Serializable {
+
+    private String id;
+    private String text;
+    private final Map<String, Object> metaData = new HashMap<>();
+
+    public String getId() {
+        return id;
+    }
+
+    public void setId(String id) {
+        this.id = id;
+    }
+
+    public String getText() {
+        return text;
+    }
+
+    public void setText(String text) {
+        this.text = text;
+    }
+
+    public void setMetaData(String name, Object value) {
+        this.metaData.put(name, value);
+    }
+
+    public Object getMetaData(String name) {
+        return this.metaData.get(name);
+    }
+
+    public Map<String, Object> getMetaData() {
+        return metaData;
+    }
+}
diff --git 
a/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/AbstractNodeHandler.java 
b/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/AbstractNodeHandler.java
index e0cea66062..7dd59a78d3 100755
--- a/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/AbstractNodeHandler.java
+++ b/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/AbstractNodeHandler.java
@@ -39,6 +39,7 @@ import org.jbpm.bpmn2.core.ItemDefinition;
 import org.jbpm.bpmn2.core.Lane;
 import org.jbpm.bpmn2.core.SequenceFlow;
 import org.jbpm.bpmn2.core.Signal;
+import org.jbpm.bpmn2.core.TextAnnotation;
 import org.jbpm.compiler.xml.Handler;
 import org.jbpm.compiler.xml.Parser;
 import org.jbpm.compiler.xml.ProcessBuildData;
@@ -123,6 +124,7 @@ public abstract class AbstractNodeHandler extends 
BaseAbstractHandler implements
         this.validPeers.add(SequenceFlow.class);
         this.validPeers.add(Lane.class);
         this.validPeers.add(Association.class);
+        this.validPeers.add(TextAnnotation.class);
     }
 
     @Override
diff --git 
a/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/BPMNSemanticModule.java 
b/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/BPMNSemanticModule.java
index 268a766083..fcadd6c81f 100755
--- a/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/BPMNSemanticModule.java
+++ b/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/BPMNSemanticModule.java
@@ -84,6 +84,7 @@ public class BPMNSemanticModule extends DefaultSemanticModule 
{
         addHandler("dataStore", new DataStoreHandler());
         addHandler("association", new AssociationHandler());
         addHandler("documentation", new DocumentationHandler());
+        addHandler("textAnnotation", new TextAnnotationHandler());
 
         // related to correlations
         addHandler("correlationProperty", new CorrelationPropertyHandler());
diff --git 
a/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/MetaDataHandler.java 
b/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/MetaDataHandler.java
index e1acc0603a..2ba81a968a 100755
--- a/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/MetaDataHandler.java
+++ b/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/MetaDataHandler.java
@@ -23,6 +23,7 @@ import java.util.Map;
 
 import org.jbpm.bpmn2.core.Lane;
 import org.jbpm.bpmn2.core.SequenceFlow;
+import org.jbpm.bpmn2.core.TextAnnotation;
 import org.jbpm.compiler.xml.Handler;
 import org.jbpm.compiler.xml.Parser;
 import org.jbpm.compiler.xml.core.BaseAbstractHandler;
@@ -46,6 +47,7 @@ public class MetaDataHandler extends BaseAbstractHandler
             this.validParents.add(Variable.class);
             this.validParents.add(SequenceFlow.class);
             this.validParents.add(Lane.class);
+            this.validParents.add(TextAnnotation.class);
 
             this.validPeers = new HashSet();
             this.validPeers.add(null);
@@ -105,6 +107,8 @@ public class MetaDataHandler extends BaseAbstractHandler
                 return ((SequenceFlow) parent).getMetaData();
             } else if (parent instanceof Lane) {
                 return ((Lane) parent).getMetaData();
+            } else if (parent instanceof TextAnnotation) {
+                return ((TextAnnotation) parent).getMetaData();
             } else {
                 throw new IllegalArgumentException("Unknown parent " + parent);
             }
diff --git 
a/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/ProcessHandler.java 
b/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/ProcessHandler.java
index 9bd9b04357..1dd36b21dd 100755
--- a/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/ProcessHandler.java
+++ b/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/ProcessHandler.java
@@ -45,6 +45,7 @@ import org.jbpm.bpmn2.core.Lane;
 import org.jbpm.bpmn2.core.Message;
 import org.jbpm.bpmn2.core.SequenceFlow;
 import org.jbpm.bpmn2.core.Signal;
+import org.jbpm.bpmn2.core.TextAnnotation;
 import org.jbpm.compiler.xml.Handler;
 import org.jbpm.compiler.xml.Parser;
 import org.jbpm.compiler.xml.ProcessBuildData;
@@ -107,6 +108,7 @@ import org.slf4j.LoggerFactory;
 import org.xml.sax.Attributes;
 import org.xml.sax.SAXException;
 
+import static org.jbpm.ruleflow.core.Metadata.TEXT_ANNOTATIONS;
 import static 
org.jbpm.workflow.instance.WorkflowProcessParameters.WORKFLOW_PARAM_MULTIPLE_CONNECTIONS;
 
 public class ProcessHandler extends BaseAbstractHandler implements Handler {
@@ -216,7 +218,7 @@ public class ProcessHandler extends BaseAbstractHandler 
implements Handler {
         // This must be done *after* linkConnections(process, connections)
         //  because it adds hidden connections for compensations
         List<Association> associations = (List<Association>) 
process.getMetaData(ASSOCIATIONS);
-        linkAssociations((Definitions) process.getMetaData("Definitions"), 
process, associations);
+        linkAssociations((Definitions) process.getMetaData("Definitions"), 
process, associations, parser);
 
         List<Lane> lanes = (List<Lane>) process.getMetaData(LaneHandler.LANES);
         assignLanes(process, lanes);
@@ -347,7 +349,7 @@ public class ProcessHandler extends BaseAbstractHandler 
implements Handler {
         }
     }
 
-    private static Object findNodeOrDataStoreByUniqueId(Definitions 
definitions, NodeContainer nodeContainer, final String nodeRef, String 
errorMsg) {
+    private static Object findNodeOrDataStoreByUniqueId(Definitions 
definitions, NodeContainer nodeContainer, final String nodeRef, String 
errorMsg, Parser parser) {
         if (definitions != null) {
             List<DataStore> dataStores = definitions.getDataStores();
             if (dataStores != null) {
@@ -358,6 +360,16 @@ public class ProcessHandler extends BaseAbstractHandler 
implements Handler {
                 }
             }
         }
+        Map<String, TextAnnotation> annotations =
+                (Map<String, TextAnnotation>) ((ProcessBuildData) 
parser.getData()).getMetaData(TEXT_ANNOTATIONS);
+
+        if (annotations != null) {
+            TextAnnotation ta = annotations.get(nodeRef);
+            if (ta != null) {
+                logger.debug("Skipping association to TextAnnotation '{}'", 
nodeRef);
+                return ta;
+            }
+        }
         return findNodeByIdOrUniqueIdInMetadata(nodeContainer, nodeRef, 
errorMsg);
     }
 
@@ -643,14 +655,14 @@ public class ProcessHandler extends BaseAbstractHandler 
implements Handler {
         }
     }
 
-    public static void linkAssociations(Definitions definitions, NodeContainer 
nodeContainer, List<Association> associations) {
+    public static void linkAssociations(Definitions definitions, NodeContainer 
nodeContainer, List<Association> associations, Parser parser) {
         if (associations != null) {
             for (Association association : associations) {
                 String sourceRef = association.getSourceRef();
                 Object source = null;
                 try {
                     source = findNodeOrDataStoreByUniqueId(definitions, 
nodeContainer, sourceRef,
-                            "Could not find source [" + sourceRef + "] for 
association " + association.getId() + "]");
+                            "Could not find source [" + sourceRef + "] for 
association " + association.getId() + "]", parser);
                 } catch (IllegalArgumentException e) {
                     // source not found
                 }
@@ -658,12 +670,14 @@ public class ProcessHandler extends BaseAbstractHandler 
implements Handler {
                 Object target = null;
                 try {
                     target = findNodeOrDataStoreByUniqueId(definitions, 
nodeContainer, targetRef,
-                            "Could not find target [" + targetRef + "] for 
association [" + association.getId() + "]");
+                            "Could not find target [" + targetRef + "] for 
association [" + association.getId() + "]", parser);
                 } catch (IllegalArgumentException e) {
                     // target not found
                 }
                 if (source == null || target == null) {
                     // TODO: ignoring this association for now
+                } else if (target instanceof TextAnnotation) {
+                    //Skipping associations to TextAnnotation
                 } else if (target instanceof DataStore || source instanceof 
DataStore) {
                     // TODO: ignoring data store associations for now
                 } else if (source instanceof EventNode) {
diff --git 
a/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/SubProcessHandler.java 
b/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/SubProcessHandler.java
index 4dd14dcb48..23900ec6a1 100755
--- a/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/SubProcessHandler.java
+++ b/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/SubProcessHandler.java
@@ -92,20 +92,20 @@ public class SubProcessHandler extends AbstractNodeHandler {
             // This must be done *after* linkConnections(process, connections)
             //  because it adds hidden connections for compensations
             List<Association> associations = (List<Association>) 
forEachNode.getMetaData(ProcessHandler.ASSOCIATIONS);
-            ProcessHandler.linkAssociations((Definitions) 
forEachNode.getMetaData("Definitions"), forEachNode, associations);
+            ProcessHandler.linkAssociations((Definitions) 
forEachNode.getMetaData("Definitions"), forEachNode, associations, parser);
             applyAsync(node, Boolean.parseBoolean((String) 
compositeNode.getMetaData().get("customAsync")));
             outcome = forEachNode;
             nodeContainer.addNode(outcome);
         } else {
             nodeContainer.addNode(outcome);
             RuleFlowProcess process = (RuleFlowProcess) ((ProcessBuildData) 
parser.getData()).getMetaData(ProcessHandler.CURRENT_PROCESS);
-            handleCompositeContextNode(process, compositeNode);
+            handleCompositeContextNode(process, compositeNode, parser);
         }
 
         return outcome;
     }
 
-    protected void handleCompositeContextNode(RuleFlowProcess process, 
CompositeContextNode compositeNode) throws SAXException {
+    protected void handleCompositeContextNode(RuleFlowProcess process, 
CompositeContextNode compositeNode, Parser parser) throws SAXException {
         List<SequenceFlow> connections = (List<SequenceFlow>) 
compositeNode.getMetaData(ProcessHandler.CONNECTIONS);
 
         List<IntermediateLink> throwLinks = (List<IntermediateLink>) 
compositeNode.getMetaData(ProcessHandler.LINKS);
@@ -117,7 +117,7 @@ public class SubProcessHandler extends AbstractNodeHandler {
         // This must be done *after* linkConnections(process, connections)
         //  because it adds hidden connections for compensations
         List<Association> associations = (List<Association>) 
compositeNode.getMetaData(ProcessHandler.ASSOCIATIONS);
-        ProcessHandler.linkAssociations((Definitions) 
compositeNode.getMetaData("Definitions"), compositeNode, associations);
+        ProcessHandler.linkAssociations((Definitions) 
compositeNode.getMetaData("Definitions"), compositeNode, associations, parser);
 
     }
 
diff --git 
a/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/TextAnnotationHandler.java 
b/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/TextAnnotationHandler.java
new file mode 100644
index 0000000000..f38e516e5c
--- /dev/null
+++ 
b/jbpm/jbpm-bpmn2/src/main/java/org/jbpm/bpmn2/xml/TextAnnotationHandler.java
@@ -0,0 +1,101 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * 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.
+ */
+package org.jbpm.bpmn2.xml;
+
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+
+import org.jbpm.bpmn2.core.*;
+import org.jbpm.bpmn2.core.Error;
+import org.jbpm.compiler.xml.Handler;
+import org.jbpm.compiler.xml.Parser;
+import org.jbpm.compiler.xml.ProcessBuildData;
+import org.jbpm.process.core.ContextContainer;
+import org.jbpm.ruleflow.core.RuleFlowProcess;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+
+import static org.jbpm.ruleflow.core.Metadata.TEXT_ANNOTATIONS;
+import static org.w3c.dom.Node.ELEMENT_NODE;
+
+public class TextAnnotationHandler extends 
org.jbpm.compiler.xml.core.BaseAbstractHandler implements Handler {
+
+    public TextAnnotationHandler() {
+        if (this.validParents == null && this.validPeers == null) {
+            this.validParents = new HashSet<>();
+            this.validParents.add(ContextContainer.class);
+            this.validParents.add(Definitions.class);
+            this.validPeers = new HashSet<>();
+            this.validPeers.add(null);
+            this.validPeers.add(ItemDefinition.class);
+            this.validPeers.add(Message.class);
+            this.validPeers.add(Interface.class);
+            this.validPeers.add(Escalation.class);
+            this.validPeers.add(Error.class);
+            this.validPeers.add(Signal.class);
+            this.validPeers.add(DataStore.class);
+            this.validPeers.add(RuleFlowProcess.class);
+            this.validPeers.add(SequenceFlow.class);
+            this.validPeers.add(TextAnnotation.class);
+            this.allowNesting = false;
+        }
+    }
+
+    @Override
+    public Object start(String uri, String localName, Attributes attrs, Parser 
parser) throws SAXException {
+        parser.startElementBuilder(localName, attrs);
+        String id = attrs.getValue("id");
+        TextAnnotation annotation = new TextAnnotation();
+        annotation.setId(id);
+        Map<String, TextAnnotation> annotations =
+                (Map<String, TextAnnotation>) ((ProcessBuildData) 
parser.getData()).getMetaData(TEXT_ANNOTATIONS);
+
+        if (annotations == null) {
+            annotations = new HashMap<>();
+            ((ProcessBuildData) 
parser.getData()).setMetaData(TEXT_ANNOTATIONS, annotations);
+        }
+        annotations.put(id, annotation);
+        if (parser.getParent() instanceof RuleFlowProcess) {
+            RuleFlowProcess proc = (RuleFlowProcess) parser.getParent();
+            if (proc.getMetaData(TEXT_ANNOTATIONS) == null) {
+                proc.setMetaData(TEXT_ANNOTATIONS, annotations);
+            }
+        }
+
+        return annotation;
+    }
+
+    @Override
+    public Object end(String uri, String localName, Parser parser) throws 
SAXException {
+        Element el = parser.endElementBuilder();
+        TextAnnotation ta = (TextAnnotation) parser.getCurrent();
+        for (Node n = el.getFirstChild(); n != null; n = n.getNextSibling())
+            if (n.getNodeType() == ELEMENT_NODE && 
("text".equals(n.getNodeName()) || n.getNodeName().endsWith(":text")))
+                ta.setText(n.getTextContent());
+        return ta;
+    }
+
+    @Override
+    public Class<?> generateNodeFor() {
+        return TextAnnotation.class;
+    }
+}
diff --git a/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/Metadata.java 
b/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/Metadata.java
index b552fd128b..6d313b26bb 100644
--- a/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/Metadata.java
+++ b/jbpm/jbpm-flow/src/main/java/org/jbpm/ruleflow/core/Metadata.java
@@ -85,6 +85,7 @@ public class Metadata {
     public static final String CONSTANTS = "Constants";
     public static final String EVAL_VARIABLE = "evalVariable";
     public static final String PROCESS_DURATION = "processDuration";
+    public static final String TEXT_ANNOTATIONS = "TextAnnotations";
 
     private Metadata() {
     }
diff --git 
a/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/textAnnotation/BPMN2-TaskTextAnnotation.bpmn2
 
b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/textAnnotation/BPMN2-TaskTextAnnotation.bpmn2
new file mode 100644
index 0000000000..4cf0dc8041
--- /dev/null
+++ 
b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/textAnnotation/BPMN2-TaskTextAnnotation.bpmn2
@@ -0,0 +1,167 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ 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.
+  -->
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL"; 
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"; 
xmlns:bpsim="http://www.bpsim.org/schemas/1.0"; 
xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"; 
xmlns:di="http://www.omg.org/spec/DD/20100524/DI"; 
xmlns:drools="http://www.jboss.org/drools"; id="_wHkSsFlwED6AfZlw4f8P0w" 
xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd 
http://www. [...]
+  <bpmn2:itemDefinition 
id="__8D2FF548-9539-4AA1-A606-2E193031D883_SkippableInputXItem" 
structureRef="Object"/>
+  <bpmn2:itemDefinition 
id="__8D2FF548-9539-4AA1-A606-2E193031D883_PriorityInputXItem" 
structureRef="Object"/>
+  <bpmn2:itemDefinition 
id="__8D2FF548-9539-4AA1-A606-2E193031D883_CommentInputXItem" 
structureRef="Object"/>
+  <bpmn2:itemDefinition 
id="__8D2FF548-9539-4AA1-A606-2E193031D883_DescriptionInputXItem" 
structureRef="Object"/>
+  <bpmn2:itemDefinition 
id="__8D2FF548-9539-4AA1-A606-2E193031D883_CreatedByInputXItem" 
structureRef="Object"/>
+  <bpmn2:itemDefinition 
id="__8D2FF548-9539-4AA1-A606-2E193031D883_TaskNameInputXItem" 
structureRef="Object"/>
+  <bpmn2:itemDefinition 
id="__8D2FF548-9539-4AA1-A606-2E193031D883_GroupIdInputXItem" 
structureRef="Object"/>
+  <bpmn2:itemDefinition 
id="__8D2FF548-9539-4AA1-A606-2E193031D883_ContentInputXItem" 
structureRef="Object"/>
+  <bpmn2:itemDefinition 
id="__8D2FF548-9539-4AA1-A606-2E193031D883_NotStartedReassignInputXItem" 
structureRef="Object"/>
+  <bpmn2:itemDefinition 
id="__8D2FF548-9539-4AA1-A606-2E193031D883_NotCompletedReassignInputXItem" 
structureRef="Object"/>
+  <bpmn2:itemDefinition 
id="__8D2FF548-9539-4AA1-A606-2E193031D883_NotStartedNotifyInputXItem" 
structureRef="Object"/>
+  <bpmn2:itemDefinition 
id="__8D2FF548-9539-4AA1-A606-2E193031D883_NotCompletedNotifyInputXItem" 
structureRef="Object"/>
+  <bpmn2:collaboration id="_65173F1A-3B9C-495F-9A25-0479AD282E80" 
name="Default Collaboration">
+    <bpmn2:participant id="_3280A513-9043-40FC-A498-8905A053EBB4" name="Pool 
Participant" processRef="BPMN2_TaskTextAnnotation"/>
+  </bpmn2:collaboration>
+  <bpmn2:process id="BPMN2_TaskTextAnnotation" 
drools:packageName="org.jbpm.bpmn2.textAnnotation" drools:version="1.0" 
drools:adHoc="false" name="BPMN2-TaskTextAnnotation" isExecutable="true" 
processType="Public">
+    <bpmn2:sequenceFlow id="_A8CB4531-351A-4CBC-A857-21E89ED5D28B" 
sourceRef="_8D2FF548-9539-4AA1-A606-2E193031D883" 
targetRef="_C3448B44-A957-48A4-974D-0BC05089D349"/>
+    <bpmn2:sequenceFlow id="_94D1B812-1A44-42AC-857B-1E4A62F93C76" 
sourceRef="_4F31591F-65EA-483D-9650-6554D618A376" 
targetRef="_8D2FF548-9539-4AA1-A606-2E193031D883"/>
+    <bpmn2:sequenceFlow id="_8F0923FD-31D9-4999-89DE-6CFD72CD4AF6" 
sourceRef="_CD6BB8A6-F436-4735-9B81-42AF7208D3F1" 
targetRef="_4F31591F-65EA-483D-9650-6554D618A376"/>
+    <bpmn2:textAnnotation id="_FA4976C8-B3A2-4735-9EAE-C1D8EC834C13" 
name="TaskTextAnnotation">
+      <bpmn2:extensionElements>
+        <drools:metaData name="elementname">
+          <drools:metaValue><![CDATA[TaskTextAnnotation]]></drools:metaValue>
+        </drools:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:text>TaskTextAnnotation</bpmn2:text>
+    </bpmn2:textAnnotation>
+    <bpmn2:endEvent id="_C3448B44-A957-48A4-974D-0BC05089D349">
+      <bpmn2:incoming>_A8CB4531-351A-4CBC-A857-21E89ED5D28B</bpmn2:incoming>
+    </bpmn2:endEvent>
+    <bpmn2:userTask id="_8D2FF548-9539-4AA1-A606-2E193031D883" name="Task">
+      <bpmn2:extensionElements>
+        <drools:metaData name="elementname">
+          <drools:metaValue><![CDATA[Task]]></drools:metaValue>
+        </drools:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>_94D1B812-1A44-42AC-857B-1E4A62F93C76</bpmn2:incoming>
+      <bpmn2:outgoing>_A8CB4531-351A-4CBC-A857-21E89ED5D28B</bpmn2:outgoing>
+      <bpmn2:ioSpecification>
+        <bpmn2:dataInput 
id="_8D2FF548-9539-4AA1-A606-2E193031D883_TaskNameInputX" drools:dtype="Object" 
itemSubjectRef="__8D2FF548-9539-4AA1-A606-2E193031D883_TaskNameInputXItem" 
name="TaskName"/>
+        <bpmn2:dataInput 
id="_8D2FF548-9539-4AA1-A606-2E193031D883_SkippableInputX" 
drools:dtype="Object" 
itemSubjectRef="__8D2FF548-9539-4AA1-A606-2E193031D883_SkippableInputXItem" 
name="Skippable"/>
+        <bpmn2:inputSet>
+          
<bpmn2:dataInputRefs>_8D2FF548-9539-4AA1-A606-2E193031D883_TaskNameInputX</bpmn2:dataInputRefs>
+          
<bpmn2:dataInputRefs>_8D2FF548-9539-4AA1-A606-2E193031D883_SkippableInputX</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation>
+        
<bpmn2:targetRef>_8D2FF548-9539-4AA1-A606-2E193031D883_TaskNameInputX</bpmn2:targetRef>
+        <bpmn2:assignment>
+          <bpmn2:from 
xsi:type="bpmn2:tFormalExpression"><![CDATA[Task]]></bpmn2:from>
+          <bpmn2:to 
xsi:type="bpmn2:tFormalExpression"><![CDATA[_8D2FF548-9539-4AA1-A606-2E193031D883_TaskNameInputX]]></bpmn2:to>
+        </bpmn2:assignment>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:dataInputAssociation>
+        
<bpmn2:targetRef>_8D2FF548-9539-4AA1-A606-2E193031D883_SkippableInputX</bpmn2:targetRef>
+        <bpmn2:assignment>
+          <bpmn2:from 
xsi:type="bpmn2:tFormalExpression"><![CDATA[false]]></bpmn2:from>
+          <bpmn2:to 
xsi:type="bpmn2:tFormalExpression"><![CDATA[_8D2FF548-9539-4AA1-A606-2E193031D883_SkippableInputX]]></bpmn2:to>
+        </bpmn2:assignment>
+      </bpmn2:dataInputAssociation>
+    </bpmn2:userTask>
+    <bpmn2:intermediateCatchEvent id="_4F31591F-65EA-483D-9650-6554D618A376">
+      <bpmn2:incoming>_8F0923FD-31D9-4999-89DE-6CFD72CD4AF6</bpmn2:incoming>
+      <bpmn2:outgoing>_94D1B812-1A44-42AC-857B-1E4A62F93C76</bpmn2:outgoing>
+      <bpmn2:timerEventDefinition>
+        <bpmn2:timeDuration 
xsi:type="bpmn2:tFormalExpression">PT1S</bpmn2:timeDuration>
+      </bpmn2:timerEventDefinition>
+    </bpmn2:intermediateCatchEvent>
+    <bpmn2:startEvent id="_CD6BB8A6-F436-4735-9B81-42AF7208D3F1">
+      <bpmn2:outgoing>_8F0923FD-31D9-4999-89DE-6CFD72CD4AF6</bpmn2:outgoing>
+    </bpmn2:startEvent>
+    <bpmn2:association id="_12C9AE55-7AAF-4569-B850-4AB6A507B81F" 
sourceRef="_8D2FF548-9539-4AA1-A606-2E193031D883" 
targetRef="_FA4976C8-B3A2-4735-9EAE-C1D8EC834C13"/>
+  </bpmn2:process>
+  <bpmndi:BPMNDiagram>
+    <bpmndi:BPMNPlane bpmnElement="BPMN2_TaskTextAnnotation">
+      <bpmndi:BPMNShape id="shape__CD6BB8A6-F436-4735-9B81-42AF7208D3F1" 
bpmnElement="_CD6BB8A6-F436-4735-9B81-42AF7208D3F1">
+        <dc:Bounds height="56" width="56" x="299" y="149"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="shape__4F31591F-65EA-483D-9650-6554D618A376" 
bpmnElement="_4F31591F-65EA-483D-9650-6554D618A376">
+        <dc:Bounds height="56" width="56" x="435" y="149"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="shape__8D2FF548-9539-4AA1-A606-2E193031D883" 
bpmnElement="_8D2FF548-9539-4AA1-A606-2E193031D883">
+        <dc:Bounds height="102" width="154" x="571" y="126"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="shape__C3448B44-A957-48A4-974D-0BC05089D349" 
bpmnElement="_C3448B44-A957-48A4-974D-0BC05089D349">
+        <dc:Bounds height="56" width="56" x="805" y="149"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="shape__FA4976C8-B3A2-4735-9EAE-C1D8EC834C13" 
bpmnElement="_FA4976C8-B3A2-4735-9EAE-C1D8EC834C13">
+        <dc:Bounds height="60" width="100" x="805" y="245"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge 
id="edge_shape__CD6BB8A6-F436-4735-9B81-42AF7208D3F1_to_shape__4F31591F-65EA-483D-9650-6554D618A376"
 bpmnElement="_8F0923FD-31D9-4999-89DE-6CFD72CD4AF6">
+        <di:waypoint x="327" y="177"/>
+        <di:waypoint x="463" y="177"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge 
id="edge_shape__4F31591F-65EA-483D-9650-6554D618A376_to_shape__8D2FF548-9539-4AA1-A606-2E193031D883"
 bpmnElement="_94D1B812-1A44-42AC-857B-1E4A62F93C76">
+        <di:waypoint x="463" y="177"/>
+        <di:waypoint x="648" y="177"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge 
id="edge_shape__8D2FF548-9539-4AA1-A606-2E193031D883_to_shape__C3448B44-A957-48A4-974D-0BC05089D349"
 bpmnElement="_A8CB4531-351A-4CBC-A857-21E89ED5D28B">
+        <di:waypoint x="648" y="177"/>
+        <di:waypoint x="833" y="177"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge 
id="edge_shape__8D2FF548-9539-4AA1-A606-2E193031D883_to_shape__FA4976C8-B3A2-4735-9EAE-C1D8EC834C13"
 bpmnElement="_12C9AE55-7AAF-4569-B850-4AB6A507B81F">
+        <di:waypoint x="648" y="177"/>
+        <di:waypoint x="855" y="275"/>
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+  <bpmn2:relationship type="BPSimData">
+    <bpmn2:extensionElements>
+      <bpsim:BPSimData>
+        <bpsim:Scenario id="default" name="Simulationscenario">
+          <bpsim:ScenarioParameters/>
+          <bpsim:ElementParameters 
elementRef="_CD6BB8A6-F436-4735-9B81-42AF7208D3F1">
+            <bpsim:TimeParameters>
+              <bpsim:ProcessingTime>
+                <bpsim:NormalDistribution mean="0" standardDeviation="0"/>
+              </bpsim:ProcessingTime>
+            </bpsim:TimeParameters>
+          </bpsim:ElementParameters>
+          <bpsim:ElementParameters 
elementRef="_8D2FF548-9539-4AA1-A606-2E193031D883">
+            <bpsim:TimeParameters>
+              <bpsim:ProcessingTime>
+                <bpsim:NormalDistribution mean="0" standardDeviation="0"/>
+              </bpsim:ProcessingTime>
+            </bpsim:TimeParameters>
+            <bpsim:ResourceParameters>
+              <bpsim:Availability>
+                <bpsim:FloatingParameter value="0"/>
+              </bpsim:Availability>
+              <bpsim:Quantity>
+                <bpsim:FloatingParameter value="0"/>
+              </bpsim:Quantity>
+            </bpsim:ResourceParameters>
+            <bpsim:CostParameters>
+              <bpsim:UnitCost>
+                <bpsim:FloatingParameter value="0"/>
+              </bpsim:UnitCost>
+            </bpsim:CostParameters>
+          </bpsim:ElementParameters>
+        </bpsim:Scenario>
+      </bpsim:BPSimData>
+    </bpmn2:extensionElements>
+    <bpmn2:source>_wHkSsFlwED6AfZlw4f8P0w</bpmn2:source>
+    <bpmn2:target>_wHkSsFlwED6AfZlw4f8P0w</bpmn2:target>
+  </bpmn2:relationship>
+</bpmn2:definitions>
\ No newline at end of file
diff --git 
a/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/textAnnotation/BPMN2-TextAnnotation.bpmn2
 
b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/textAnnotation/BPMN2-TextAnnotation.bpmn2
new file mode 100644
index 0000000000..fc931df30a
--- /dev/null
+++ 
b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/textAnnotation/BPMN2-TextAnnotation.bpmn2
@@ -0,0 +1,119 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ 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.
+  -->
+<bpmn2:definitions xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL"; 
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"; 
xmlns:bpsim="http://www.bpsim.org/schemas/1.0"; 
xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"; 
xmlns:di="http://www.omg.org/spec/DD/20100524/DI"; 
xmlns:drools="http://www.jboss.org/drools"; xmlns:xsi="xsi" 
id="_BNwcAFZaED6wj4tos3pzQw" 
xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd 
http://www.jboss.org/drools drools.xsd http://www [...]
+  <bpmn2:collaboration id="_8C5EDF17-F3D7-4220-AFDD-F78C633F816A" 
name="Default Collaboration">
+    <bpmn2:participant id="_2EB14553-0EB8-4A63-A696-C56FDDAF2407" name="Pool 
Participant" processRef="BPMN2_TextAnnotation"/>
+  </bpmn2:collaboration>
+  <bpmn2:process id="BPMN2_TextAnnotation" 
drools:packageName="org.jbpm.bpmn2.textAnnotation" drools:version="1.0" 
drools:adHoc="false" name="BPMN2-TextAnnotation" isExecutable="true" 
processType="Public">
+    <bpmn2:sequenceFlow id="_73C4A37D-925A-4DDE-A816-B6A5AD0C6602" 
sourceRef="_76078D73-1B27-4F12-8D56-C78862302D22" 
targetRef="_65B23EA1-1901-4B2D-BA26-827FD5E98DC3"/>
+    <bpmn2:sequenceFlow id="_0FC2C90D-469D-4936-8BB8-AC336237AC42" 
sourceRef="_0167D692-7EFE-4093-8DEB-20A6D758DBEA" 
targetRef="_76078D73-1B27-4F12-8D56-C78862302D22"/>
+    <bpmn2:textAnnotation id="note" name="textNote">
+      <bpmn2:extensionElements>
+        <drools:metaData name="elementname">
+          <drools:metaValue><![CDATA[textNote]]></drools:metaValue>
+        </drools:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:text>textNote</bpmn2:text>
+    </bpmn2:textAnnotation>
+    <bpmn2:endEvent id="_65B23EA1-1901-4B2D-BA26-827FD5E98DC3">
+      <bpmn2:incoming>_73C4A37D-925A-4DDE-A816-B6A5AD0C6602</bpmn2:incoming>
+    </bpmn2:endEvent>
+    <bpmn2:scriptTask id="_76078D73-1B27-4F12-8D56-C78862302D22" 
name="HelloWorld" scriptFormat="http://www.java.com/java";>
+      <bpmn2:extensionElements>
+        <drools:metaData name="elementname">
+          <drools:metaValue><![CDATA[HelloWorld]]></drools:metaValue>
+        </drools:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>_0FC2C90D-469D-4936-8BB8-AC336237AC42</bpmn2:incoming>
+      <bpmn2:outgoing>_73C4A37D-925A-4DDE-A816-B6A5AD0C6602</bpmn2:outgoing>
+      <bpmn2:script>System.out.println("Hello World!");</bpmn2:script>
+    </bpmn2:scriptTask>
+    <bpmn2:startEvent id="_0167D692-7EFE-4093-8DEB-20A6D758DBEA">
+      <bpmn2:outgoing>_0FC2C90D-469D-4936-8BB8-AC336237AC42</bpmn2:outgoing>
+    </bpmn2:startEvent>
+    <bpmn2:association id="_5C1404AA-0582-4460-B9D8-C28F12FE0542" 
sourceRef="_76078D73-1B27-4F12-8D56-C78862302D22" targetRef="note"/>
+  </bpmn2:process>
+  <bpmndi:BPMNDiagram>
+    <bpmndi:BPMNPlane bpmnElement="BPMN2_TextAnnotation">
+      <bpmndi:BPMNShape id="shape__0167D692-7EFE-4093-8DEB-20A6D758DBEA" 
bpmnElement="_0167D692-7EFE-4093-8DEB-20A6D758DBEA">
+        <dc:Bounds height="56" width="56" x="268" y="94"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="shape__76078D73-1B27-4F12-8D56-C78862302D22" 
bpmnElement="_76078D73-1B27-4F12-8D56-C78862302D22">
+        <dc:Bounds height="102" width="154" x="404" y="71"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="shape__65B23EA1-1901-4B2D-BA26-827FD5E98DC3" 
bpmnElement="_65B23EA1-1901-4B2D-BA26-827FD5E98DC3">
+        <dc:Bounds height="56" width="56" x="638" y="94"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="shape_note" bpmnElement="note">
+        <dc:Bounds height="60" width="100" x="638" y="190"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge 
id="edge_shape__0167D692-7EFE-4093-8DEB-20A6D758DBEA_to_shape__76078D73-1B27-4F12-8D56-C78862302D22"
 bpmnElement="_0FC2C90D-469D-4936-8BB8-AC336237AC42">
+        <di:waypoint x="296" y="122"/>
+        <di:waypoint x="481" y="122"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge 
id="edge_shape__76078D73-1B27-4F12-8D56-C78862302D22_to_shape__65B23EA1-1901-4B2D-BA26-827FD5E98DC3"
 bpmnElement="_73C4A37D-925A-4DDE-A816-B6A5AD0C6602">
+        <di:waypoint x="481" y="122"/>
+        <di:waypoint x="666" y="122"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge 
id="edge_shape__76078D73-1B27-4F12-8D56-C78862302D22_to_shape_note" 
bpmnElement="_5C1404AA-0582-4460-B9D8-C28F12FE0542">
+        <di:waypoint x="481" y="122"/>
+        <di:waypoint x="688" y="220"/>
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+  <bpmn2:relationship type="BPSimData">
+    <bpmn2:extensionElements>
+      <bpsim:BPSimData>
+        <bpsim:Scenario id="default" name="Simulationscenario">
+          <bpsim:ScenarioParameters/>
+          <bpsim:ElementParameters 
elementRef="_0167D692-7EFE-4093-8DEB-20A6D758DBEA">
+            <bpsim:TimeParameters>
+              <bpsim:ProcessingTime>
+                <bpsim:NormalDistribution mean="0" standardDeviation="0"/>
+              </bpsim:ProcessingTime>
+            </bpsim:TimeParameters>
+          </bpsim:ElementParameters>
+          <bpsim:ElementParameters 
elementRef="_76078D73-1B27-4F12-8D56-C78862302D22">
+            <bpsim:TimeParameters>
+              <bpsim:ProcessingTime>
+                <bpsim:NormalDistribution mean="0" standardDeviation="0"/>
+              </bpsim:ProcessingTime>
+            </bpsim:TimeParameters>
+            <bpsim:ResourceParameters>
+              <bpsim:Availability>
+                <bpsim:FloatingParameter value="0"/>
+              </bpsim:Availability>
+              <bpsim:Quantity>
+                <bpsim:FloatingParameter value="0"/>
+              </bpsim:Quantity>
+            </bpsim:ResourceParameters>
+            <bpsim:CostParameters>
+              <bpsim:UnitCost>
+                <bpsim:FloatingParameter value="0"/>
+              </bpsim:UnitCost>
+            </bpsim:CostParameters>
+          </bpsim:ElementParameters>
+        </bpsim:Scenario>
+      </bpsim:BPSimData>
+    </bpmn2:extensionElements>
+    <bpmn2:source>_BNwcAFZaED6wj4tos3pzQw</bpmn2:source>
+    <bpmn2:target>_BNwcAFZaED6wj4tos3pzQw</bpmn2:target>
+  </bpmn2:relationship>
+</bpmn2:definitions>
\ No newline at end of file
diff --git 
a/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/textAnnotation/BPMN2-TimerTxtAnnotation.bpmn2
 
b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/textAnnotation/BPMN2-TimerTxtAnnotation.bpmn2
new file mode 100644
index 0000000000..c19f413078
--- /dev/null
+++ 
b/jbpm/jbpm-tests/src/test/bpmn/org/jbpm/bpmn2/textAnnotation/BPMN2-TimerTxtAnnotation.bpmn2
@@ -0,0 +1,167 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ Licensed to the Apache Software Foundation (ASF) under one
+  ~ or more contributor license agreements.  See the NOTICE file
+  ~ distributed with this work for additional information
+  ~ regarding copyright ownership.  The ASF licenses this file
+  ~ 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.
+  -->
+<bpmn2:definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:bpmn2="http://www.omg.org/spec/BPMN/20100524/MODEL"; 
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"; 
xmlns:bpsim="http://www.bpsim.org/schemas/1.0"; 
xmlns:dc="http://www.omg.org/spec/DD/20100524/DC"; 
xmlns:di="http://www.omg.org/spec/DD/20100524/DI"; 
xmlns:drools="http://www.jboss.org/drools"; id="_GJ-hkFZeED6WJfVt0RhRng" 
xsi:schemaLocation="http://www.omg.org/spec/BPMN/20100524/MODEL BPMN20.xsd 
http://www. [...]
+  <bpmn2:itemDefinition 
id="__61BF4E8D-A92C-432E-983A-58DFD54F129A_SkippableInputXItem" 
structureRef="Object"/>
+  <bpmn2:itemDefinition 
id="__61BF4E8D-A92C-432E-983A-58DFD54F129A_PriorityInputXItem" 
structureRef="Object"/>
+  <bpmn2:itemDefinition 
id="__61BF4E8D-A92C-432E-983A-58DFD54F129A_CommentInputXItem" 
structureRef="Object"/>
+  <bpmn2:itemDefinition 
id="__61BF4E8D-A92C-432E-983A-58DFD54F129A_DescriptionInputXItem" 
structureRef="Object"/>
+  <bpmn2:itemDefinition 
id="__61BF4E8D-A92C-432E-983A-58DFD54F129A_CreatedByInputXItem" 
structureRef="Object"/>
+  <bpmn2:itemDefinition 
id="__61BF4E8D-A92C-432E-983A-58DFD54F129A_TaskNameInputXItem" 
structureRef="Object"/>
+  <bpmn2:itemDefinition 
id="__61BF4E8D-A92C-432E-983A-58DFD54F129A_GroupIdInputXItem" 
structureRef="Object"/>
+  <bpmn2:itemDefinition 
id="__61BF4E8D-A92C-432E-983A-58DFD54F129A_ContentInputXItem" 
structureRef="Object"/>
+  <bpmn2:itemDefinition 
id="__61BF4E8D-A92C-432E-983A-58DFD54F129A_NotStartedReassignInputXItem" 
structureRef="Object"/>
+  <bpmn2:itemDefinition 
id="__61BF4E8D-A92C-432E-983A-58DFD54F129A_NotCompletedReassignInputXItem" 
structureRef="Object"/>
+  <bpmn2:itemDefinition 
id="__61BF4E8D-A92C-432E-983A-58DFD54F129A_NotStartedNotifyInputXItem" 
structureRef="Object"/>
+  <bpmn2:itemDefinition 
id="__61BF4E8D-A92C-432E-983A-58DFD54F129A_NotCompletedNotifyInputXItem" 
structureRef="Object"/>
+  <bpmn2:collaboration id="_3533F2DA-3F9F-4D81-8195-8D5344F3D70F" 
name="Default Collaboration">
+    <bpmn2:participant id="_5EF6D66A-7A31-4EEF-B4AF-82C43F418B9A" name="Pool 
Participant" processRef="BPMN2_TimerTxtAnnotation"/>
+  </bpmn2:collaboration>
+  <bpmn2:process id="BPMN2_TimerTxtAnnotation" 
drools:packageName="org.jbpm.bpmn2.textAnnotation" drools:version="1.0" 
drools:adHoc="false" name="BPMN2-TimerTxtAnnotation" isExecutable="true" 
processType="Public">
+    <bpmn2:sequenceFlow id="_2C5ACABF-2867-4AE0-B1C8-1F73EB25407D" 
sourceRef="_61BF4E8D-A92C-432E-983A-58DFD54F129A" 
targetRef="_59CC6D75-4D0B-4793-9C28-3885A83FB255"/>
+    <bpmn2:sequenceFlow id="_50A4A059-B037-44B4-A280-AA32D013190F" 
sourceRef="_9FF85A82-BD79-4433-8199-0959D0989DA3" 
targetRef="_61BF4E8D-A92C-432E-983A-58DFD54F129A"/>
+    <bpmn2:sequenceFlow id="_03D1297F-F41E-421D-8ADE-3EC2D97F98D5" 
sourceRef="_1A7B3F17-1176-43CC-A562-D291F6101940" 
targetRef="_9FF85A82-BD79-4433-8199-0959D0989DA3"/>
+    <bpmn2:textAnnotation id="timerTextAnnotation" name="TimerText">
+      <bpmn2:extensionElements>
+        <drools:metaData name="elementname">
+          <drools:metaValue><![CDATA[TimerText]]></drools:metaValue>
+        </drools:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:text>TimerText</bpmn2:text>
+    </bpmn2:textAnnotation>
+    <bpmn2:endEvent id="_59CC6D75-4D0B-4793-9C28-3885A83FB255">
+      <bpmn2:incoming>_2C5ACABF-2867-4AE0-B1C8-1F73EB25407D</bpmn2:incoming>
+    </bpmn2:endEvent>
+    <bpmn2:userTask id="_61BF4E8D-A92C-432E-983A-58DFD54F129A" name="Task">
+      <bpmn2:extensionElements>
+        <drools:metaData name="elementname">
+          <drools:metaValue><![CDATA[Task]]></drools:metaValue>
+        </drools:metaData>
+      </bpmn2:extensionElements>
+      <bpmn2:incoming>_50A4A059-B037-44B4-A280-AA32D013190F</bpmn2:incoming>
+      <bpmn2:outgoing>_2C5ACABF-2867-4AE0-B1C8-1F73EB25407D</bpmn2:outgoing>
+      <bpmn2:ioSpecification>
+        <bpmn2:dataInput 
id="_61BF4E8D-A92C-432E-983A-58DFD54F129A_TaskNameInputX" drools:dtype="Object" 
itemSubjectRef="__61BF4E8D-A92C-432E-983A-58DFD54F129A_TaskNameInputXItem" 
name="TaskName"/>
+        <bpmn2:dataInput 
id="_61BF4E8D-A92C-432E-983A-58DFD54F129A_SkippableInputX" 
drools:dtype="Object" 
itemSubjectRef="__61BF4E8D-A92C-432E-983A-58DFD54F129A_SkippableInputXItem" 
name="Skippable"/>
+        <bpmn2:inputSet>
+          
<bpmn2:dataInputRefs>_61BF4E8D-A92C-432E-983A-58DFD54F129A_TaskNameInputX</bpmn2:dataInputRefs>
+          
<bpmn2:dataInputRefs>_61BF4E8D-A92C-432E-983A-58DFD54F129A_SkippableInputX</bpmn2:dataInputRefs>
+        </bpmn2:inputSet>
+      </bpmn2:ioSpecification>
+      <bpmn2:dataInputAssociation>
+        
<bpmn2:targetRef>_61BF4E8D-A92C-432E-983A-58DFD54F129A_TaskNameInputX</bpmn2:targetRef>
+        <bpmn2:assignment>
+          <bpmn2:from 
xsi:type="bpmn2:tFormalExpression"><![CDATA[Task]]></bpmn2:from>
+          <bpmn2:to 
xsi:type="bpmn2:tFormalExpression"><![CDATA[_61BF4E8D-A92C-432E-983A-58DFD54F129A_TaskNameInputX]]></bpmn2:to>
+        </bpmn2:assignment>
+      </bpmn2:dataInputAssociation>
+      <bpmn2:dataInputAssociation>
+        
<bpmn2:targetRef>_61BF4E8D-A92C-432E-983A-58DFD54F129A_SkippableInputX</bpmn2:targetRef>
+        <bpmn2:assignment>
+          <bpmn2:from 
xsi:type="bpmn2:tFormalExpression"><![CDATA[false]]></bpmn2:from>
+          <bpmn2:to 
xsi:type="bpmn2:tFormalExpression"><![CDATA[_61BF4E8D-A92C-432E-983A-58DFD54F129A_SkippableInputX]]></bpmn2:to>
+        </bpmn2:assignment>
+      </bpmn2:dataInputAssociation>
+    </bpmn2:userTask>
+    <bpmn2:intermediateCatchEvent id="_9FF85A82-BD79-4433-8199-0959D0989DA3">
+      <bpmn2:incoming>_03D1297F-F41E-421D-8ADE-3EC2D97F98D5</bpmn2:incoming>
+      <bpmn2:outgoing>_50A4A059-B037-44B4-A280-AA32D013190F</bpmn2:outgoing>
+      <bpmn2:timerEventDefinition>
+        <bpmn2:timeDuration 
xsi:type="bpmn2:tFormalExpression">PT1M</bpmn2:timeDuration>
+      </bpmn2:timerEventDefinition>
+    </bpmn2:intermediateCatchEvent>
+    <bpmn2:startEvent id="_1A7B3F17-1176-43CC-A562-D291F6101940">
+      <bpmn2:outgoing>_03D1297F-F41E-421D-8ADE-3EC2D97F98D5</bpmn2:outgoing>
+    </bpmn2:startEvent>
+    <bpmn2:association id="_D6D24F48-CF58-4A15-93B2-C7F716256400" 
sourceRef="_9FF85A82-BD79-4433-8199-0959D0989DA3" 
targetRef="timerTextAnnotation"/>
+  </bpmn2:process>
+  <bpmndi:BPMNDiagram>
+    <bpmndi:BPMNPlane bpmnElement="BPMN2_TimerTxtAnnotation">
+      <bpmndi:BPMNShape id="shape__1A7B3F17-1176-43CC-A562-D291F6101940" 
bpmnElement="_1A7B3F17-1176-43CC-A562-D291F6101940">
+        <dc:Bounds height="56" width="56" x="334" y="144"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="shape__9FF85A82-BD79-4433-8199-0959D0989DA3" 
bpmnElement="_9FF85A82-BD79-4433-8199-0959D0989DA3">
+        <dc:Bounds height="56" width="56" x="470" y="144"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="shape__61BF4E8D-A92C-432E-983A-58DFD54F129A" 
bpmnElement="_61BF4E8D-A92C-432E-983A-58DFD54F129A">
+        <dc:Bounds height="102" width="154" x="606" y="121"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="shape__59CC6D75-4D0B-4793-9C28-3885A83FB255" 
bpmnElement="_59CC6D75-4D0B-4793-9C28-3885A83FB255">
+        <dc:Bounds height="56" width="56" x="840" y="144"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNShape id="shape_timerTextAnnotation" 
bpmnElement="timerTextAnnotation">
+        <dc:Bounds height="60" width="100" x="606" y="263"/>
+      </bpmndi:BPMNShape>
+      <bpmndi:BPMNEdge 
id="edge_shape__1A7B3F17-1176-43CC-A562-D291F6101940_to_shape__9FF85A82-BD79-4433-8199-0959D0989DA3"
 bpmnElement="_03D1297F-F41E-421D-8ADE-3EC2D97F98D5">
+        <di:waypoint x="362" y="172"/>
+        <di:waypoint x="498" y="172"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge 
id="edge_shape__9FF85A82-BD79-4433-8199-0959D0989DA3_to_shape__61BF4E8D-A92C-432E-983A-58DFD54F129A"
 bpmnElement="_50A4A059-B037-44B4-A280-AA32D013190F">
+        <di:waypoint x="498" y="172"/>
+        <di:waypoint x="683" y="172"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge 
id="edge_shape__9FF85A82-BD79-4433-8199-0959D0989DA3_to_shape_timerTextAnnotation"
 bpmnElement="_D6D24F48-CF58-4A15-93B2-C7F716256400">
+        <di:waypoint x="498" y="172"/>
+        <di:waypoint x="656" y="293"/>
+      </bpmndi:BPMNEdge>
+      <bpmndi:BPMNEdge 
id="edge_shape__61BF4E8D-A92C-432E-983A-58DFD54F129A_to_shape__59CC6D75-4D0B-4793-9C28-3885A83FB255"
 bpmnElement="_2C5ACABF-2867-4AE0-B1C8-1F73EB25407D">
+        <di:waypoint x="683" y="172"/>
+        <di:waypoint x="868" y="172"/>
+      </bpmndi:BPMNEdge>
+    </bpmndi:BPMNPlane>
+  </bpmndi:BPMNDiagram>
+  <bpmn2:relationship type="BPSimData">
+    <bpmn2:extensionElements>
+      <bpsim:BPSimData>
+        <bpsim:Scenario id="default" name="Simulationscenario">
+          <bpsim:ScenarioParameters/>
+          <bpsim:ElementParameters 
elementRef="_1A7B3F17-1176-43CC-A562-D291F6101940">
+            <bpsim:TimeParameters>
+              <bpsim:ProcessingTime>
+                <bpsim:NormalDistribution mean="0" standardDeviation="0"/>
+              </bpsim:ProcessingTime>
+            </bpsim:TimeParameters>
+          </bpsim:ElementParameters>
+          <bpsim:ElementParameters 
elementRef="_61BF4E8D-A92C-432E-983A-58DFD54F129A">
+            <bpsim:TimeParameters>
+              <bpsim:ProcessingTime>
+                <bpsim:NormalDistribution mean="0" standardDeviation="0"/>
+              </bpsim:ProcessingTime>
+            </bpsim:TimeParameters>
+            <bpsim:ResourceParameters>
+              <bpsim:Availability>
+                <bpsim:FloatingParameter value="0"/>
+              </bpsim:Availability>
+              <bpsim:Quantity>
+                <bpsim:FloatingParameter value="0"/>
+              </bpsim:Quantity>
+            </bpsim:ResourceParameters>
+            <bpsim:CostParameters>
+              <bpsim:UnitCost>
+                <bpsim:FloatingParameter value="0"/>
+              </bpsim:UnitCost>
+            </bpsim:CostParameters>
+          </bpsim:ElementParameters>
+        </bpsim:Scenario>
+      </bpsim:BPSimData>
+    </bpmn2:extensionElements>
+    <bpmn2:source>_GJ-hkFZeED6WJfVt0RhRng</bpmn2:source>
+    <bpmn2:target>_GJ-hkFZeED6WJfVt0RhRng</bpmn2:target>
+  </bpmn2:relationship>
+</bpmn2:definitions>
\ No newline at end of file
diff --git 
a/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/TextAnnotationTest.java 
b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/TextAnnotationTest.java
new file mode 100644
index 0000000000..0722ff6fbd
--- /dev/null
+++ b/jbpm/jbpm-tests/src/test/java/org/jbpm/bpmn2/TextAnnotationTest.java
@@ -0,0 +1,62 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * 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.
+ */
+package org.jbpm.bpmn2;
+
+import org.jbpm.bpmn2.textAnnotation.*;
+import org.jbpm.test.utils.ProcessTestHelper;
+import org.junit.jupiter.api.Test;
+import org.kie.kogito.Application;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class TextAnnotationTest extends JbpmBpmn2TestCase {
+    @Test
+    public void testTextAnnotationProcess() {
+        Application app = ProcessTestHelper.newApplication();
+
+        org.kie.kogito.process.Process<BPMN2_TextAnnotationModel> 
minimalProcess = BPMN2_TextAnnotationProcess.newProcess(app);
+        BPMN2_TextAnnotationModel model = minimalProcess.createModel();
+        org.kie.kogito.process.ProcessInstance<BPMN2_TextAnnotationModel> 
instance = minimalProcess.createInstance(model);
+        instance.start();
+        
assertThat(instance.status()).isEqualTo(org.kie.kogito.process.ProcessInstance.STATE_COMPLETED);
+    }
+
+    @Test
+    public void testTextAnnotationProcessForTimers() {
+        Application app = ProcessTestHelper.newApplication();
+
+        org.kie.kogito.process.Process<BPMN2_TimerTxtAnnotationModel> 
minimalProcess = BPMN2_TimerTxtAnnotationProcess.newProcess(app);
+        BPMN2_TimerTxtAnnotationModel model = minimalProcess.createModel();
+        org.kie.kogito.process.ProcessInstance<BPMN2_TimerTxtAnnotationModel> 
instance = minimalProcess.createInstance(model);
+        instance.start();
+        
assertThat(instance.status()).isEqualTo(org.kie.kogito.process.ProcessInstance.STATE_ACTIVE);
+    }
+
+    @Test
+    public void testTextAnnotationProcessForTasks() {
+        Application app = ProcessTestHelper.newApplication();
+
+        org.kie.kogito.process.Process<BPMN2_TaskTextAnnotationModel> 
minimalProcess = BPMN2_TaskTextAnnotationProcess.newProcess(app);
+        BPMN2_TaskTextAnnotationModel model = minimalProcess.createModel();
+        org.kie.kogito.process.ProcessInstance<BPMN2_TaskTextAnnotationModel> 
instance = minimalProcess.createInstance(model);
+        instance.start();
+        
assertThat(instance.status()).isEqualTo(org.kie.kogito.process.ProcessInstance.STATE_ACTIVE);
+    }
+
+}


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

Reply via email to