-
Notifications
You must be signed in to change notification settings - Fork 2
/
conductor.install
161 lines (159 loc) · 5.97 KB
/
conductor.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
<?php
/**
* @file
* Manages the schema for conductor.
*
* TODO: We may want to create a permanent record of each workflow activity having
* been processed for administrative listings.
*/
/**
* Implements hook_schema().
*/
function conductor_schema() {
$schema['conductor_workflow'] = array(
'description' => 'Stores the general data for a view.',
'export' => array(
'identifier' => 'workflow',
'bulk export' => TRUE,
'primary key' => 'wid',
'key' => 'name',
'default hook' => 'default_conductor_workflows',
'admin_title' => 'human_name',
'admin_description' => 'description',
'api' => array(
'owner' => 'conductor',
'api' => 'conductor',
'minimum_version' => '0',
'current_version' => '1.0',
),
'object' => 'ConductorWorkflow',
// the variable that holds enabled/disabled status
'status' => 'conductor_workflows_defaults',
'create callback' => 'conductor_new_workflow',
'save callback' => 'conductor_save_workflow',
'load callback' => 'conductor_load_workflow',
'delete callback' => 'conductor_delete_workflow',
'export callback' => 'conductor_export_workflow',
//'cache defaults' => TRUE,
//'default cache bin' => 'cache_conductor_data',
),
'fields' => array(
'wid' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'The workflow ID of the field, defined by the database.',
'no export' => TRUE,
),
'name' => array(
'type' => 'varchar',
'length' => '32',
'default' => '',
'not null' => TRUE,
'description' => 'The unique name of the workflow. This is the primary field workflows are loaded from, and is used so that workflows may be internal and not necessarily in the database. May only be alphanumeric characters plus underscores.',
),
'title' => array(
'type' => 'varchar',
'length' => '32',
'default' => '',
'not null' => TRUE,
'description' => 'The human readable name of the workflow.',
),
'description' => array(
'type' => 'varchar',
'length' => '255',
'default' => '',
'description' => 'A description of the workflow for the admin interface.',
),
'activities' => array(
'type' => 'text',
'size' => 'big',
'description' => 'A serialized representation of this workflow.',
'serialize' => TRUE,
'serialized default' => 'a:0:{}',
'no export' => TRUE,
),
),
'primary key' => array('wid'),
'unique keys' => array('name' => array('name')),
);
$schema['cache_conductor_data'] = drupal_get_schema_unprocessed('system', 'cache');
$schema['cache_conductor_data']['description'] = 'Cache table for conductor to store pre-rendered queries, results, and display output.';
$schema['cache_conductor_data']['fields']['serialized']['default'] = 1;
$schema['conductor_instance'] = array(
'description' => t('Stores conductor for workflows currently being processed.'),
'fields' => array(
'id' => array(
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'The workflow instance state ID of the field, defined by the database.',
'no export' => TRUE,
),
'workflow_name' => array(
'type' => 'varchar',
'length' => '32',
'default' => '',
'not null' => TRUE,
'description' => 'The unique name of the workflow. This is the primary field workflows are loaded from, and is used so that workflows may be internal and not necessarily in the database. May only be alphanumeric characters plus underscores.',
),
'data' => array(
'type' => 'text',
'size' => 'big',
'description' => 'A serialized representation of this workflow preventing the workflow of this item from changing.',
'serialize' => TRUE,
'serialized default' => 'a:0:{}',
),
),
'primary key' => array('id'),
);
$schema['conductor_instance_pointer'] = array(
'description' => 'A conductor instance pointer is a record of the machine name of an individual activity in a workflow state to allow for easy resuming.',
'fields' => array(
'pid' => array(
'description' => 'A unique id for this table.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
'no export' => TRUE,
),
'pointer_key' => array(
'description' => 'The unique name of the state. This is the primary field workflow states are loaded from, and is used so that workflows may be found easily when they need to be resumed.',
'type' => 'varchar',
'length' => '255',
),
'workflow_name' => array(
'description' => 'The workflow machine name of the workflow this state is an instance of.',
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
),
'sid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'description' => 'The {conductor_instance}.sid of the workflow this state item belongs to.',
'no export' => TRUE,
),
'activity_name' => array(
'description' => 'The unique name of the activity this reference points to allowing processes needing to resume a running workflow to pass new data to the appropriate activity upon resume.',
'type' => 'varchar',
'length' => '255',
'not null' => TRUE,
),
'data' => array(
'description' => 'A serialized representation of this workflow\'s entities at the time this workflow was started.',
'type' => 'text',
'size' => 'big',
'serialize' => TRUE,
'serialized default' => 'a:0:{}',
'no export' => TRUE,
),
),
'primary key' => array('pid'),
'indexes' => array(
'pointer_key' => array('pointer_key'),
),
);
return $schema;
}