How to get the Text object from modeler?

Hi,

I want to use the Text object to create hyperlinks in task elements by overriding createText method.
I tried modeler.get('text') but its not working.

Simply require the utility in your code, i.e. require('diagram-js/.../Text'). Note that this it is internal though and could change at any time :wink:.

Actually I am using webjar for bpmn-js. So I don’t have any directory called ‘diagram-js’.

But while debugging from browser I see the below structure.

So I tried require('webjars/bpmn-js/0.12.0/node_modules/diagram-js/lib/util/Text') but its not working.

Webjars are limited in terms of what you can do with them. Not being able to require bundle internals is one of the limitations.

Will it work if use bpmn-modeler.js (downloaded using bower) instead of webjar?

Nope, require('some/local/file') works in node-style projects only.