cancel
Showing results for 
Search instead for 
Did you mean: 

Customizing the Activiti Modeler

mark1970
Champ in-the-making
Champ in-the-making
Hi all,
I'm trying to customize the Activiti modeler by inserting some custom properties in the nodes. For example, I'm trying to add the activiti:class property to a ServiceTask.

I've successuflly added the property in the bpmn2.0.json file and now it's displayed in the palette, however the property is not added when I generate the bpmn20.xml file.

I can see that the editor's properties are mentioned in the Semantic.xsd file, however adding it also there produces no effect.

Please could you help me how to add the property also in the generated XML file ?

Thanks a lot
Mark
29 REPLIES 29

mark1970
Champ in-the-making
Champ in-the-making
No idea ? Smiley Sad
Do you have any clue where could I find some help ?(unfortunately I could not find any oryx designer forum). We are interested to try Activiti but we would need to produce a demo for a customer of us with at least a minimal customization of the editor…….
Mark

jbarrez
Star Contributor
Star Contributor
There are only a few people who have worked with the Modeler codebase. The issue you want to solve is something we currently are also looking into, but not yet found an adequate solution. So any input on your findings could help us bring exactly thing like the 'activiti:class' in the Modeler, in a next release!

dryabkov
Champ in-the-making
Champ in-the-making
I have an idea. Use Json representation stored in singnavio.xml

I change manually for experiment file editor/stencilsets/bpmn2.0/bpmn2.0.json on deployed modeler, so no patch file provided yet. Search this lines

                        "name" : "task",
                        "properties" : [   
and add new properties "activiti:type","activiti:assignee" and "activiti:field" to task shape.
[size=50]
{                                                                                                                                                                   
        "id":"activiti:type",                                                                                                                                       
        "type":"Choice",                                                                                                                                            
        "title":"Activiti:type",                                                                                                                                    
        "readonly":false,                                                                                                                                           
        "optional":true,                                                                                                                                            
        "refToView":"",                                                                                                                                             
        "value":"None",                                                                                                                                             
        "description":"",                                                                                                                                           
        "items":[                                                                                                                                                   
{id:"none",title:"None",value:"None"},                                                                                                              
{id:"email",title:"Email",value:"mail"}                                                                                                             
]                                                                                                                                                   
},                                                                                                                                                                  
{                                                                                                                                                                   
        "id":"activiti:assignee",                                                                                                                                   
        "type":"String",                                                                                                                                            
        "title":"Activiti:assignee",                                                                                                                                
        "readonly":false,                                                                                                                                           
        "optional":true,                                                                                                                                            
        "refToView":"",                                                                                                                                             
        "value":""                                                                                                                                                  
},                                                          
{                                                                                                                                                                   
        "id":"activiti:field",                                                                                                                                      
        "type":"Complex",                                                                                                                                           
        "title":"Activiti:field",                                                                                                                                   
        "value":"",                                                                                                                                                 
        "readonly":false,                                                                                                                                           
        "optional":true,                                                                                                                                            
        "complexItems":[                                                                                                                                            
{                                                                                                                                                   
         "id":"name",                                                                                                                                
         "name":"Name",                                                                                                                              
         "type":"Choice",                                                                                                                            
         "optional":false,                                                                                                                           
         value:"to",                                                                                                                                 
         "width":100,                                                                                                                                
         items: [                                                                                                                                    
  {                                                                                                                                   
          id:"c1",                                                                                                                    
          title:"to",                                                                                                                 
          value:"to",                                                                                                                 
          "refToView":""                                                                                                              
  },                                                                                                                                  
  {                                                                                                                                   
          id:"c2",                                                                                                                    
          title:"subject",                                                                                                            
          value:"subject",                                                                                                            
          "refToView":""                                                                                                              
  },                                                                                                                                  
  {                                                                                                                                   
          id:"c3",                                                                                                                    
          title:"text",                                                                                                               
          value:"text",                                                                                                               
          "refToView":""                                                                                                              
  }                                                                                                                                   
  ]                                                                                                                                   
},  
{                                                                                                                                                   
         "id":"expression",                                                                                                                          
         "name":"Expression",                                                                                                                        
         "type":"String",                                                                                                                            
         "optional":false,                                                                                                                           
         value:"",                                                                                                                                   
         "width":400,                                                                                                                                
}                                                                                                                                                   
]                                                                                                                                                   
},  
[/size]
So, new properties stored in <json-representation> in file .signavio.xml
Then build jar from attached sources (depends on activiti-cycle.jar and signavio-core-components.jar).

And my ant task

   <target name="models.convert">                                                                               
        <java classname="com.taximaxim.bpm.bpmn.Converter">                                                                
            <classpath>                                                                                
                <path path="${target.jars.dir}/bpmn.jar" />                                                            
            </classpath>                                                                                
            <classpath refid="buildtime.classpath" />                                                                 
            <arg value="${work.dir}/proc-tmp/OneNotice.signavio.xml" />                                                        
            <arg value="resources/proc/one_notice/OneNotice.bpmn20.xml" />                                                       
            <arg value="OneNotice"/>                                                                          
        </java>                                                                                      
    </target>

dryabkov
Champ in-the-making
Champ in-the-making
I want to extend method mentioned before, because activiti-cycle and using his "developer friendly xml" are really pain…

al_lv
Champ in-the-making
Champ in-the-making
So, new properties stored in <json-representation> in file .signavio.xml

Where is this file .signavio.xml? I cann't find it.

I also work on the customising  of Activit-Modeller.
Do you have maybe more exaples like this? It is very helpfull!
I would appreciate any advice.

Thanks

Best regards

Alexej

dryabkov
Champ in-the-making
Champ in-the-making
Where is this file .signavio.xml? I cann't find it.

Modeler saves diagram into two files, <Diagram title>.bpmn20.xml and <Diagram title>.signavio.xml

I'll publish soon my experiment on github, about 2-3 days.

dryabkov
Champ in-the-making
Champ in-the-making
Current problem:

My changes in editor /data/stencilsets/extensions/bpmn2.0activiti/bpmn2.0activiti.json are invisible. If I place the same in editor/data/stencilsets/bpmn2.0/bpmn2.0.json they work.

al_lv
Champ in-the-making
Champ in-the-making
@ dryabkov:
great work!

I am abel now to add new properties to tasks. But after convert there are elements that activiti cannt read:

ns6:type=
<ns8:serviceTask
<ns8:extensionElements>

Do you know how can I define an activiti namespace or delete this "ns8:" by serviceTask and extensionElements?

Thanks a lot!

Alexej

dryabkov
Champ in-the-making
Champ in-the-making
My files contain "ns8:", "ns6:" etc but with correct "xmlns:ns8=…" at parent or grandparents.  I use ant to deploy them successfully.
May be classes used for serialization should force namespace with @XmlRootElement(name="formProperty",namespace="http://activiti.org/bpmn")

See http://dryabkov.github.com/activiti-modeler-experiment/

Start point is /activiti/build.xml:

run >ant war tomcat-start
open http://localhost:8080/signaviocore/
save diagram
stop tomcat with ctrl+c
run >ant package convert
see target/models

PS: It does not work in google chrome