cancel
Showing results for 
Search instead for 
Did you mean: 

Activiti webapp modeler - stencliset complexItems

elvan121
Champ in-the-making
Champ in-the-making
Hello community!
I'm working on a customized version of the Activiti webapp explorer & modeler for the enterprise where i'm working in.
I have to say that i'm much more skilled in c# than java, but i wanted to take this challenge anyway (i'm the unique developer).

One of the requestes and one of the problems which i'm facing with right now is the following one:
I was asked to extend the properties of the modeler, in order to add some custom fields to the taks which will be generated from third datasources. Theese infos are the resources related to the activities like Human resources, hardware resources, etc…

I've solved it quite easily through the stencilset (new property, type choice, list of items), but the problems came up as i began to use the complexItems. It's a really simple but an annoying problem.
Defined a property composed by complex type with a nested complexitems and a nested list of items. Each item contain  and id, title, value, and an empty refToView.
The problem is the following: from the Complex Type property window, the listbox containg the item's list, show only the value instead of the title. Considering that i'd like to generate the item's list starting from external datasources this is a pain in the ass!!!!


Can somebody give me a hint?

the following property inside the stencliset generate a listbox containg for example :
- "S-1-5-21-114626252-81015560-903097961-1088"
- "_CLW2"
- "_CLW3"
<blockcode>
{
         "name" : "hwRes",
         "properties" : [{
               "id" : "hwRes",
               "type" : "Complex",
               "title" : "Risorse Hardware",
               "value" : "",
               "description" : "Risorse hardware assegnate all attivita",
               "popular" : true,
               "complexItems" : [{
                     "id" : "HwRes_item",
                     "name" : "Elemento di risorsa hardware",
                     "name_de" : "",
                     "type" : "Choice",
                     "value" : "",
                     "width" : 150,
                     "optional" : false,
                     "items" : [
                        {
                           "id": "c1",
                           "title": "BCR",
                           "value" : "S-1-5-21-114626252-81015560-903097961-1088",
                           "refToView": ""
                        }, {
                           "id" : "c2",
                           "title" : "clw2",
                           "value" : "_CLW2",
                           "refToView" : ""
                        }, {
                           "id" : "c3",
                           "title" : "clw3",
                           "value" : "_CLW3",
                           "refToView" : ""
                        }
                     ]
                  }, {
                     "id" : "hwRes_priority",
                     "name" : "Priorita risorsa hardware",
                     "name_de" : "",
                     "type" : "Choice",
                     "description" : "Priorita della risorsa hardware associata all'elemento.",
                     "description_de" : "",
                     "value" : "",
                     "width" : 150,
                     "optional" : false,
                     "items" : [{
                           "id" : "c1",
                           "title" : "Primary",
                           "value" : "_primary_",
                           "refToView" : ""
                        }, {
                           "id" : "c2",
                           "title" : "Backup",
                           "value" : "_backup_",
                           "refToView" : ""
                        }, {
                           "id" : "c3",
                           "title" : "Other",
                           "value" : "_other_",
                           "refToView" : ""
                        }
                     ]                     
                  }
               ]
            }
         ]
      },
</blockcode>



Best Regards,

Elvan
4 REPLIES 4

elvan121
Champ in-the-making
Champ in-the-making
Hello there,
how could I gain the attention of somebody?

Best regards
Elvan

frederikherema1
Star Contributor
Star Contributor
If you need the lists populated from external sources you either need to make the stencilset dynamic - generated on the server every time a new diagram is opened, merging in possible values from te external source in the JSON you return.
Another approach is bit harder (if you need fresh data every time you want to have the user select a value): you need to add a property-handeler to the oryx javascript, to handle rendering a custom editor for those properties. You can open up a custom ExtJS popup and do http-call from there. Again, this is not trivial and requires you to dive deep into the Oryx JS…

elvan121
Champ in-the-making
Champ in-the-making
Hello Frederik,
Thanks for the response.
Actually, my problem is not to about getting a stencilsets populated with data from other sources, but is related in getting the values in the property window and setting them properly in the process.
In short terms is a problem which is present into the modeler and not yet resolved.
The case for reproduce the problem are as following:

Case 1:
If I add a new simple custom property, it works properly. The property window inside the modeler show the title and assign the value.
<blockcode>
{
"name":"swRes",
"properties": [
{
  "id":"swRes",
  "type":"Choice",
  "title":"Software resources ID",
  "title_de":"",
  "description":"Software resources IDs needed to accomplish the task",
  "description_de":"",
  "value":"",
  "optional":true,
  "items" : [ { "id": "1", "value": "1", "title": "SW1" }, { "id": "2", "value": "2", "title": "SW2" }, { "id": "3", "value": "3", "title": "SW3" }]
}
]
}
</blockcode>

Case 2:
If I add a new complex custom property composed by complexItems and Items (as shown in the first post), the modeler show inside the value instead of the title and save the diagram at the end without problem. This problem is reproducible using  the property called "Assignments" which is related to the User Task. I based my custom complex property on this property actually (named usertaskassignment)


I have deeply dived into extjs and oryx and found out these lines which are repeated in several part of the code
<blockcode>
var optionTmpl = new Ext.Template('<option value="{value}">{value}</option>');
   items.each(function(value){
optionTmpl.append(select, {value:value.value()});
  });
</blockcode>

I've changed to
<blockcode>
var optionTmpl = new Ext.Template('<option value="{value}">{title}</option>');
   items.each(function(value){
optionTmpl.append(select, {value:value.value(), title:value.title()});
  });
</blockcode>

Made those changes the modeler manage the titles and values, showing correctly the titles. At the time of saving the modeler return error.

Where else should i look to?

Best Regards and thanks

Elvan

frederikherema1
Star Contributor
Star Contributor
What is the exact issue you're getting (stack trace/ JS-error)?
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.