07-20-2017 07:32 AM
Hello Experts,
How do I change default value of required approve percent on workflow in my Alfresco env(5.2 CE)?
I want to set it 1 in workflow creation form.
Regards,
Koichi.
07-20-2017 09:34 AM
Hi,
You can change the value of required approve percent by overriding 'percentage-approve.ftl' file, which is located at <ALFRESCO-HOME>\tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\form\controls\ in community edition.
You will find the following code in the file.
(function()
{
new Alfresco.PercentageApprove("${fieldHtmlId}").setOptions(
{
currentValue: <#if field.value?exists>${field.value}<#else>50</#if>,
minValue: <#if field.control.params.minValue?exists>${field.control.params.minValue}<#else>1</#if>,
maxValue: <#if field.control.params.maxValue?exists>${field.control.params.maxValue}<#else>100</#if>
}).setMessages(
${messages}
);
})();
Here, the 'currentValue' is given '50'. You can change it as per your requirement.
NOTE: It is bad practice to make changes in existing files of alfresco. You can override the existing functionality by creating appropriate folder structure within 'shared' folder.
Please let me know if you have any further query.
Thanks,
Kalpesh
07-20-2017 09:34 AM
Hi,
You can change the value of required approve percent by overriding 'percentage-approve.ftl' file, which is located at <ALFRESCO-HOME>\tomcat\webapps\share\WEB-INF\classes\alfresco\site-webscripts\org\alfresco\components\form\controls\ in community edition.
You will find the following code in the file.
(function()
{
new Alfresco.PercentageApprove("${fieldHtmlId}").setOptions(
{
currentValue: <#if field.value?exists>${field.value}<#else>50</#if>,
minValue: <#if field.control.params.minValue?exists>${field.control.params.minValue}<#else>1</#if>,
maxValue: <#if field.control.params.maxValue?exists>${field.control.params.maxValue}<#else>100</#if>
}).setMessages(
${messages}
);
})();
Here, the 'currentValue' is given '50'. You can change it as per your requirement.
NOTE: It is bad practice to make changes in existing files of alfresco. You can override the existing functionality by creating appropriate folder structure within 'shared' folder.
Please let me know if you have any further query.
Thanks,
Kalpesh
07-20-2017 05:40 PM
You don't even have to override this widget. Simply initialise your workflow / task form model to include an explicit default value. This can be done by adding a form filter Java bean on the Repository tier that sets a custom default value in the generated form metadata.
Explore our Alfresco products with the links below. Use labels to filter content by product module.