Users - RE: Entity ECA - trigger not working

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Users - RE: Entity ECA - trigger not working

saching

Hi all,

Further detail on the same issue:

These are the logs that I had put in EntityEcaRule.java &
EntityEcaCondition.java.


**** CONDITION TO EVAL **** [productId][is-not-empty][][true][String][]
**** lhsValue **** SGTEST-1000
**** rhsValue ****
**** operator **** is-not-empty
**** compareType **** String
**** format ****
**** cond **** true
**** CONDITION TO EVAL **** [status][equals][DELETED][true][String][]
**** lhsValue **** null
**** rhsValue **** DELETED
**** operator **** equals
**** compareType **** String
**** format ****
**** cond **** false

What I've observed is that the ECA does not seem to find the values for DB
fields e.g. status & salesDiscontinuationDate. So its not able to compare.

Is there something that I need to do to ensure that the ECA gets to access
the product record on which its being triggered?

Regards,
Sachin.

-----Original Message-----
From: [hidden email] [mailto:[hidden email]]
On Behalf Of [hidden email]
Sent: Tuesday, December 13, 2005 4:39 AM
To: [hidden email]
Subject: Users Digest, Vol 17, Issue 21

Send Users mailing list submissions to
        [hidden email]

To subscribe or unsubscribe via the World Wide Web, visit
        http://lists.ofbiz.org/mailman/listinfo/users
or, via email, send a message with subject or body 'help' to
        [hidden email]

You can reach the person managing the list at
        [hidden email]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Users digest..."


Today's Topics:

   1. Re: checkout with new user does not work (Si Chen)
   2. Re: anonymous ordering can only be done once..... (Si Chen)
   3. Parties import ([hidden email])
   4. Entity ECA - trigger not working (saching)
   5. RE: Entity ECA - trigger not working (saching)


----------------------------------------------------------------------

Message: 1
Date: Mon, 12 Dec 2005 16:37:35 -0800
From: Si Chen <[hidden email]>
Subject: Re: [OFBiz] Users - checkout with new user does not work
To: OFBiz Users / Usage Discussion <[hidden email]>
Message-ID: <[hidden email]>
Content-Type: text/plain; charset=UTF-8; format=flowed

This is fixed in SVN r 6303 and 6304.  The right answer was to set the
cart's partyId after creating the user.

Si

Jacopo Cappellato wrote:

> Hi Hans,
>
> I'm rather sure that the problem you are seeing is related by the 6052
> commit (see attached mail for details).
> It should be rather easy to change back that code.
>
> Si, could you have a look at it as well?
>
> Thanks,
>
> Jacopo
>
>
>
> Hans Bakker wrote:
> > Hi,
> >
> > i just found a problem with a clean system, run-install etc.
> >
> > if I put an item in the shopping cart, select 'quickcheckout' and
> select
> > 'create a new account' enter a new user and press 'save' I get:
> >
> > org.ofbiz.base.util.GeneralException: Error rendering screen
> > [checkoutoptions]: org.ofbiz.base.util.GeneralException: Error
> running BSH
> > script at location
> >
>
[component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/checkoutpaymen
t.bsh]:
>
> > org.ofbiz.base.util.GeneralException: Error running BSH script at
> >
>
[component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/checkoutpaymen
t.bsh],
>
> > line [54]: Sourced file:
> >
>
component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/checkoutpayment
.bsh
> :
> > null : at Line: 54 : in file:
> >
>
component://ecommerce/webapp/ecommerce/WEB-INF/actions/order/checkoutpayment
.bsh

> :
> > party .getRelated ( "PaymentMethod" , null , UtilMisc .toList
> > ( "paymentMethodTypeId" ) )
> >
> > This is cause because the shoppingCart is not available and so the
> newly
> > created partyId cannot retrieved from it....
> >
> > if i get the party id from the logonId the problem is gone however
> the screen
> > goes to the main screen and not to the checkout options....
> >
> > anybody having the same problems? I have to deliver a shop this
> weekend....and
> > this a real showstopper....
> >
> >
> >
> >
> ------------------------------------------------------------------------
> >
> >
> > _______________________________________________
> > Users mailing list
> > [hidden email]
> > http://lists.ofbiz.org/mailman/listinfo/users
>
>
> ------------------------------------------------------------------------
>
>
>Return-Path: <[hidden email]>
>Delivered-To: [hidden email]
>Received: from jaz.jportfolio.com (unknown [69.26.131.105])
> by ns.sastau.it (Postfix) with ESMTP id 4ACDFE467
> for <[hidden email]>; Mon, 31 Oct 2005 22:02:38 +0100 (CET)
>Received: from jaz.jportfolio.com (jaz.jportfolio.com [127.0.0.1])
> by jaz.jportfolio.com (8.11.6/8.11.6) with ESMTP id j9VFfeo01392;
> Mon, 31 Oct 2005 10:41:40 -0500
>Received: from ofbiz01.contegix.com (63-246-7-15.contegix.com
[63.246.7.15])

