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
0
Merge Requests
0
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
Eric Zheng
slapos.core
Commits
f6ec2e39
Commit
f6ec2e39
authored
Sep 25, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Building accounting history.
parent
e3b21466
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
486 additions
and
1 deletion
+486
-1
master/bt5/vifib_slapos_accounting/PortalTypeBaseCategoryTemplateItem/base_category_list.xml
...PortalTypeBaseCategoryTemplateItem/base_category_list.xml
+3
-0
master/bt5/vifib_slapos_accounting/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
...rtalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
+4
-0
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/installation_accounting_slap_interaction_workflow.xml
...low/installation_accounting_slap_interaction_workflow.xml
+46
-0
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/installation_accounting_slap_interaction_workflow/interactions.xml
...ion_accounting_slap_interaction_workflow/interactions.xml
+28
-0
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/installation_accounting_slap_interaction_workflow/interactions/change_installation_promise_state.xml
...rkflow/interactions/change_installation_promise_state.xml
+97
-0
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/installation_accounting_slap_interaction_workflow/scripts.xml
...allation_accounting_slap_interaction_workflow/scripts.xml
+28
-0
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/installation_accounting_slap_interaction_workflow/scripts/Installation_changePromiseState.xml
...tion_workflow/scripts/Installation_changePromiseState.xml
+114
-0
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/installation_accounting_slap_interaction_workflow/scripts/Installation_createPurchasePackingList.xml
...rkflow/scripts/Installation_createPurchasePackingList.xml
+118
-0
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/installation_accounting_slap_interaction_workflow/variables.xml
...lation_accounting_slap_interaction_workflow/variables.xml
+22
-0
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/installation_accounting_slap_interaction_workflow/worklists.xml
...lation_accounting_slap_interaction_workflow/worklists.xml
+22
-0
master/bt5/vifib_slapos_accounting/bt/revision
master/bt5/vifib_slapos_accounting/bt/revision
+1
-1
master/bt5/vifib_slapos_accounting/bt/template_portal_type_base_category_list
...pos_accounting/bt/template_portal_type_base_category_list
+1
-0
master/bt5/vifib_slapos_accounting/bt/template_portal_type_workflow_chain_list
...os_accounting/bt/template_portal_type_workflow_chain_list
+1
-0
master/bt5/vifib_slapos_accounting/bt/template_workflow_id_list
.../bt5/vifib_slapos_accounting/bt/template_workflow_id_list
+1
-0
No files found.
master/bt5/vifib_slapos_accounting/PortalTypeBaseCategoryTemplateItem/base_category_list.xml
View file @
f6ec2e39
...
...
@@ -2,6 +2,9 @@
<portal_type
id=
"Slave Instance"
>
<item>
causality
</item>
</portal_type>
<portal_type
id=
"Software Installation"
>
<item>
causality
</item>
</portal_type>
<portal_type
id=
"Software Instance"
>
<item>
causality
</item>
</portal_type>
...
...
master/bt5/vifib_slapos_accounting/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
View file @
f6ec2e39
...
...
@@ -3,6 +3,10 @@
<type>
Slave Instance
</type>
<workflow>
instance_accounting_slap_interaction_workflow
</workflow>
</chain>
<chain>
<type>
Software Installation
</type>
<workflow>
installation_accounting_slap_interaction_workflow
</workflow>
</chain>
<chain>
<type>
Software Instance
</type>
<workflow>
instance_accounting_slap_interaction_workflow
</workflow>
...
...
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/installation_accounting_slap_interaction_workflow.xml
0 → 100644
View file @
f6ec2e39
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"InteractionWorkflowDefinition"
module=
"Products.ERP5.InteractionWorkflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_objects
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
creation_guard
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
groups
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
installation_accounting_slap_interaction_workflow
</string>
</value>
</item>
<item>
<key>
<string>
manager_bypass
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Accounting workflow for interaction with Software Installation changes
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/installation_accounting_slap_interaction_workflow/interactions.xml
0 → 100644
View file @
f6ec2e39
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Interaction"
module=
"Products.ERP5.Interaction"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_mapping
</string>
</key>
<value>
<dictionary/>
</value>
</item>
<item>
<key>
<string>
_objects
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
interactions
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/installation_accounting_slap_interaction_workflow/interactions/change_installation_promise_state.xml
0 → 100644
View file @
f6ec2e39
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"InteractionDefinition"
module=
"Products.ERP5.Interaction"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
actbox_category
</string>
</key>
<value>
<string>
workflow
</string>
</value>
</item>
<item>
<key>
<string>
actbox_name
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
actbox_url
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
activate_script_name
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
after_script_name
</string>
</key>
<value>
<list>
<string>
Installation_changePromiseState
</string>
</list>
</value>
</item>
<item>
<key>
<string>
before_commit_script_name
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
guard
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
change_installation_promise_state
</string>
</value>
</item>
<item>
<key>
<string>
method_id
</string>
</key>
<value>
<list>
<string>
requestStart
</string>
<string>
requestDestroy
</string>
</list>
</value>
</item>
<item>
<key>
<string>
once_per_transaction
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
portal_type_filter
</string>
</key>
<value>
<list>
<string>
Software Installation
</string>
</list>
</value>
</item>
<item>
<key>
<string>
script_name
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
temporary_document_disallowed
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
trigger_type
</string>
</key>
<value>
<int>
2
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/installation_accounting_slap_interaction_workflow/scripts.xml
0 → 100644
View file @
f6ec2e39
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Scripts"
module=
"Products.DCWorkflow.Scripts"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_mapping
</string>
</key>
<value>
<dictionary/>
</value>
</item>
<item>
<key>
<string>
_objects
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
scripts
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/installation_accounting_slap_interaction_workflow/scripts/Installation_changePromiseState.xml
0 → 100644
View file @
f6ec2e39
<?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>
installation = state_change[\'object\']\n
portal = installation.getPortalObject()\n
isTransitionPossible = portal.portal_workflow.isTransitionPossible\n
\n
# Get latest workflow transition\n
state = installation.getSlapState()\n
started = "start_requested"\n
destroyed = "destroy_requested"\n
assert state in [started, destroyed]\n
script.log(state)\n
# Get all needed services\n
setup_service_relative_url = portal.portal_preferences.getPreferredSoftwareSetupResource()\n
setup_service = portal.restrictedTraverse(setup_service_relative_url)\n
cleanup_service_relative_url = portal.portal_preferences.getPreferredSoftwareCleanupResource()\n
cleanup_service = portal.restrictedTraverse(cleanup_service_relative_url)\n
\n
# Get current delivery\n
delivery = installation.getCausalityValue(portal_type=["Purchase Packing List"])\n
if delivery is None:\n
delivery = context.Installation_createPurchasePackingList(state_change, setup_service_relative_url)\n
\n
delivery_line = delivery.contentValues(portal_type=["Purchase Packing List Line"])[0]\n
resource = delivery_line.getResource()\n
\n
if state == destroyed:\n
comment = \'Software Release request destruction.\'\n
if resource == setup_service_relative_url:\n
if isTransitionPossible(delivery, \'confirm\'):\n
delivery.confirm(comment=comment)\n
if isTransitionPossible(delivery, \'start\'):\n
delivery.start(comment=comment)\n
if isTransitionPossible(delivery, \'stop\'):\n
delivery.stop(comment=comment)\n
if isTransitionPossible(delivery, \'deliver\'):\n
delivery.deliver(comment=comment)\n
delivery = context.Installation_createPurchasePackingList(state_change, cleanup_service_relative_url)\n
if isTransitionPossible(delivery, \'confirm\'):\n
delivery.confirm(comment=comment)\n
elif state == started:\n
if resource == setup_service_relative_url:\n
if isTransitionPossible(delivery, \'confirm\'):\n
delivery.confirm(comment=comment)\n
else:\n
# nothing to do in case if cleanup was\n
pass\n
\n
if installation.getCausality(portal_type=\'Purchase Packing List\') != delivery.getRelativeUrl():\n
installation.setCausality(delivery.getRelativeUrl())\n
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
state_change
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Installation_changePromiseState
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/installation_accounting_slap_interaction_workflow/scripts/Installation_createPurchasePackingList.xml
0 → 100644
View file @
f6ec2e39
<?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
encoding=
"cdata"
>
<![CDATA[
from Products.ZSQLCatalog.SQLCatalog import Query, ComplexQuery\n
installation = state_change[\'object\']\n
# Get required arguments\n
\n
software_release_document = installation.Base_getSoftwareReleaseDocument(installation.getUrlString())\n
if software_release_document is None:\n
raise NotImplemnetedError(\'Software Release %r not ready yet\' % instance.getUrlString())\n
\n
\n
portal = installation.getPortalObject()\n
computer = installation.getAggregateValue(portal_type=\'Computer\')\n
\n
\n
tag = \'SoftwareInstallation_%s_software_release_%s_change\' % (installation.getUid(), software_release_document.getUid())\n
if portal.portal_activities.countMessageWithTag(tag) >
0:\n
raise NotImplementedError(\'In progress\')\n
activate_kw = {\'tag\': tag}\n
\n
# XXX Hardcoded values\n
person = portal.ERP5Site_getAuthenticatedMemberPersonValue()\n
\n
packing_list_portal_type = "Purchase Packing List"\n
module = portal.getDefaultModule(portal_type=packing_list_portal_type)\n
packing_list = module.newContent(\n
portal_type=packing_list_portal_type,\n
start_date=DateTime(),\n
destination_value=person,\n
destination_section_value=person,\n
destination_decision_value=person,\n
source_administration_value=person,\n
# XXX Hardcoded values\n
source="organisation_module/vifib_internet",\n
source_section="organisation_module/vifib_internet",\n
price_currency="currency_module/EUR",\n
activate_kw=activate_kw\n
)\n
packing_list.newContent(\n
portal_type="Purchase Packing List Line",\n
resource=service,\n
aggregate_value_list=[software_release_document, computer, installation],\n
quantity=1,\n
activate_kw=activate_kw\n
)\n
\n
packing_list.confirm(activate_kw=activate_kw)\n
packing_list.startBuilding()\n
\n
return packing_list\n
]]>
</string>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
state_change, service
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Installation_createPurchasePackingList
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/installation_accounting_slap_interaction_workflow/variables.xml
0 → 100644
View file @
f6ec2e39
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Variables"
module=
"Products.DCWorkflow.Variables"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_mapping
</string>
</key>
<value>
<dictionary/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
variables
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/installation_accounting_slap_interaction_workflow/worklists.xml
0 → 100644
View file @
f6ec2e39
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Worklists"
module=
"Products.DCWorkflow.Worklists"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_mapping
</string>
</key>
<value>
<dictionary/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
worklists
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_slapos_accounting/bt/revision
View file @
f6ec2e39
29
\ No newline at end of file
30
\ No newline at end of file
master/bt5/vifib_slapos_accounting/bt/template_portal_type_base_category_list
View file @
f6ec2e39
Slave Instance | causality
Software Installation | causality
Software Instance | causality
\ No newline at end of file
master/bt5/vifib_slapos_accounting/bt/template_portal_type_workflow_chain_list
View file @
f6ec2e39
Slave Instance | instance_accounting_slap_interaction_workflow
Software Installation | installation_accounting_slap_interaction_workflow
Software Instance | instance_accounting_slap_interaction_workflow
\ No newline at end of file
master/bt5/vifib_slapos_accounting/bt/template_workflow_id_list
View file @
f6ec2e39
installation_accounting_slap_interaction_workflow
instance_accounting_slap_interaction_workflow
\ No newline at end of file
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