ofbiz-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jacques Le Roux (JIRA)" <j...@apache.org>
Subject [jira] [Comment Edited] (OFBIZ-3847) Entity ECAs not triggered correctly when using Delegator.storeAll() method
Date Sat, 12 Aug 2017 08:30:00 GMT

    [ https://issues.apache.org/jira/browse/OFBIZ-3847?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15281317#comment-15281317
] 

Jacques Le Roux edited comment on OFBIZ-3847 at 8/12/17 8:29 AM:
-----------------------------------------------------------------

When I highlighted the line, I meant that oldValue is null not parameter value is null. 

I have just tested it again, value is not null but it is a GenericPK so it has no references
all non pk fields

Here is a stack trace from eclipse
{code}
Daemon Thread [ajp-bio-8019-exec-3] (Suspended (breakpoint at line 137 in EntityEcaRule))

	owns: SocketWrapper<E>  (id=194)	
	EntityEcaRule.eval(String, DispatchContext, GenericEntity, boolean, Set<String>) line:
137	
	DelegatorEcaHandler.evalRules(String, Map<String,List<EntityEcaRule>>, String,
GenericEntity, boolean) line: 109	
	GenericDelegator$EntityEcaRuleRunner<T>.evalRules(String, String, GenericEntity, boolean)
line: 2274	
	GenericDelegator.removeByPrimaryKey(GenericPK) line: 1004	
	GenericWebEvent.updateGeneric(HttpServletRequest, HttpServletResponse) line: 158	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]

	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 62	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43	
	Method.invoke(Object, Object...) line: 498	
	JavaEventHandler.invoke(String, String, Class<?>, Class<?>[], Object[]) line:
92	
	JavaEventHandler.invoke(ConfigXMLReader$Event, ConfigXMLReader$RequestMap, HttpServletRequest,
HttpServletResponse) line: 78	
	RequestHandler.runEvent(HttpServletRequest, HttpServletResponse, ConfigXMLReader$Event, ConfigXMLReader$RequestMap,
String) line: 759	
	RequestHandler.doRequest(HttpServletRequest, HttpServletResponse, String, GenericValue, Delegator)
line: 476	
	ControlServlet.doGet(HttpServletRequest, HttpServletResponse) line: 213	
	ControlServlet(HttpServlet).service(HttpServletRequest, HttpServletResponse) line: 620	
	ControlServlet(HttpServlet).service(ServletRequest, ServletResponse) line: 727	
	ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 303	
	ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 208	
	ContextFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 323	
	ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 241	
	ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 208	
	StandardWrapperValve.invoke(Request, Response) line: 220	
	StandardContextValve.invoke(Request, Response) line: 122	
	NonLoginAuthenticator(AuthenticatorBase).invoke(Request, Response) line: 505	
	StandardHostValve.invoke(Request, Response) line: 170	
	ErrorReportValve.invoke(Request, Response) line: 103	
	StandardEngineValve.invoke(Request, Response) line: 116	
	AccessLogValve.invoke(Request, Response) line: 956	
	CoyoteAdapter.service(Request, Response) line: 423	
	AjpProcessor.process(SocketWrapper<Socket>) line: 190	
	AjpProtocol$AjpConnectionHandler(AbstractProtocol$AbstractConnectionHandler<S,P>).process(SocketWrapper<S>,
SocketStatus) line: 625	
	JIoEndpoint$SocketProcessor.run() line: 316	
	ThreadPoolExecutor(ThreadPoolExecutor).runWorker(ThreadPoolExecutor$Worker) line: 1142	
	ThreadPoolExecutor$Worker.run() line: 617	
	TaskThread$WrappingRunnable.run() line: 61	
	TaskThread(Thread).run() line: 745	
{code}


was (Author: gareth.carter):
When I highlighted the line, I meant that oldValue is null not parameter value is null. 

I have just tested it again, value is not null but it is a GenericPK so it has no references
all non pk fields

Here is a stack trace from eclipse

Daemon Thread [ajp-bio-8019-exec-3] (Suspended (breakpoint at line 137 in EntityEcaRule))

	owns: SocketWrapper<E>  (id=194)	
	EntityEcaRule.eval(String, DispatchContext, GenericEntity, boolean, Set<String>) line:
