BPMN addTextAnnotation

Hi - I can see how to add a TextAnnotation at  run time with something such as:

this.selectedItem.diagram.addTextAnnotation(
{
id: node.id + "ta",
text: info.rs_id_array.toString(),
length: annotation_length,
angle: annotation_angle,
}, node)

this.selectedItem.diagram.dataBind();


but how do I update the text or remove the TextAnnotation programatically? This is something very important...I have tried all sorts of things with no luck.



11 Replies

VG Vivisa Ganesan Syncfusion Team December 7, 2023 01:39 PM UTC

Hi,

To update the text annotation double click and edit the annotation. To remove it,we will validate and update you with more details on December 11, 2023


Regards,

Vivisa



KA Kabe December 7, 2023 02:18 PM UTC

Hi!

Actually I know you can double click to edit but in my application the text is set by the user using a properties panel.

It is extremely important that the annotation can be updated and/or removed through code.


Please help!




SJ Sivaranjith Jeyabalan Syncfusion Team December 8, 2023 10:16 AM UTC

Hi Kabe,

We can update the text annotation content dynamically, by using the updateTextAnnotationContent method, we need to pass the parent node and existing text annotation details along with the updated content in method parameters. Please find the sample below for reference.

Sample: Gvrdjb (forked) - StackBlitz

Regards,

Sivaranjith



KA Kabe December 8, 2023 02:36 PM UTC

That's amazing! Great!

So now I just need to know how to remove the TextAnnotation.


K



VG Vivisa Ganesan Syncfusion Team December 11, 2023 07:22 AM UTC

Hi,

Could you please confirm whether you intend to remove the annotation of the node or the entire text annotation node itself?


Regards,

Vivisa



KA Kabe December 11, 2023 02:02 PM UTC

The entire text annotation itself.

Actually I'm not 100% clear on what the difference of the two options is, but I want to remove the TextAnnotation and connector completely. Hope that makes sense.

Image_5573_1702303224255



VG Vivisa Ganesan Syncfusion Team December 12, 2023 01:13 PM UTC

Hi,

Currently we don't have support to remove the text annotation node. We will validate and update you with more details on December 14,2023.


Regards,

Vivisa



VG Vivisa Ganesan Syncfusion Team December 14, 2023 01:10 PM UTC

Hi,

Sorry for the inconvenience


Reported Issue: Removing bpmn text annotation dynamically is not working properly.

 

We can reproduce the issue and confirmed this as a defect. We have logged a defect report for this issue. We will fix this issue and provide the patch on Jan 2,2024 weekly patch release.

 

Feedback Link: https://www.syncfusion.com/feedback/49271/removing-bpmn-text-annotation-dynamically-is-not-working-properly

Disclaimer: Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.

 

 

Regards,

Vivisa



KA Kabe December 14, 2023 02:44 PM UTC

ok great - I'm very glad to hear there is a solution coming!





SJ Sivaranjith Jeyabalan Syncfusion Team January 2, 2024 01:20 PM UTC

Hi Kabe,

We have fixed the issue and provided custom package below. However, we will include the fix for the issue in our upcoming weekly release which is scheduled to release on January 09th, 2024.


Regards,

Sivaranjith


Attachment: package_85b05f81.zip


MG Moulidharan Gopalakrishnan Syncfusion Team January 10, 2024 11:34 AM UTC

Hi  Kabe,


We have fixed the reported issue and included it in our latest patch release which is rolled out successfully.

Please upgrade to the latest version (v24.1.45) packages of the diagram to resolve this issue.      

https://www.npmjs.com/package/@syncfusion/ej2-diagrams


Regards,

Moulidharan


Loader.
Up arrow icon