--
-- workflow__delete_trans_attribute_map/3
--
create or replace function workflow__delete_trans_attribute_map(
  character varying,
  character varying,
  integer
) returns int4 as $$

declare
  p_workflow_key		alias for $1;
  p_transition_key		alias for $2;
  p_attribute_id            alias for $3;
begin
        delete
          from wf_transition_attribute_map
         where workflow_key = p_workflow_key
           and transition_key = p_transition_key
           and attribute_id = p_attribute_id;

  return 0;
end;$$ language plpgsql;


--
-- workflow__delete_trans_attribute_map/3
--
create or replace function workflow__delete_trans_attribute_map(
  character varying,
  character varying,
  character varying
) returns int4 as $$

declare
  p_workflow_key		alias for $1;
  p_transition_key		alias for $2;
  p_attribute_name		alias for $3;
  v_attribute_id		integer;
begin
        select attribute_id
          into v_attribute_id
          from acs_attributes
         where object_type = p_workflow_key
           and attribute_name = p_attribute_name;

        delete
          from wf_transition_attribute_map
         where workflow_key = p_workflow_key
           and transition_key = p_transition_key
           and attribute_id = v_attribute_id;

  return 0;
end;$$ language plpgsql;