From 69f235d7afec61a04f4c1e0a0c81eab66b289756 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=81ukasz=20Nowak?= <luke@nexedi.com>
Date: Fri, 2 Mar 2012 16:39:41 +0100
Subject: [PATCH] Separate alarm runs.

By registering noop activity on alarm itself which depends on tag used in alarm
only one alarm will be run in same time.
---
 .../Alarm_registerPlannedPaymentTransactionPayzen.xml           | 1 +
 .../Alarm_updatePayzenConfirmedPaymentTransaction.xml           | 1 +
 master/bt5/vifib_payzen/bt/revision                             | 2 +-
 .../portal_skins/vifib_slap/Alarm_cancelCleanupPartition.xml    | 1 +
 .../portal_skins/vifib_slap/Alarm_cancelUpdatePartition.xml     | 1 +
 .../portal_skins/vifib_slap/Alarm_confirmOrderedSaleOrder.xml   | 2 ++
 .../vifib_slap/Alarm_confirmPlannedSaleInvoiceTransaction.xml   | 2 ++
 .../vifib_slap/Alarm_deliverSubscriptionSalePackingList.xml     | 2 ++
 .../portal_skins/vifib_slap/Alarm_desactivateDeadComputer.xml   | 1 +
 .../vifib_slap/Alarm_destroyNonInstanciatedPartition.xml        | 1 +
 .../vifib_slap/Alarm_stopConfirmedSaleInvoiceTransaction.xml    | 1 +
 .../portal_skins/vifib_slap/Alarm_updateOpenSaleOrderLine.xml   | 2 ++
 master/bt5/vifib_slap/bt/revision                               | 2 +-
 13 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/master/bt5/vifib_payzen/SkinTemplateItem/portal_skins/vifib_payzen/Alarm_registerPlannedPaymentTransactionPayzen.xml b/master/bt5/vifib_payzen/SkinTemplateItem/portal_skins/vifib_payzen/Alarm_registerPlannedPaymentTransactionPayzen.xml