> by jaz.jportfolio.com (8.11.6/8.11.6) with ESMTP id j9VFfco01379
> for <[hidden email]>; Mon, 31 Oct 2005 10:41:38 -0500
>Received: (qmail 15812 invoked by uid 48); 31 Oct 2005 21:01:05 -0000
>Date: 31 Oct 2005 21:01:05 -0000
>Message-ID: <[hidden email]>
>To: [hidden email]
>From: [hidden email]
>Content-Type: text/plain; charset=UTF-8
>Content-Transfer-Encoding: 8bit
>Subject: [OFBiz] SVN: r6052 -
> trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order
>X-BeenThere: [hidden email]
>X-Mailman-Version: 2.1.5
>Precedence: list
>Reply-To: "OFBiz SVN Commit Notifications (High Traffic)"
<[hidden email]>

>List-Id: "OFBiz SVN Commit Notifications \(High Traffic\)"
> <svn.lists.ofbiz.org>
>List-Unsubscribe: <http://lists.ofbiz.org/mailman/listinfo/svn>,
> <mailto:[hidden email]?subject=unsubscribe>
>List-Archive: <http://lists.ofbiz.org/pipermail/svn>
>List-Post: <mailto:[hidden email]>
>List-Help: <mailto:[hidden email]?subject=help>
>List-Subscribe: <http://lists.ofbiz.org/mailman/listinfo/svn>,
> <mailto:[hidden email]?subject=subscribe>
>Sender: [hidden email]
>Errors-To: [hidden email]
>
>Author: sichen
>Date: 2005-10-31 15:01:02 -0600 (Mon, 31 Oct 2005)
>New Revision: 6052
>
>Modified:
>
trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/checkout
options.bsh
>
trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/checkout
payment.bsh
>Log:
>Fixed a couple of places where the ecommerce app should be using the party
from the cart rather than from the userLogin
>
>Modified:
trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/checkout
options.bsh
>===================================================================
>---
trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/checkout
options.bsh 2005-10-31 20:59:05 UTC (rev 6051)
>+++
trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/checkout
options.bsh 2005-10-31 21:01:02 UTC (rev 6052)
>@@ -34,7 +34,8 @@
>
> shoppingCart = session.getAttribute("shoppingCart");
> currencyUomId = shoppingCart.getCurrency();
>-party = userLogin.getRelatedOne("Party");
>+partyId = shoppingCart.getPartyId();
>+party = delegator.findByPrimaryKeyCache("Party", UtilMisc.toMap("partyId",
partyId));
> productStore = ProductStoreWorker.getProductStore(request);
>
> shippingEstWpr = null;
>
>Modified:
trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/checkout
payment.bsh
>===================================================================
>---
trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/checkout
payment.bsh 2005-10-31 20:59:05 UTC (rev 6051)
>+++
trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/order/checkout
payment.bsh 2005-10-31 21:01:02 UTC (rev 6052)
>@@ -34,9 +34,9 @@
> cart = session.getAttribute("shoppingCart");
> currencyUomId = cart.getCurrency();
> userLogin = session.getAttribute("userLogin");
>-party = userLogin.getRelatedOne("Party");
>+partyId = cart.getPartyId();
>+party = delegator.findByPrimaryKeyCache("Party", UtilMisc.toMap("partyId",
partyId));

