How to add content to Field extension (Class Field) stencilset

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Member II

How to add content to Field extension (Class Field) stencilset

Jump to solution

Hello,

Trying to work out how to add key/value pair properties to the stencilset.json for 'Class Fields'.

Basically, so that when a user drags a ServiceTask into the canvas, the Class Fields form is prepopulated with some values from the stencilset json

[This is the form with 'Name' 'Implementation' on the left; with String value, String and Expression textfields on the right]

I've tried just about every combintation of json I can think of, and I can't get it to pre-populate the form.

This is the area of the stencilset.json I'm tryng to prepopulate:

{
    "name" : "search_servicetaskfieldspackage",
    "properties" : [ {
      "id" : "servicetaskfields",
      "type" : "Complex",
      "title" : "Class  fields",
      "value" : "",  
      "complexItems" : [ {  
        "id" : "servicetask_field_name",  
        "name" : "Name",  
        "type" : "String",  
        "value" : "can I get some values into this",  
        "width" : 200,  
        "optional" : false  
      }, {  
        "id" : "servicetask_field_value",  
        "name" : "String value",  
        "type" : "String",  
        "value" : "",  
        "width" : 200,  
        "optional" : false  
      }, {  
        "id" : "servicetask_field_expression",  
        "name" : "Expression",  
        "type" : "String",  
        "value" : "",  
        "width" : 200,  
        "optional" : false  
      } ],
      "description" : "Search parameters",
      "popular" : true
    } ]
  }

Maybe I need to add some special key names?

Any help on how to do this would much appreciated!

Many thanks

1 Solution

Accepted Solutions
Highlighted
Alfresco Employee

Re: How to add content to Field extension (Class Field) stencilset

Jump to solution

Hi midiman _,

This is how it worked for me.

{

    "name" : "servicetaskfieldspackage",

    "properties" : [ {

      "id" : "servicetaskfields",

      "type" : "Complex",

      "title" : "BPMN-EDITOR.PROPERTY.SERVICETASK-FIELDS.TITLE",

      "value" : {"fields":[{"name":"fieldName","implementation":"nana","stringValue":"nana","expression":"","string":""}]},

      "description" : "BPMN-EDITOR.PROPERTY.SERVICETASK-FIELDS.DESCRIPTION",

      "popular" : true

    } ]

  }

Hope that helps.

View solution in original post

4 Replies
Highlighted
Member II

Re: How to add content to Field extension (Class Field) stencilset

Jump to solution

Anyone? If anyone has an idea how to do this, any help is much appreciated! Thanks

Highlighted
Member II

Re: How to add content to Field extension (Class Field) stencilset

Jump to solution

bump.

Wow, maybe i'm the only one whose tried to add content to class fields?

Is there anyone out there that could help me please??

Thanks

Highlighted
Alfresco Employee

Re: How to add content to Field extension (Class Field) stencilset

Jump to solution

Hi midiman _,

This is how it worked for me.

{

    "name" : "servicetaskfieldspackage",

    "properties" : [ {

      "id" : "servicetaskfields",

      "type" : "Complex",

      "title" : "BPMN-EDITOR.PROPERTY.SERVICETASK-FIELDS.TITLE",

      "value" : {"fields":[{"name":"fieldName","implementation":"nana","stringValue":"nana","expression":"","string":""}]},

      "description" : "BPMN-EDITOR.PROPERTY.SERVICETASK-FIELDS.DESCRIPTION",

      "popular" : true

    } ]

  }

Hope that helps.

View solution in original post

Highlighted
Member II

Re: How to add content to Field extension (Class Field) stencilset

Jump to solution

Hi @balsarori

You are a star! Works a treat. Thank you so much for helping me out!!

Peter (alias @00155837364765867)