From 2a426a59f00c5d8e126765e5fcf886749a5fc011 Mon Sep 17 00:00:00 2001
From: Julien Muchembled <jm@nexedi.com>
Date: Mon, 28 Sep 2009 17:33:08 +0000
Subject: [PATCH] New base_type_workflow to define security on Base Types

git-svn-id: https://svn.erp5.org/repos/public/erp5/sandbox/portal_types@29261 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 .../workflow_chain_type.xml                   |   6 +
 .../portal_workflow/base_type_workflow.xml    |  67 +++++++++++
 .../base_type_workflow/scripts.xml            |  25 +++++
 .../base_type_workflow/states.xml             |  31 ++++++
 .../base_type_workflow/states/validated.xml   | 104 ++++++++++++++++++
 .../base_type_workflow/transitions.xml        |  31 ++++++
 .../base_type_workflow/variables.xml          |  31 ++++++
 .../base_type_workflow/variables/action.xml   |  67 +++++++++++
 .../base_type_workflow/variables/actor.xml    |  67 +++++++++++
 .../base_type_workflow/variables/comment.xml  |  67 +++++++++++
 .../variables/error_message.xml               |  51 +++++++++
 .../base_type_workflow/variables/history.xml  |  67 +++++++++++
 .../variables/portal_type.xml                 |  51 +++++++++
 .../base_type_workflow/variables/time.xml     |  67 +++++++++++
 .../base_type_workflow/worklists.xml          |  25 +++++
 product/ERP5/bootstrap/erp5_type/bt/revision  |   2 +-
 .../template_portal_type_workflow_chain_list  |   2 +
 .../erp5_type/bt/template_workflow_id_list    |   1 +
 18 files changed, 761 insertions(+), 1 deletion(-)
 create mode 100644 product/ERP5/bootstrap/erp5_type/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
 create mode 100644 product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow.xml
 create mode 100644 product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/scripts.xml
 create mode 100644 product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/states.xml
 create mode 100644 product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/states/validated.xml
 create mode 100644 product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/transitions.xml
 create mode 100644 product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables.xml
 create mode 100644 product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/action.xml
 create mode 100644 product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/actor.xml
 create mode 100644 product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/comment.xml
 create mode 100644 product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/error_message.xml
 create mode 100644 product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/history.xml
 create mode 100644 product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/portal_type.xml
 create mode 100644 product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/time.xml
 create mode 100644 product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/worklists.xml

