cancel
Showing results for 
Search instead for 
Did you mean: 

how to get drop down data from database in alfresco workflow

kranthi
Star Contributor
Star Contributor

how to get drop down data from database in alfresco workflow starting page.Like city name,country name anyone having idea how we will do in alfresco.

7 REPLIES 7

rohit9637
Star Contributor
Star Contributor

Are you talking about list constraint for your property of your workflow model? If not than please elaborate your question.

For the list constraint property in workflow model

Okay so you want the list constraint on your starting workflow page. Refer the tutorial of Jeff Potts on following link:

https://ecmarchitect.com/alfresco-developer-series-tutorials/workflow/tutorial/tutorial.html#step-1-...

And configure your workflow model to list constraint to your property. 

need to get those properties values from database to show in drop down.

jpotts
World-Class Innovator
World-Class Innovator

I am reluctant to populate list constraints in the data model from a database because if/when those records change, you will see constraint violations in your repository. However, if you want to do that, you can just write a custom list constraint class.

If the intent is that you want to have a dropdown that is populated from a database call, there are multiple ways to do that without requiring a custom list constraint.

For example, you could:

1. Write a custom form control and have the form control use an AJAX call to call an external (non-alfresco) service. The service will return the list of items for the dropdown. Where that service gets the list is up to you--it could be a database query.

OR

2. Write a custom form control that makes an AJAX call to a web script. That web script can query the database or some other external service for the dropdown items.

Either of these is probably better than writing a custom list constraint that makes a database call.

douglascrp
World-Class Innovator
World-Class Innovator

The following project can provide some good ideas, not using database as a source though:

GitHub - ITDSystems/alvex-masterdata