cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow custom form, dynamic select list

vincent_roye
Champ in-the-making
Champ in-the-making
Hi,

I have to create a custom form for my custom workflow. I need to add a select list that populates all the existing sites.
How can I do that ?
I guess it's going to be in :


/Applications/alfresco-4.2.e/tomcat/webapps/share/WEB-INF/classes/alfresco/share-workflow-form-config.xml


and then something like that :


     <field id="bpm:workflowPriority" label-id="workflow.field.priority"
      set="info">
      <control
       template="/org/alfresco/components/form/controls/workflow/priority.ftl" />
     </field>


And the template will be changed, is that right ?

Vincent
3 REPLIES 3

scouil
Star Contributor
Star Contributor
Hi,

There are several ways to do that.

The first, if you want to keep the property a string.
If so, just defining a custom constraint on this field for your model that fetches the existing sites and returns their name (or any string based on whatever you want) will do the deal.
The default template for lists will suit just fine.

The second, if you want it to be an association.
Then just use the default picker template and configure it so that it shows only your sites.

vincent_roye
Champ in-the-making
Champ in-the-making
Hi Scouil,

Thank you for your answer. In my custom workflow, I need to know that site was chosen by the workflow initiator. The candidate group will be all the users belonging to X group from this site. What solution should I use ?
Do you know how I could configure that in my custom workflow ?

scouil
Star Contributor
Star Contributor
Hi,

Hum that's an interesting one.
Long time I haven't played with workflows so I'm not sure the following is actually possible. That's what I'd look at though if I were you:
- keep the site as an association. Select it with the picker template configured so that it shows only sites (http://wiki.alfresco.com/wiki/Forms#association.ftl : A combination of startLocation and allowNavigationToContentChildren should do it)
- Add a listener that will kick in after your task but before the next
Here, in a small js, retrieve the site, grab your group and assign it as the group assignee.

It might be a bit tricky if activiti force the group assignee to be properly selected or something but I think it should work.