index 54deec4eb..500a1d31d 100644
--- a/master/bt5/vifib_payzen/SkinTemplateItem/portal_skins/vifib_payzen/Alarm_registerPlannedPaymentTransactionPayzen.xml
+++ b/master/bt5/vifib_payzen/SkinTemplateItem/portal_skins/vifib_payzen/Alarm_registerPlannedPaymentTransactionPayzen.xml
@@ -58,6 +58,7 @@ portal.portal_catalog.searchAndActivate(\n
       packet_size=1, # just one to minimise errors\n
       activate_kw={\'tag\': tag}\n
       )\n
+context.activate(after_tag=tag).getId()\n
 </string> </value>
         </item>
         <item>
diff --git a/master/bt5/vifib_payzen/SkinTemplateItem/portal_skins/vifib_payzen/Alarm_updatePayzenConfirmedPaymentTransaction.xml b/master/bt5/vifib_payzen/SkinTemplateItem/portal_skins/vifib_payzen/Alarm_updatePayzenConfirmedPaymentTransaction.xml
index 6b3cd73cd..c066e5526 100644
--- a/master/bt5/vifib_payzen/SkinTemplateItem/portal_skins/vifib_payzen/Alarm_updatePayzenConfirmedPaymentTransaction.xml
+++ b/master/bt5/vifib_payzen/SkinTemplateItem/portal_skins/vifib_payzen/Alarm_updatePayzenConfirmedPaymentTransaction.xml
@@ -58,6 +58,7 @@ portal.portal_catalog.searchAndActivate(\n
       packet_size=1, # just one to minimise errors\n
       activate_kw={\'tag\': tag}\n
       )\n
+context.activate(after_tag=tag).getId()\n
 </string> </value>
         </item>
         <item>
diff --git a/master/bt5/vifib_payzen/bt/revision b/master/bt5/vifib_payzen/bt/revision
index 8783e3051..43c451e0c 100644
--- a/master/bt5/vifib_payzen/bt/revision
+++ b/master/bt5/vifib_payzen/bt/revision
@@ -1 +1 @@
-53
\ No newline at end of file
+54
\ No newline at end of file
diff --git a/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_cancelCleanupPartition.xml b/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_cancelCleanupPartition.xml
index 25a8e1c84..f21159888 100644
--- a/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_cancelCleanupPartition.xml
+++ b/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_cancelCleanupPartition.xml
@@ -61,6 +61,7 @@ portal.portal_catalog.searchAndActivate(\n
   method_id=\'SalePackingListLine_checkAndCancelCleanupPartition\',\n
   activate_kw={\'tag\': tag}\n
 )\n
+context.activate(after_tag=tag).getId()\n
 </string> </value>
         </item>
         <item>
diff --git a/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_cancelUpdatePartition.xml b/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_cancelUpdatePartition.xml
index d4aef4b6e..3dd92c4da 100644
--- a/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_cancelUpdatePartition.xml
+++ b/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_cancelUpdatePartition.xml
@@ -61,6 +61,7 @@ portal.portal_catalog.searchAndActivate(\n
   method_id=\'SalePackingListLine_checkAndCancelUpdatePartition\',\n
   activate_kw={\'tag\': tag}\n
 )\n
+context.activate(after_tag=tag).getId()\n
 </string> </value>
         </item>
         <item>
diff --git a/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_confirmOrderedSaleOrder.xml b/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_confirmOrderedSaleOrder.xml
index 8b2abe61e..2e2031ab9 100644
--- a/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_confirmOrderedSaleOrder.xml
+++ b/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_confirmOrderedSaleOrder.xml
@@ -60,6 +60,8 @@ portal.portal_catalog.searchAndActivate(\n
   method_id=\'SaleOrderLine_tryToAllocatePartition\',\n
   activate_kw={\'tag\': tag}\n
 )\n
+\n
+context.activate(after_tag=tag).getId()\n
 </string> </value>
         </item>
         <item>
diff --git a/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_confirmPlannedSaleInvoiceTransaction.xml b/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_confirmPlannedSaleInvoiceTransaction.xml
index 9aa9daddf..7c12eb684 100644
--- a/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_confirmPlannedSaleInvoiceTransaction.xml
+++ b/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_confirmPlannedSaleInvoiceTransaction.xml
@@ -65,6 +65,8 @@ portal.portal_catalog.searchAndActivate(\n
   activate_kw={\'tag\': tag},\n
   **{"delivery.start_date": \'< %s\' % this_month}\n
 )\n
+\n
+context.activate(after_tag=tag).getId()\n
 
 
 ]]></string> </value>
diff --git a/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_deliverSubscriptionSalePackingList.xml b/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_deliverSubscriptionSalePackingList.xml
index 0f8285797..801d62f90 100644
--- a/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_deliverSubscriptionSalePackingList.xml
+++ b/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_deliverSubscriptionSalePackingList.xml
@@ -60,6 +60,8 @@ portal.portal_catalog.searchAndActivate(\n
   method_id=\'SalePackingListLine_deliverSubscription\',\n
   activate_kw={\'tag\': tag},\n
 )\n
+\n
+context.activate(after_tag=tag).getId()\n
 </string> </value>
         </item>
         <item>
diff --git a/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_desactivateDeadComputer.xml b/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_desactivateDeadComputer.xml
index 343fcfed7..16e25cc14 100644
--- a/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_desactivateDeadComputer.xml
+++ b/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_desactivateDeadComputer.xml
@@ -59,6 +59,7 @@ portal.portal_catalog.searchAndActivate(\n
   method_id=\'Computer_checkAndDesactivatePartitionList\',\n
   activate_kw={\'tag\': tag}\n
 )\n
+context.activate(after_tag=tag).getId()\n
 </string> </value>
         </item>
         <item>
diff --git a/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_destroyNonInstanciatedPartition.xml b/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_destroyNonInstanciatedPartition.xml
index 96ef8c772..e920987b5 100644
--- a/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_destroyNonInstanciatedPartition.xml
+++ b/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_destroyNonInstanciatedPartition.xml
@@ -61,6 +61,7 @@ portal.portal_catalog.searchAndActivate(\n
   method_id=\'SalePackingListLine_checkAndDestroyNonInstanciatedPartition\',\n
   activate_kw={\'tag\': tag}\n
 )\n
+context.activate(after_tag=tag).getId()\n
 </string> </value>
         </item>
         <item>
diff --git a/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_stopConfirmedSaleInvoiceTransaction.xml b/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_stopConfirmedSaleInvoiceTransaction.xml
index 095305b63..9d83dc108 100644
--- a/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_stopConfirmedSaleInvoiceTransaction.xml
+++ b/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_stopConfirmedSaleInvoiceTransaction.xml
@@ -60,6 +60,7 @@ portal.portal_catalog.searchAndActivate(\n
   method_id=\'SaleInvoiceTransaction_stopConfirmed\',\n
   activate_kw={\'tag\': tag}\n
 )\n
+context.activate(after_tag=tag).getId()\n
 </string> </value>
         </item>
         <item>
diff --git a/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_updateOpenSaleOrderLine.xml b/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_updateOpenSaleOrderLine.xml
index 6397c4cac..0894a8200 100644
--- a/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_updateOpenSaleOrderLine.xml
+++ b/master/bt5/vifib_slap/SkinTemplateItem/portal_skins/vifib_slap/Alarm_updateOpenSaleOrderLine.xml
@@ -65,6 +65,8 @@ context.portal_catalog.searchAndActivate(\n
   activate_kw={\'tag\':tag},\n
   method_kw={\'stop_date\': stop_date},\n
   portal_type=\'Open Sale Order Line\')\n
+\n
+context.activate(after_tag=tag).getId()\n
 </string> </value>
         </item>
         <item>
diff --git a/master/bt5/vifib_slap/bt/revision b/master/bt5/vifib_slap/bt/revision
index 5203768bd..4af6ab79f 100644
--- a/master/bt5/vifib_slap/bt/revision
+++ b/master/bt5/vifib_slap/bt/revision
@@ -1 +1 @@
-597
\ No newline at end of file
+598
\ No newline at end of file
-- 
2.30.9