Modeler actionName

Where modeler use actionName ? How can I get actionName for Task ?

Hey,

please describe in detail what you want to achieve and what you already tried. If you can, share some code. This makes it easier for us to help you.

Thanks!

Hey,
I add to bpmn-moder.js line

$.getJSON(’/Process/GetListOfTask’, function (tasks) {
module.exports.TASK = tasks;
});

that I load custom list of task.
in the task configuration I add custom actionName

{
label: ‘My Task’,
actionName: ‘myId’,
className: ‘bpmn-icon-user’,
target: {
type: ‘bpmn:UserTask’
}
},
{
label: ‘My Task 2’,
actionName: ‘myId2’,
className: ‘bpmn-icon-smart’,
target: {
type: ‘bpmn:UserTask’
}
}

and now I add event lisnera

eventBus.on(‘element.click’, function (e) {

});

and I want get in function actionName defined in task configuration

regard
Grzegorz

You added a custom action name in ReplaceOptions.js. These are option which are valid for the replace menu. Please don’t mistake them with a task configuration. Take a look at ReplaceMenuProvider.js especially _createMenuEntry to see how the respective action gets called.

What exactly do you want to happen on a click on an element?

1 Like

I create my own property grid. In this property grid I create extensionElement. The configuration for this property grid depends on implementation’s attribute of user task. In the Context menu of user task I have list of implementation’s name.
Now when I click on element I want get sam unique value (in my case it can by actionName) to send to web application to generate property grid.

Thank you for help.
Base on your example I change user taks definition
I add

{
label: ‘My Task’,
actionName: ‘replace-with-user-task’,
className: ‘bpmn-icon-user’,
target: {
type: ‘bpmn:UserTask’
},
predefined{
implementation : ‘myImplementation’
}
}

and I change function replaceAction in _createMenuEntry to

var replaceAction = function () { var newElement = replaceElement(element, definition.target); $.each(definition.predefined, function (key, val) { newElement.businessObject[key] = val; }); return newElement; };

and now all custom attribute I have in businessObject.

best regards
Grzegorz

1 Like

I’m glad you could figure it out :+1: