postgresql7.1
select workflow__create_workflow(
'[db_quote $workflow_key]',
'[db_quote $workflow_name]',
'[db_quote $workflow_name]',
'[db_quote $workflow_description]',
'[db_quote $workflow_cases_table]',
'case_id'
);
begin
insert into wf_transition_attribute_map
select '[db_quote $workflow_key]' as workflow_key,
'[db_quote $transition_key]' as transition_key,
workflow__create_attribute(
'[db_quote $workflow_key]',
'[db_quote $task($transition_key,loop_attribute_name)]',
'boolean',
'[db_quote "$task($transition_key,loop_question)"]',
null,
null,
null,
'[ad_decode $task($transition_key,loop_answer) "t" "f" "t"]',
1,
1,
null,
'generic',
'none'
) as attribute_id,
1 as sortorder;
return null;
end;
select tgconstrname::text from pg_trigger
insert into wf_arcs (workflow_key, transition_key, place_key, direction,
guard_callback, guard_custom_arg, guard_description)
values ('[db_quote $workflow_key]', '[db_quote $transition_key]', '[db_quote $true_place]', 'out',
'wf_callback__guard_attribute_true', '[db_quote $task($transition_key,loop_attribute_name)]',
'[db_quote $task($transition_key,loop_question)]')