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

Bilgin Ibryam commented on OFBIZ-1189:
--------------------------------------

The ECA event type i was expecting "global-commit-post-run" is just committed 
at r576815   :)
Now we can call "checkDigitalItemFulfillment' (the serviec that completes 
approved order items) this way and the bug is fixed :
Index: applications/order/servicedef/secas.xml
===================================================================
--- applications/order/servicedef/secas.xml     (revision 576837)
+++ applications/order/servicedef/secas.xml     (working copy)
@@ -45,7 +45,7 @@
         <condition field-name="statusId" operator="equals" 
value="ITEM_APPROVED"/>
         <action service="checkOrderItemStatus" mode="sync"/>
     </eca>
-    <eca service="changeOrderItemStatus" event="commit">
+    <eca service="changeOrderItemStatus" event="global-commit-post-run">
         <condition field-name="statusId" operator="equals" 
value="ITEM_APPROVED"/>
         <action service="checkDigitalItemFulfillment" mode="sync"/>
     </eca>

Now if we try to approve an order with only digital products, the order will be 
approved.
Actually the order (and all the items)  are completed, but they are completed 
after some time (2 seconds on my machine )and we have to refresh the order view 
page to see that order is completed.
I was expecting that with mode="sync" i will see the completed status of the 
order without needing to refresh (not refresh exactly, refresh will try to 
approve the order again. clicking on the order id will reload the page).



> Cannot approve digital product orders
> -------------------------------------
>
>                 Key: OFBIZ-1189
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-1189
>             Project: OFBiz
>          Issue Type: Bug
>          Components: order
>    Affects Versions: SVN trunk
>            Reporter: Bilgin Ibryam
>            Assignee: David E. Jones
>             Fix For: SVN trunk
>
>         Attachments: order.patch, order.patch
>
>
> Hi all,
> There is a bug when approving orders that contains only digital products. 
> If you create an order that contains only digital products and then try to 
> approve it you will get ERROR : Could not change order status ; status is not 
> a valid change.: [ORDER_COMPLETED] -> [ORDER_APPROVED]
> The reason is that there is seca rule and checkDigitalItemFulfillment service 
> will put all the items to ITEM_COMPLETED status. Then another seca calls 
> checkOrderItemStatus and the order is also in put in ORDER_COMPLETED status. 
> All the items are completed and the order is also completed, everything looks 
> fine, but the service called in the beginning to approve the order generates 
> the error [ORDER_COMPLETED] -> [ORDER_APPROVED] is not a valid change....
> Any ideas what should be the flow in approving and completing an order in 
> cases where all items are completed while approving ?
> Regards,
> Bilgin Ibryam

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to