workflow::generate_short_name (public)

 workflow::generate_short_name -package_key package_key \
    [ -object_id object_id ] -pretty_name pretty_name \
    [ -short_name short_name ] [ -workflow_id workflow_id ]

Defined in packages/workflow/tcl/workflow-procs.tcl

Generate a unique short_name from pretty_name, or verify uniqueness of a given short_name.

Switches:
-package_key (required)
-object_id (optional)
-pretty_name (required)
-short_name (optional)
Suggested short_name.
-workflow_id (optional)
If you pass in this, we will allow that workflow's short_name to be reused.

Partial Call Graph (max 5 caller/called nodes):
%3 workflow::edit workflow::edit (public) workflow::generate_short_name workflow::generate_short_name workflow::edit->workflow::generate_short_name _ _ (public) workflow::generate_short_name->_ util_text_to_url util_text_to_url (public) workflow::generate_short_name->util_text_to_url workflow::get_existing_short_names workflow::get_existing_short_names (public) workflow::generate_short_name->workflow::get_existing_short_names

Testcases:
No testcase defined.
Source code:
    set existing_short_names [workflow::get_existing_short_names  -package_key $package_key  -object_id $object_id  -ignore_workflow_id $workflow_id]

    if { $short_name eq "" } {
        if { $pretty_name eq "" } {
            error "Cannot have empty pretty_name when short_name is empty"
        }
        set short_name [util_text_to_url  -replacement "_"  -existing_urls $existing_short_names  -text $pretty_name]
    } else {
        # Make lowercase, remove illegal characters
        set short_name [string tolower $short_name]
        regsub -all {[- ]} $short_name {_} short_name
        regsub -all {[^a-zA-Z_0-9]} $short_name {} short_name

        if {$short_name in $existing_short_names} {
            error "Workflow with short_name '$short_name' already exists for this package_key and object_id."
        }
    }

    return $short_name
Generic XQL file:
packages/workflow/tcl/workflow-procs.xql

PostgreSQL XQL file:
packages/workflow/tcl/workflow-procs-postgresql.xql

Oracle XQL file:
packages/workflow/tcl/workflow-procs-oracle.xql

[ hide source ] | [ make this the default ]
Show another procedure: