Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Romain Courteaud
slapos.core
Commits
4ba19bd4
Commit
4ba19bd4
authored
Oct 07, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_crm: add an alarm to deliver stopped event
Interact with the support request if possible.
parent
4a2894e9
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
436 additions
and
0 deletions
+436
-0
master/bt5/slapos_crm/PathTemplateItem/portal_alarms/slapos_crm_check_stopped_event_to_deliver.xml
...rtal_alarms/slapos_crm_check_stopped_event_to_deliver.xml
+113
-0
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_checkStoppedEventToDeliver.py
...slapos_crm_monitoring/Alarm_checkStoppedEventToDeliver.py
+13
-0
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_checkStoppedEventToDeliver.xml
...lapos_crm_monitoring/Alarm_checkStoppedEventToDeliver.xml
+62
-0
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Event_checkStoppedToDeliver.py
...kins/slapos_crm_monitoring/Event_checkStoppedToDeliver.py
+45
-0
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Event_checkStoppedToDeliver.xml
...ins/slapos_crm_monitoring/Event_checkStoppedToDeliver.xml
+62
-0
master/bt5/slapos_crm/WorkflowTemplateItem/portal_workflow/slapos_crm_interaction_workflow/interaction_Event_stop.xml
...lapos_crm_interaction_workflow/interaction_Event_stop.xml
+60
-0
master/bt5/slapos_crm/WorkflowTemplateItem/portal_workflow/slapos_crm_interaction_workflow/script_Base_triggerCheckStoppedEventToDeliver.py
...workflow/script_Base_triggerCheckStoppedEventToDeliver.py
+2
-0
master/bt5/slapos_crm/WorkflowTemplateItem/portal_workflow/slapos_crm_interaction_workflow/script_Base_triggerCheckStoppedEventToDeliver.xml
...orkflow/script_Base_triggerCheckStoppedEventToDeliver.xml
+78
-0
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSCodingStyle.py
...Item/portal_components/test.erp5.testSlapOSCodingStyle.py
+1
-0
No files found.
master/bt5/slapos_crm/PathTemplateItem/portal_alarms/slapos_crm_check_stopped_event_to_deliver.xml
0 → 100644
View file @
4ba19bd4
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Alarm"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
active_sense_method_id
</string>
</key>
<value>
<string>
Alarm_checkStoppedEventToDeliver
</string>
</value>
</item>
<item>
<key>
<string>
automatic_solve
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Check if a public or a friend compute_node contacted master recently and create a ticket if the compute_node stops to contact master after some time.
</string>
</value>
</item>
<item>
<key>
<string>
enabled
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
slapos_crm_check_stopped_event_to_deliver
</string>
</value>
</item>
<item>
<key>
<string>
periodicity_hour
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_hour_frequency
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
periodicity_minute
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_minute_frequency
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
periodicity_month
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_month_day
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
periodicity_month_frequency
</string>
</key>
<value>
<int>
12
</int>
</value>
</item>
<item>
<key>
<string>
periodicity_start_date
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</tuple>
<state>
<tuple>
<float>
1288051200.0
</float>
<string>
GMT
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
periodicity_week
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Alarm
</string>
</value>
</item>
<item>
<key>
<string>
sense_method_id
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Check stopped event to deliver
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_checkStoppedEventToDeliver.py
0 → 100644
View file @
4ba19bd4
portal
=
context
.
getPortalObject
()
activate_kw
=
{
'tag'
:
tag
}
portal
.
portal_catalog
.
searchAndActivate
(
portal_type
=
portal
.
getPortalEventTypeList
(),
simulation_state
=
'stopped'
,
follow_up__portal_type
=
'Support Request'
,
method_id
=
'Event_checkStoppedToDeliver'
,
method_kw
=
{
'activate_kw'
:
activate_kw
},
activate_kw
=
activate_kw
)
context
.
activate
(
after_tag
=
tag
).
getId
()
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Alarm_checkStoppedEventToDeliver.xml
0 → 100644
View file @
4ba19bd4
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</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>
_params
</string>
</key>
<value>
<string>
tag, fixit, params
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Alarm_checkStoppedEventToDeliver
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Event_checkStoppedToDeliver.py
0 → 100644
View file @
4ba19bd4
event
=
context
if
event
.
getSimulationState
()
!=
'stopped'
:
return
support_request
=
event
.
getFollowUpValue
(
portal_type
=
'Support Request'
)
if
support_request
is
None
:
# No ticket, don't try doing anything
return
is_event_older_than_ticket_modification
=
(
event
.
getCreationDate
()
<=
event
.
getModificationDate
())
if
is_event_older_than_ticket_modification
:
if
support_request
.
getSimulationState
()
==
'invalidated'
:
# Ticket reach final state
# close all previous events
event
.
deliver
(
comment
=
'Ticket was invalidated'
)
event
.
reindexObject
(
activate_kw
=
activate_kw
)
return
if
support_request
.
getSimulationState
()
==
'validated'
:
# Ticket is ongoing. No need to update it.
event
.
deliver
(
comment
=
'Ticket was validated'
)
event
.
reindexObject
(
activate_kw
=
activate_kw
)
return
else
:
if
support_request
.
getSimulationState
()
==
'validated'
:
# Event is more recent than the ticket
# Touch the ticket, to allow manager to see it as recent
# and deliver the event
support_request
.
edit
(
activate_kw
=
activate_kw
)
event
.
deliver
(
comment
=
'Ticket has been modified'
)
event
.
reindexObject
(
activate_kw
=
activate_kw
)
return
if
support_request
.
getSimulationState
()
==
'invalidated'
:
# Event is more recent than the ticket
# reopen the ticket
# and deliver the event
support_request
.
validate
(
activate_kw
=
activate_kw
)
event
.
deliver
(
comment
=
'Ticket has been revalidated'
)
event
.
reindexObject
(
activate_kw
=
activate_kw
)
return
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/Event_checkStoppedToDeliver.xml
0 → 100644
View file @
4ba19bd4
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</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>
_params
</string>
</key>
<value>
<string>
activate_kw=None
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Event_checkStoppedToDeliver
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_crm/WorkflowTemplateItem/portal_workflow/slapos_crm_interaction_workflow/interaction_Event_stop.xml
0 → 100644
View file @
4ba19bd4
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Interaction Workflow Interaction"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
after_script/portal_workflow/slapos_crm_interaction_workflow/script_Base_triggerCheckStoppedEventToDeliver
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
interaction_Event_stop
</string>
</value>
</item>
<item>
<key>
<string>
portal_type_filter
</string>
</key>
<value>
<tuple>
<string>
Web Message
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
temporary_document_disallowed
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
trigger_method_id
</string>
</key>
<value>
<tuple>
<string>
stop
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
trigger_once_per_transaction
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_crm/WorkflowTemplateItem/portal_workflow/slapos_crm_interaction_workflow/script_Base_triggerCheckStoppedEventToDeliver.py
0 → 100644
View file @
4ba19bd4
event
=
state_change
[
'object'
]
return
event
.
Base_reindexAndSenseAlarm
([
'slapos_crm_check_stopped_event_to_deliver'
])
master/bt5/slapos_crm/WorkflowTemplateItem/portal_workflow/slapos_crm_interaction_workflow/script_Base_triggerCheckStoppedEventToDeliver.xml
0 → 100644
View file @
4ba19bd4
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Workflow Script"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</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>
_params
</string>
</key>
<value>
<string>
state_change
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
script_Base_triggerCheckStoppedEventToDeliver
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Workflow Script
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSCodingStyle.py
View file @
4ba19bd4
...
...
@@ -123,6 +123,7 @@ def makeTestSlapOSCodingStyleTestCase(tested_business_template):
'slapos_crm_monitoring/SupportRequest_getMonitorUrl'
,
'slapos_crm_monitoring/SupportRequest_recheckMonitoring'
,
'slapos_crm_monitoring/Event_checkCustomerAsSourceOrDestinationConsistency'
,
'slapos_crm_monitoring/Event_checkStoppedToDeliver'
,
'slapos_crm_monitoring/Project_createSupportRequestWithCausality'
,
'slapos_crm/RegularisationRequest_afterClone'
,
'slapos_crm/RegularisationRequest_getResourceItemList'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment