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

declare
  add_arc__workflow_key		alias for $1;
  add_arc__from_place_key	alias for $2;
  add_arc__to_transition_key	alias for $3;
begin
  perform workflow__add_arc(
	    add_arc__workflow_key,
	    add_arc__to_transition_key,
	    add_arc__from_place_key,
	    'in',
	    null,
	    null,
	    null
	  );	 

  return 0;
end;$$ language plpgsql;


--
-- workflow__add_arc/6
--
create or replace function workflow__add_arc(
  character varying,
  character varying,
  character varying,
  character varying,
  character varying,
  character varying
) returns int4 as $$

declare
  add_arc__workflow_key		alias for $1;
  add_arc__from_transition_key	alias for $2;
  add_arc__to_place_key		alias for $3;
  add_arc__guard_callback	alias for $4;
  add_arc__guard_custom_arg	alias for $5;
  add_arc__guard_description	alias for $6;
begin
  perform workflow__add_arc (
	    add_arc__workflow_key,
	    add_arc__from_transition_key,
	    add_arc__to_place_key,
	    'out',
	    add_arc__guard_callback,
	    add_arc__guard_custom_arg,
	    add_arc__guard_description
	  );

  return 0;
end;$$ language plpgsql;


--
-- workflow__add_arc/7
--
create or replace function workflow__add_arc(
  character varying,
  character varying,
  character varying,
  character varying,
  character varying,
  character varying,
  character varying
) returns int4 as $$

declare
  add_arc__workflow_key            alias for $1;  
  add_arc__transition_key          alias for $2;  
  add_arc__place_key               alias for $3;  
  add_arc__direction               alias for $4;  
  add_arc__guard_callback          alias for $5;  -- default null  
  add_arc__guard_custom_arg        alias for $6;  -- default null
  add_arc__guard_description       alias for $7;  -- default null
begin
        insert into wf_arcs (workflow_key, transition_key, place_key, direction,
        guard_callback, guard_custom_arg, guard_description)
        values (add_arc__workflow_key, add_arc__transition_key, add_arc__place_key, add_arc__direction,
        add_arc__guard_callback, add_arc__guard_custom_arg, add_arc__guard_description);

        return 0; 
end;$$ language plpgsql;