insert into workflow_action_allowed_roles
select :action_id,
(select role_id
from workflow_roles
where workflow_id = :workflow_id
and short_name = :allowed_role) as role_id
insert into workflow_action_privileges
(action_id, privilege)
values (:action_id, :privilege)
select assigned_role
from workflow_actions
where action_id = :action_id
select role_id
from workflow_action_allowed_roles
where action_id = :action_id
select privilege
from workflow_action_privileges
where action_id = :action_id
select action_id
from workflow_actions
where workflow_id = :workflow_id
and short_name = :short_name
insert into workflow_actions
select :action_id,
:workflow_id,
:sort_order,
:short_name,
:pretty_name,
:pretty_past_tense,
:assigned_role_id,
:always_enabled_p
select new_state
from workflow_fsm_actions a
where action_id = :action_id