-1

I am trying to customize my own BPMN editor using the kie-tools repository bu kiegroup. I am able edit and modify various features and UI. But in case of User Tasks, i am unable to populate the Actors and Group list as per my required logic.

Is there any way we can do that. Manually adding to the list is possible.

codeforHarman
  • 115
  • 1
  • 10

1 Answers1

1

depends on what are you trying to achieve.

The main Actors/Groups code model for User task is here:

And if you are looking to modify save/load it is on the marshaller parts:

It should be enough for start, but if you need something more specific, please provide more information what are you trying to achieve.

UPD: answer on the question below

If you need to add some predefined values, you just need to know some basics high level overview of Stunner forms:

  • model classes: like Actors or Groupid -> those are storing the state for a field
  • provider classes: populate the model
  • renderer classes: renders the model in some way in the html (eg: by using custom renderer)
  • And finally marshallers which process values to/from result bpmn file (not part of the forms)

For Actors and Groups there is a bit difference because they share the same Form element but the main idea is still the same. Forms code is located here. You can see widget package which actually a renderer and *SearchService which is provider. Finally AssigneeType inside of AssigneeEditorWidget used to distinguish actors from groups if needed.

search method of AssigneeLocalSearchService is called by the Form element on load and populating predefined values it should be what are you looking for. Just add values to this collection (don't forget about AssigneeType to distinguish actors from groups) and it should be it.

Let me know if you have any further questions, thank you!

  • If i have a list of users i want to show up as actor which is provided as json by an API, can i use the above to list them? – codeforHarman Sep 14 '22 at 10:45
  • Updated answer itself, since comments are limited in length. – Kirill Gaevskii Sep 14 '22 at 14:56
  • Thanks a lot Kirill . It helped me populate the value, but values added in the search method is just a plain string. How can i specify the AsigneeType there? Or should there be a logic in the Assignee widget to set the type too? – codeforHarman Sep 14 '22 at 17:43
  • In the AssigneeLocalSearchService class you have an instance of the editor and editor can tell you which one is active right now Actor or Group, so in the search method just add an if statement and that should be it. – Kirill Gaevskii Sep 14 '22 at 20:42
  • editor doesn't seems to have no information on the AssigneeType. Is there a method i can invoke to get this information? Or should i dig deeper into the View inside editor? – codeforHarman Sep 14 '22 at 21:10
  • 1
    you are right codeforHarman, looks like it's a bit broken after cutting the backend part out. But to fix it you actually need to fix `init` method in `AssigneeLiveSearchStandaloneService` it is called during initialization but not storing the `AssigneeType` anywhere. So you can just create local `AssigneeType` field in the class and assign it during this `init` method call, after that you can use it as you need. – Kirill Gaevskii Sep 15 '22 at 09:24