From bc6deb808da540d6265f65b757fd4a2efc9698b5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=C5=81ukasz=20Nowak?= <luke@nexedi.com>
Date: Mon, 24 Jan 2011 09:42:19 +0000
Subject: [PATCH] - fix: context in workflow scripts is workflow tool, object
 being processed is in state_change['object']

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@42616 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../scripts/SoftwareInstance_destroyComputerPartition.xml  | 7 +++++--
 bt5/vifib_base/bt/revision                                 | 2 +-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/software_instance_slap_interface_workflow/scripts/SoftwareInstance_destroyComputerPartition.xml b/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/software_instance_slap_interface_workflow/scripts/SoftwareInstance_destroyComputerPartition.xml
index 5dda85f3c8..20ce9b5de7 100644
--- a/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/software_instance_slap_interface_workflow/scripts/SoftwareInstance_destroyComputerPartition.xml
+++ b/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/software_instance_slap_interface_workflow/scripts/SoftwareInstance_destroyComputerPartition.xml
@@ -51,11 +51,12 @@
         <item>
             <key> <string>_body</string> </key>
             <value> <string># revoke certificate\n
+software_instance = state_change[\'object\']\n
 context.getPortalObject().portal_certificate_authority\\\n
-  .revokeCertificate(context.getDestinationReference())\n
+  .revokeCertificate(software_instance.getDestinationReference())\n
 \n
 # remove certificate from SI\n
-context.edit(\n
+software_instance.edit(\n
   ssl_key=None,\n
   ssl_certificate=None,\n
 )\n
@@ -110,6 +111,8 @@ if packing_list.getPortalObject().portal_workflow.isTransitionPossible(packing_l
                         <value>
                           <tuple>
                             <string>state_change</string>
+                            <string>_getitem_</string>
+                            <string>software_instance</string>
                             <string>_getattr_</string>
                             <string>context</string>
                             <string>None</string>
diff --git a/bt5/vifib_base/bt/revision b/bt5/vifib_base/bt/revision
index a0b994e372..4129657509 100644
--- a/bt5/vifib_base/bt/revision
+++ b/bt5/vifib_base/bt/revision
@@ -1 +1 @@
-195
\ No newline at end of file
+196
\ No newline at end of file
-- 
2.30.9