Parameter Value Change and Form Validation Listener for Process Dialog
Description
Environment
Attachments
Activity

Hiep Lq August 31, 2019 at 11:13 AM
relate to lookup service, i suggest to improve lookup IDocFactory
current behavior
you have MAcctSchema with GAAP field GAAP = gaap
you have MAcctSchema with GAAP field GAAP = twogaap
you have MAcctSchema with GAAP field GAAP = threegaap
now you install some service
at the moment all MAcctSchema use default service with gaap=*
1. now you install new service with gaap=gaap and priority lower than default, then MAcctSchema gaap use this new service, other remain to default
2. now you change priory to higher than default, all move to use new service
at this step, i think remain MAcctSchema should stay with default service (gaap=*). because new one is more specific to concrate gaap=gaap
it’s more chao when you install service with gaap = twogaap, gaap = anygaap
it should improve logic to below
a service can regirstry to handle one GAAP, many GAAP, “*“ mean all, or some GAAP include “*”
MAcctSchema have GAAP=mygaap lookup for service by:
1. contain “mygaap” and sort by priority
2. in case (1) fail then search for “*“
3. in case (2) fail don’t match anymore, ever exists gaap = non_mygaap

Hiep Lq August 31, 2019 at 10:48 AM
HI your patch work fine.
for document, i note bellow thing.
my patch will work when escaped ateris character
add plugin for test ssh://hg@bitbucket.org/idplugin/vn.hsv.test.lookup.process.parameter.validate
active plugin and do bellow test to see effect
run process “Generate Shipments”
+ change value of parameter “Warehouse” will call
ProcessParameterValidateMultiParam, ProcessParameterValidateAllParam
+ change value of “Business Partner“ will call
ProcessParameterValidateMultiParam, ProcessParameterValidateAllParam, ProcessParameterValidateSingleParam
+ change value of other will call only ProcessParameterValidateAllParam
Carlos Ruiz August 30, 2019 at 12:38 PM
Committed 9aa5b25 and implemented as test and example showcase. It's working fine now.
Carlos Ruiz August 30, 2019 at 10:38 AM
Hi , tested your idea
> define multiple value of ColumnName for each column you want ot listen
it didn't work.
Also, the actual approach is not working either.

Hiep Lq August 29, 2019 at 2:42 PM
on my service component
class org.adempiere.webui.Extensions
make value
{ProcessClass=th.tgas.publicsector.DupplicateAsset, |ColumnName=A_Asset_Group_ID|A_Asset_Group_ID,
|
,A_Asset_Group_ID,
|
,A_Asset_Group_ID}
on org.adempiere.base.ds.DynamicServiceLocator
make value
(&(objectclass=org.adempiere.webui.apps.IProcessParameterListener)(ProcessClass=th.tgas.publicsector.DupplicateAsset)(|ColumnName=A_Asset_Group_ID|A_Asset_Group_ID,_|,A_Asset_Group_ID,*|*_,A_Asset_Group_ID))
so it can’t find out my service.
I suggest to modify:
ColumnName - comma separated list of column name (use * to match all parameter field )
=> define muilty value of ColumnName for each column you want ot listen
=> define value “*“ for ColumnName in case want to listene all
and code on class org.adempiere.webui.Extensions become
Details
Details
Assignee

Reporter

Implement OSGi style listener for process parameter value change and process paramer form validation.
The OSGi component should implement IProcessParameterListener interface ( as provided service interface in component definition ) and include the following component/service properties ( String type ):
ProcessClass - class name of process
ColumnName - comma separated list of column name (use * to match all parameter field ) to listen for value change event for one or more parameter field. This is not needed if the component only implement form validation.