137	
	DelegatorEcaHandler.evalRules(String, Map<String,List<EntityEcaRule>>, String,
GenericEntity, boolean) line: 109	
	GenericDelegator$EntityEcaRuleRunner<T>.evalRules(String, String, GenericEntity, boolean)
line: 2274	
	GenericDelegator.removeByPrimaryKey(GenericPK) line: 1004	
	GenericWebEvent.updateGeneric(HttpServletRequest, HttpServletResponse) line: 158	
	NativeMethodAccessorImpl.invoke0(Method, Object, Object[]) line: not available [native method]

	NativeMethodAccessorImpl.invoke(Object, Object[]) line: 62	
	DelegatingMethodAccessorImpl.invoke(Object, Object[]) line: 43	
	Method.invoke(Object, Object...) line: 498	
	JavaEventHandler.invoke(String, String, Class<?>, Class<?>[], Object[]) line:
92	
	JavaEventHandler.invoke(ConfigXMLReader$Event, ConfigXMLReader$RequestMap, HttpServletRequest,
HttpServletResponse) line: 78	
	RequestHandler.runEvent(HttpServletRequest, HttpServletResponse, ConfigXMLReader$Event, ConfigXMLReader$RequestMap,
String) line: 759	
	RequestHandler.doRequest(HttpServletRequest, HttpServletResponse, String, GenericValue, Delegator)
line: 476	
	ControlServlet.doGet(HttpServletRequest, HttpServletResponse) line: 213	
	ControlServlet(HttpServlet).service(HttpServletRequest, HttpServletResponse) line: 620	
	ControlServlet(HttpServlet).service(ServletRequest, ServletResponse) line: 727	
	ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 303	
	ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 208	
	ContextFilter.doFilter(ServletRequest, ServletResponse, FilterChain) line: 323	
	ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 241	
	ApplicationFilterChain.doFilter(ServletRequest, ServletResponse) line: 208	
	StandardWrapperValve.invoke(Request, Response) line: 220	
	StandardContextValve.invoke(Request, Response) line: 122	
	NonLoginAuthenticator(AuthenticatorBase).invoke(Request, Response) line: 505	
	StandardHostValve.invoke(Request, Response) line: 170	
	ErrorReportValve.invoke(Request, Response) line: 103	
	StandardEngineValve.invoke(Request, Response) line: 116	
	AccessLogValve.invoke(Request, Response) line: 956	
	CoyoteAdapter.service(Request, Response) line: 423	
	AjpProcessor.process(SocketWrapper<Socket>) line: 190	
	AjpProtocol$AjpConnectionHandler(AbstractProtocol$AbstractConnectionHandler<S,P>).process(SocketWrapper<S>,
SocketStatus) line: 625	
	JIoEndpoint$SocketProcessor.run() line: 316	
	ThreadPoolExecutor(ThreadPoolExecutor).runWorker(ThreadPoolExecutor$Worker) line: 1142	
	ThreadPoolExecutor$Worker.run() line: 617	
	TaskThread$WrappingRunnable.run() line: 61	
	TaskThread(Thread).run() line: 745	


> Entity ECAs not triggered correctly when using Delegator.storeAll() method
> --------------------------------------------------------------------------
>
>                 Key: OFBIZ-3847
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-3847
>             Project: OFBiz
>          Issue Type: Bug
>          Components: framework
>    Affects Versions: Release Branch 10.04
>            Reporter: Martin Kreidenweis
>            Assignee: Paul Foxworthy
>             Fix For: Upcoming Release
>
>         Attachments: GenericDelegator.java.diff, OFBIZ-3847_Entity-ECAs-not-triggered-correctly.patch,
OFBIZ-3847_Entity-ECAs-not-triggered-correctly.patch
>
>
> The conditions don't work when updating (not creating) entities using the Delegator.storeAll()
method. E.g. the following condition does not work:
> {code}
> <eca entity="Product" operation="create-store" event="return">
>         <condition field-name="autoCreateKeywords" operator="not-equals" value="N"/>
>         <action service="indexProductKeywords" mode="sync" value-attr="productInstance"/>
> </eca>
> {code}
> The indexProductKeywords service is called anyway when the product is updated and the
autoCreateKeywords was "N" and stays "N". It works correctly for newly created products. 
> The problem is in the method GenericDelegator.storeAll(), where unchanged field values
are not passed down to the store() method. The store method calls the ECA engine, which does
not receive the unchanged values at all and thus cannot evaluate the EECA conditions correctly.




--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message