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

declare
  create_attribute__workflow_key   alias for $1;  
  create_attribute__attribute_name alias for $2;  
  create_attribute__datatype       alias for $3;  
  create_attribute__pretty_name    alias for $4;  
  create_attribute__pretty_plural  alias for $5;  -- default null  
  create_attribute__table_name     alias for $6;  -- default null
  create_attribute__column_name    alias for $7;  -- default null
  create_attribute__default_value  alias for $8;  -- default null
  create_attribute__min_n_values   alias for $9;  -- default 1
  create_attribute__max_n_values   alias for $10; -- default 1
  create_attribute__sort_order     alias for $11; -- default null
  create_attribute__storage        alias for $12; -- default 'generic'
  v_attribute_id                   integer;        
begin
        v_attribute_id := acs_attribute__create_attribute(
            create_attribute__workflow_key,
            create_attribute__attribute_name,
            create_attribute__datatype,
            create_attribute__pretty_name,
            create_attribute__pretty_plural,
            create_attribute__table_name,
            create_attribute__column_name,
            create_attribute__default_value,
            create_attribute__min_n_values,
            create_attribute__max_n_values,
            create_attribute__sort_order,
            create_attribute__storage,
            'f'
        );

        return v_attribute_id;
     
end;$$ language plpgsql;