<?xml version="1.0"?>
<ZopeData>
  <record id="1" aka="AAAAAAAAAAE=">
    <pickle>
      <global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
    </pickle>
    <pickle>
      <dictionary>
        <item>
            <key> <string>Script_magic</string> </key>
            <value> <int>3</int> </value>
        </item>
        <item>
            <key> <string>_bind_names</string> </key>
            <value>
              <object>
                <klass>
                  <global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
                </klass>
                <tuple/>
                <state>
                  <dictionary>
                    <item>
                        <key> <string>_asgns</string> </key>
                        <value>
                          <dictionary>
                            <item>
                                <key> <string>name_container</string> </key>
                                <value> <string>container</string> </value>
                            </item>
                            <item>
                                <key> <string>name_context</string> </key>
                                <value> <string>context</string> </value>
                            </item>
                            <item>
                                <key> <string>name_m_self</string> </key>
                                <value> <string>script</string> </value>
                            </item>
                            <item>
                                <key> <string>name_subpath</string> </key>
                                <value> <string>traverse_subpath</string> </value>
                            </item>
                          </dictionary>
                        </value>
                    </item>
                  </dictionary>
                </state>
              </object>
            </value>
        </item>
        <item>
            <key> <string>_body</string> </key>
            <value> <string>portal = context.getPortalObject()\n
\n
ticket_title = "Hosting Subscription %s is failing." % context.getTitle()\n
\n
description = "%s contains software instances which are unallocated or reporting errors." % (\n
        context.getTitle())\n
       \n
support_request = context.Base_generateSupportRequestForSlapOS(\n
  ticket_title,\n
  description,\n
  context.getRelativeUrl())\n
\n
if support_request is None:\n
  return\n
  \n
person = context.getDestinationSectionValue(portal_type="Person")\n
if not person:\n
  return\n
  \n
if support_request.getSimulationState() != "validated":\n
  support_request.validate()\n
\n
# Send Notification message\n
message = description\n
\n
notification_reference = notification_message_reference\n
notification_message = portal.portal_notifications.getDocumentValue(\n
                 reference=notification_reference)\n
if notification_message is not None:\n
  mapping_dict = {\'hosting_subscription_title\':context.getTitle(),\n
                  \'instance\': instance.getTitle()}\n
\n
  message = notification_message.asText(\n
              substitution_method_parameter_dict={\'mapping_dict\':mapping_dict})\n
  \n
return support_request.SupportRequest_trySendNotificationMessage(\n
              ticket_title, message, person.getRelativeUrl())\n
</string> </value>
        </item>
        <item>
            <key> <string>_params</string> </key>
            <value> <string>instance, notification_message_reference</string> </value>
        </item>
        <item>
            <key> <string>id</string> </key>
            <value> <string>HostingSubscription_createSupportRequestEvent</string> </value>
        </item>
      </dictionary>
    </pickle>
  </record>
</ZopeData>