> productStoreId = ProductStoreWorker.getProductStoreId(request);
>-partyId = userLogin.getString("partyId");
>
> checkOutPaymentId = "";
> if (cart != null) {
>
>
>_______________________________________________
>Svn mailing list
>[hidden email]
>http://lists.ofbiz.org/mailman/listinfo/svn
>
>  
>
>------------------------------------------------------------------------
>
>
>_______________________________________________
>Users mailing list
>[hidden email]
>http://lists.ofbiz.org/mailman/listinfo/users
>


------------------------------

Message: 2
Date: Mon, 12 Dec 2005 16:38:53 -0800
From: Si Chen <[hidden email]>
Subject: Re: [OFBiz] Users - anonymous ordering can only be done
        once.....
To: OFBiz Users / Usage Discussion <[hidden email]>
Message-ID: <[hidden email]>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Yes, this has been a known issue for a while:
http://jira.undersunconsulting.com/browse/OFBIZ-473

Basically, after the anonymous checkout, the cart should be cleared of a
userId.  I'm sorry I don't have time to fix it, but it should not be
difficult - maybe an hour or two.

Si

Hans Bakker wrote:

>I checked the check out process to create an account without a loginId and
>this process can only be done once....The second time i get the message:
>
>* You do not have permission to perform this operation for this party.
calling

>service createPartyRole in createCustomer
>
>clearing the cookie will enable this again....
>
>  
>
>------------------------------------------------------------------------
>
>
>_______________________________________________
>Users mailing list
>[hidden email]
>http://lists.ofbiz.org/mailman/listinfo/users
>


------------------------------

Message: 3
Date: Mon, 12 Dec 2005 21:54:34 -0500 (EST)
From: [hidden email]
Subject: [OFBiz] Users - Parties import
To: [hidden email]
Message-ID:
        <[hidden email]>
Content-Type: text/plain;charset=iso-8859-1

How can import my customer list to ofbiz. I know how to import products
and stuff but when I go to Entity Data Maintenance, I cannot click All on
PartyAndPostalAddress. Can someone give me field names for party related
import ?
Michal


------------------------------

Message: 4
Date: Tue, 13 Dec 2005 10:40:08 +0530
From: "saching" <[hidden email]>
Subject: [OFBiz] Users - Entity ECA - trigger not working
To: <[hidden email]>
Message-ID: <[hidden email]>
Content-Type: text/plain; charset="us-ascii"


Hi Jacopo,

 

That was a typing mistake by me in the mail, wasn't the case with the actual
code.

 

Please consider the following:

1.      My product import file is as follows:

a.      <?xml version="1.0" encoding="UTF-8"?>

<entity-engine-xml>

          <Product productId="SGTEST-1000" productTypeId="FINISHED_GOOD"
primaryProductCategoryId="9001" salesDiscontinuationDate="2005-08-24
10:40:17.552" internalName="SG TEST PRODUCT" productName="Modem"
description="ADSL Modem" smallImageUrl="/images/btcom/bt_wireless_hub.jpg"
largeImageUrl="/images/btcom/bt_wireless_hub.jpg" taxable="N"
chargeShipping="N" autoCreateKeywords="Y" isVirtual="N" isVariant="N"
createdDate="2003-03-04 19:00:29.851" createdByUserLogin="admin"
lastModifiedDate="2003-03-04 19:02:17.445" lastModifiedByUserLogin="admin"
lastUpdatedStamp="2005-08-17 15:12:58.59" lastUpdatedTxStamp="2005-08-17
15:12:56.988" createdStamp="2005-08-10 18:28:55.822"
createdTxStamp="2005-08-10 18:28:43.144" status="DELETED"/>

</entity-engine-xml>

 

2.      My entry in eecas.xml is:

a.          <eca entity="Product" operation="create-store" event="return">

        <condition field-name="productId" operator="is-not-empty"/>

        <condition field-name="salesDiscontinuationDate"
operator="is-not-empty"/>

        <condition field-name="status" operator="is-not-empty"/>

        <action service="setProductStatusAsDeleted" mode="sync"
value-attr="productInstance"/>

    </eca>

It doesn't seem to trigger the event & it moves on to the next available
event.

 

Any clues?

 

Ultimately what I want to check is that if salesDiscontinuationDate is not
empty & status is DELETED, then this eca should be triggered.

 

Thanks and regards,

Sachin Gulvady



*********************************************************
Disclaimer:

The contents of this E-mail (including the contents of the enclosure(s) or
attachment(s) if any) are privileged and confidential material of MBT and
should not be disclosed to, used by or copied in any manner by anyone other
than the intended addressee(s).   In case you are not the desired addressee,
you should delete this message and/or re-direct it to the sender.  The views
expressed in this E-mail message (including the enclosure(s) or
attachment(s) if any) are those of the individual sender, except where the
sender expressly, and with authority, states them to be the views of MBT.

This e-mail message including attachment/(s), if any, is believed to be free
of any virus.  However, it is the responsibility of the recipient to ensure
that it is virus free and MBT is not responsible for any loss or damage
arising in any way from its use

*********************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.ofbiz.org/pipermail/users/attachments/20051213/44a88d50/attachm
ent-0001.htm

------------------------------

Message: 5
Date: Tue, 13 Dec 2005 11:30:38 +0530
From: "saching" <[hidden email]>
Subject: RE: [OFBiz] Users - Entity ECA - trigger not working
To: <[hidden email]>
Message-ID: <[hidden email]>
Content-Type: text/plain; charset="us-ascii"


Also, within a <condition> tag, how can I check for a particular field
against a dynamic value? E.g. salesDiscontinuationDate <= today's date?

 

Regards,

Sachin.

 

  _____  

From: saching [mailto:[hidden email]]
Sent: Tuesday, December 13, 2005 10:40 AM
To: '[hidden email]'
Subject: [OFBiz] Users - Entity ECA - trigger not working

 

Hi Jacopo,

 

That was a typing mistake by me in the mail, wasn't the case with the actual
code.

 

Please consider the following:

1.      My product import file is as follows:

a.      <?xml version="1.0" encoding="UTF-8"?>

<entity-engine-xml>

          <Product productId="SGTEST-1000" productTypeId="FINISHED_GOOD"
primaryProductCategoryId="9001" salesDiscontinuationDate="2005-08-24
10:40:17.552" internalName="SG TEST PRODUCT" productName="Modem"
description="ADSL Modem" smallImageUrl="/images/btcom/bt_wireless_hub.jpg"
largeImageUrl="/images/btcom/bt_wireless_hub.jpg" taxable="N"
chargeShipping="N" autoCreateKeywords="Y" isVirtual="N" isVariant="N"
createdDate="2003-03-04 19:00:29.851" createdByUserLogin="admin"
lastModifiedDate="2003-03-04 19:02:17.445" lastModifiedByUserLogin="admin"
lastUpdatedStamp="2005-08-17 15:12:58.59" lastUpdatedTxStamp="2005-08-17
15:12:56.988" createdStamp="2005-08-10 18:28:55.822"
createdTxStamp="2005-08-10 18:28:43.144" status="DELETED"/>

</entity-engine-xml>

 

2.      My entry in eecas.xml is:

a.          <eca entity="Product" operation="create-store" event="return">

        <condition field-name="productId" operator="is-not-empty"/>

        <condition field-name="salesDiscontinuationDate"
operator="is-not-empty"/>

        <condition field-name="status" operator="is-not-empty"/>

        <action service="setProductStatusAsDeleted" mode="sync"
value-attr="productInstance"/>

    </eca>

It doesn't seem to trigger the event & it moves on to the next available
event.

 

Any clues?

 

Ultimately what I want to check is that if salesDiscontinuationDate is not
empty & status is DELETED, then this eca should be triggered.

 

Thanks and regards,

Sachin Gulvady



*********************************************************
Disclaimer:

The contents of this E-mail (including the contents of the enclosure(s) or
attachment(s) if any) are privileged and confidential material of MBT and
should not be disclosed to, used by or copied in any manner by anyone other
than the intended addressee(s).   In case you are not the desired addressee,
you should delete this message and/or re-direct it to the sender.  The views
expressed in this E-mail message (including the enclosure(s) or
attachment(s) if any) are those of the individual sender, except where the
sender expressly, and with authority, states them to be the views of MBT.

This e-mail message including attachment/(s), if any, is believed to be free
of any virus.  However, it is the responsibility of the recipient to ensure
that it is virus free and MBT is not responsible for any loss or damage
arising in any way from its use

*********************************************************
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.ofbiz.org/pipermail/users/attachments/20051213/ba255f4b/attachm
ent.htm

------------------------------

 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users

End of Users Digest, Vol 17, Issue 21
*************************************


*********************************************************
Disclaimer:

The contents of this E-mail (including the contents of the enclosure(s) or attachment(s) if any) are privileged and confidential material of MBT and should not be disclosed to, used by or copied in any manner by anyone other than the intended addressee(s).   In case you are not the desired addressee, you should delete this message and/or re-direct it to the sender.  The views expressed in this E-mail message (including the enclosure(s) or attachment(s) if any) are those of the individual sender, except where the sender expressly, and with authority, states them to be the views of MBT.

This e-mail message including attachment/(s), if any, is believed to be free of any virus.  However, it is the responsibility of the recipient to ensure that it is virus free and MBT is not responsible for any loss or damage arising in any way from its use

*********************************************************
 
_______________________________________________
Users mailing list
[hidden email]
http://lists.ofbiz.org/mailman/listinfo/users