diff --git a/product/ERP5/bootstrap/erp5_type/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml b/product/ERP5/bootstrap/erp5_type/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
new file mode 100644
index 0000000000..5118e99450
--- /dev/null
+++ b/product/ERP5/bootstrap/erp5_type/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
@@ -0,0 +1,6 @@
+<workflow_chain>
+ <chain>
+  <type>Base Type</type>
+  <workflow>edit_workflow, base_type_workflow</workflow>
+ </chain>
+</workflow_chain>
\ No newline at end of file
diff --git a/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow.xml b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow.xml
new file mode 100644
index 0000000000..305208de21
--- /dev/null
+++ b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="DCWorkflowDefinition" module="Products.DCWorkflow.DCWorkflow"/>
+        <tuple/>
+      </tuple>
+    </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>base_type_workflow</string> </value>
+        </item>
+        <item>
+            <key> <string>initial_state</string> </key>
+            <value> <string>validated</string> </value>
+        </item>
+        <item>
+            <key> <string>manager_bypass</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>permissions</string> </key>
+            <value>
+              <tuple>
+                <string>View</string>
+                <string>Add portal content</string>
+                <string>Modify portal content</string>
+              </tuple>
+            </value>
+        </item>
+        <item>
+            <key> <string>state_var</string> </key>
+            <value> <string>validation_state</string> </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Base Type Workflow</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/scripts.xml b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/scripts.xml
new file mode 100644
index 0000000000..ef17b83812
--- /dev/null
+++ b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/scripts.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="Scripts" module="Products.DCWorkflow.Scripts"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>_mapping</string> </key>
+            <value>
+              <dictionary/>
+            </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>scripts</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/states.xml b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/states.xml
new file mode 100644
index 0000000000..a21bb6e959
--- /dev/null
+++ b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/states.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="States" module="Products.DCWorkflow.States"/>
+        <tuple/>
+      </tuple>
+    </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>states</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/states/validated.xml b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/states/validated.xml
new file mode 100644
index 0000000000..c1462500ac
--- /dev/null
+++ b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/states/validated.xml
@@ -0,0 +1,104 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="StateDefinition" module="Products.DCWorkflow.States"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>validated</string> </value>
+        </item>
+        <item>
+            <key> <string>permission_roles</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>title</string> </key>
+            <value> <string>Validated</string> </value>
+        </item>
+        <item>
+            <key> <string>transitions</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+        <item>
+            <key> <string>type_list</string> </key>
+            <value>
+              <tuple/>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <global name="PersistentMapping" module="Persistence.mapping"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>data</string> </key>
+            <value>
+              <dictionary>
+                <item>
+                    <key> <string>Add portal content</string> </key>
+                    <value>
+                      <tuple>
+                        <string>Assignee</string>
+                        <string>Assignor</string>
+                        <string>Associate</string>
+                        <string>Author</string>
+                        <string>Manager</string>
+                        <string>Owner</string>
+                      </tuple>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>Modify portal content</string> </key>
+                    <value>
+                      <tuple>
+                        <string>Assignee</string>
+                        <string>Assignor</string>
+                        <string>Associate</string>
+                        <string>Author</string>
+                        <string>Manager</string>
+                        <string>Owner</string>
+                      </tuple>
+                    </value>
+                </item>
+                <item>
+                    <key> <string>View</string> </key>
+                    <value>
+                      <tuple>
+                        <string>Assignee</string>
+                        <string>Assignor</string>
+                        <string>Associate</string>
+                        <string>Auditor</string>
+                        <string>Author</string>
+                        <string>Manager</string>
+                        <string>Owner</string>
+                      </tuple>
+                    </value>
+                </item>
+              </dictionary>
+            </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/transitions.xml b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/transitions.xml
new file mode 100644
index 0000000000..092a5b48f6
--- /dev/null
+++ b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/transitions.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="Transitions" module="Products.DCWorkflow.Transitions"/>
+        <tuple/>
+      </tuple>
+    </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>transitions</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables.xml b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables.xml
new file mode 100644
index 0000000000..a067e6fbbe
--- /dev/null
+++ b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables.xml
@@ -0,0 +1,31 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="Variables" module="Products.DCWorkflow.Variables"/>
+        <tuple/>
+      </tuple>
+    </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>variables</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/action.xml b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/action.xml
new file mode 100644
index 0000000000..b6ab718b6e
--- /dev/null
+++ b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/action.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="VariableDefinition" module="Products.DCWorkflow.Variables"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>default_expr</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>default_value</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string>The last transition</string> </value>
+        </item>
+        <item>
+            <key> <string>for_catalog</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>for_status</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>action</string> </value>
+        </item>
+        <item>
+            <key> <string>info_guard</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>update_always</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <global name="Expression" module="Products.CMFCore.Expression"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>text</string> </key>
+            <value> <string>transition/getId|nothing</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/actor.xml b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/actor.xml
new file mode 100644
index 0000000000..63e83eebcc
--- /dev/null
+++ b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/actor.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="VariableDefinition" module="Products.DCWorkflow.Variables"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>default_expr</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>default_value</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string>The name of the user who performed the last transition</string> </value>
+        </item>
+        <item>
+            <key> <string>for_catalog</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>for_status</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>actor</string> </value>
+        </item>
+        <item>
+            <key> <string>info_guard</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>update_always</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <global name="Expression" module="Products.CMFCore.Expression"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>text</string> </key>
+            <value> <string>user/getUserName</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/comment.xml b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/comment.xml
new file mode 100644
index 0000000000..0deee79ddd
--- /dev/null
+++ b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/comment.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="VariableDefinition" module="Products.DCWorkflow.Variables"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>default_expr</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>default_value</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string>Comments about the last transition</string> </value>
+        </item>
+        <item>
+            <key> <string>for_catalog</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>for_status</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>comment</string> </value>
+        </item>
+        <item>
+            <key> <string>info_guard</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>update_always</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <global name="Expression" module="Products.CMFCore.Expression"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>text</string> </key>
+            <value> <string>python:state_change.kwargs.get(\'comment\', \'\')</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/error_message.xml b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/error_message.xml
new file mode 100644
index 0000000000..ca8bd983f6
--- /dev/null
+++ b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/error_message.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="VariableDefinition" module="Products.DCWorkflow.Variables"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>default_expr</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>default_value</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string>Error message if validation failed</string> </value>
+        </item>
+        <item>
+            <key> <string>for_catalog</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>for_status</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>error_message</string> </value>
+        </item>
+        <item>
+            <key> <string>info_guard</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>update_always</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/history.xml b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/history.xml
new file mode 100644
index 0000000000..33a2afbc9a
--- /dev/null
+++ b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/history.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="VariableDefinition" module="Products.DCWorkflow.Variables"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>default_expr</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>default_value</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string>Provides access to workflow history</string> </value>
+        </item>
+        <item>
+            <key> <string>for_catalog</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>for_status</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>history</string> </value>
+        </item>
+        <item>
+            <key> <string>info_guard</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>update_always</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <global name="Expression" module="Products.CMFCore.Expression"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>text</string> </key>
+            <value> <string>state_change/getHistory</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/portal_type.xml b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/portal_type.xml
new file mode 100644
index 0000000000..d1c833ff18
--- /dev/null
+++ b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/portal_type.xml
@@ -0,0 +1,51 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="VariableDefinition" module="Products.DCWorkflow.Variables"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>default_expr</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>default_value</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string>portal type (use as filter for worklists)</string> </value>
+        </item>
+        <item>
+            <key> <string>for_catalog</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+        <item>
+            <key> <string>for_status</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>portal_type</string> </value>
+        </item>
+        <item>
+            <key> <string>info_guard</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>update_always</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/time.xml b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/time.xml
new file mode 100644
index 0000000000..624cc5038c
--- /dev/null
+++ b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/variables/time.xml
@@ -0,0 +1,67 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="VariableDefinition" module="Products.DCWorkflow.Variables"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>default_expr</string> </key>
+            <value>
+              <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
+            </value>
+        </item>
+        <item>
+            <key> <string>default_value</string> </key>
+            <value> <string></string> </value>
+        </item>
+        <item>
+            <key> <string>description</string> </key>
+            <value> <string>Time of the last transition</string> </value>
+        </item>
+        <item>
+            <key> <string>for_catalog</string> </key>
+            <value> <int>0</int> </value>
+        </item>
+        <item>
+            <key> <string>for_status</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+        <item>
+            <key> <string>id</string> </key>
+            <value> <string>time</string> </value>
+        </item>
+        <item>
+            <key> <string>info_guard</string> </key>
+            <value>
+              <none/>
+            </value>
+        </item>
+        <item>
+            <key> <string>update_always</string> </key>
+            <value> <int>1</int> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+  <record id="2" aka="AAAAAAAAAAI=">
+    <pickle>
+      <tuple>
+        <global name="Expression" module="Products.CMFCore.Expression"/>
+        <tuple/>
+      </tuple>
+    </pickle>
+    <pickle>
+      <dictionary>
+        <item>
+            <key> <string>text</string> </key>
+            <value> <string>state_change/getDateTime</string> </value>
+        </item>
+      </dictionary>
+    </pickle>
+  </record>
+</ZopeData>
diff --git a/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/worklists.xml b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/worklists.xml
new file mode 100644
index 0000000000..1f8b17b012
--- /dev/null
+++ b/product/ERP5/bootstrap/erp5_type/WorkflowTemplateItem/portal_workflow/base_type_workflow/worklists.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0"?>
+<ZopeData>
+  <record id="1" aka="AAAAAAAAAAE=">
+    <pickle>
+      <tuple>
+        <global name="Worklists" module="Products.DCWorkflow.Worklists"/>
+        <tuple/>
+      </tuple>
+    </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>
diff --git a/product/ERP5/bootstrap/erp5_type/bt/revision b/product/ERP5/bootstrap/erp5_type/bt/revision
index d1cbcfa540..832332893a 100644
--- a/product/ERP5/bootstrap/erp5_type/bt/revision
+++ b/product/ERP5/bootstrap/erp5_type/bt/revision
@@ -1 +1 @@
-66
\ No newline at end of file
+67
\ No newline at end of file
diff --git a/product/ERP5/bootstrap/erp5_type/bt/template_portal_type_workflow_chain_list b/product/ERP5/bootstrap/erp5_type/bt/template_portal_type_workflow_chain_list
index e69de29bb2..1bab349166 100644
--- a/product/ERP5/bootstrap/erp5_type/bt/template_portal_type_workflow_chain_list
+++ b/product/ERP5/bootstrap/erp5_type/bt/template_portal_type_workflow_chain_list
@@ -0,0 +1,2 @@
+Base Type | base_type_workflow
+Base Type | edit_workflow
\ No newline at end of file
diff --git a/product/ERP5/bootstrap/erp5_type/bt/template_workflow_id_list b/product/ERP5/bootstrap/erp5_type/bt/template_workflow_id_list
index e69de29bb2..1adb7aa6a2 100644
--- a/product/ERP5/bootstrap/erp5_type/bt/template_workflow_id_list
+++ b/product/ERP5/bootstrap/erp5_type/bt/template_workflow_id_list
@@ -0,0 +1 @@
+base_type_workflow
\ No newline at end of file
-- 
2.30.9