thinkwise-software-factory-subroutines

Creates and configures reusable SQL subroutines in Thinkwise Software Factory models.

5|Updated Aug 25, 2026
One-click install
npx skills add https://github.com/rkortThinkwise/sf-mcp-skills-temp --skill thinkwise-software-factory-subroutines-rkortthinkwise
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: thinkwise-software-factory-subroutines
Source: https://github.com/rkortThinkwise/sf-mcp-skills-temp/tree/main/thinkwise-software-factory-subroutines
Command: npx skills add https://github.com/rkortThinkwise/sf-mcp-skills-temp --skill thinkwise-software-factory-subroutines-rkortthinkwise

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Building reusable database business logic in a Thinkwise Software Factory model requires coordinating many entities — subroutine definitions, parameters, return columns, options, role rights, and control-procedure bodies — and mistakes in any of them produce routines that generate cleanly but fail or are uncallable at runtime. ## Core Features & Use Cases - Full subroutine lifecycle guidance: Covers creating the subroutine master row, adding subroutine_parmtr and subroutine_return_col children, setting type-specific options, and granting per-role execute rights via role_subroutine_overview.model_rights. - Contract-first design rules: Helps choose the right subroutine type (Function, Procedure, CLR, DB2 external), return shape (none/scalar/table), transaction behavior, and parameter domains before any rows are staged. - Call-site and API coverage: Documents every place a subroutine gets invoked — control procedures, views, tasks, process flows, and Indicium APIs — including naming, generation order, and error-contract conventions. - Use Case: Ask the assistant to create a table-valued function that returns available resources for a date range; it will confirm the contract, stage the subroutine and its return columns, write the body through the control-procedure flow, grant role rights, and generate the code. ## Quick Start Ask the assistant to create a subroutine in your Software Factory model, for example a scalar function that calculates an order total, and confirm the proposed type, parameters, and return shape when prompted.

Frequently Asked Questions about thinkwise-software-factory-subroutines

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a subroutine in Thinkwise Software Factory?

Create a subroutine row in the sf/manage_subroutines domain with a type and return shape, then add subroutine_parmtr rows for parameters and subroutine_return_col rows for table returns. Write the body through a control procedure and template, grant role rights, and generate the code.

What is the difference between a subroutine and a table-valued function tab in Thinkwise?

A subroutine with return_value = table is a callable routine with an explicit parameter list and no UI surface. A tab with type_of_table = function is a screen-viewable subject with columns, references, and tasks, generated as a function only so it can take parameters.

How do I grant role rights to execute a Thinkwise subroutine?

Role rights live in role_subroutine_overview.model_rights, keyed by role and subroutine. A row already exists for every role-subroutine combination, so find the existing row and set granted to true rather than adding a new one.

Can a Thinkwise process flow call a subroutine directly?

There is no dedicated call-subroutine process action. Use a decision action with use_processes enabled whose control procedure calls the subroutine, or an execute_task action whose task logic calls it.

Why does my generated subroutine fail even though generation reports success?

SQL Server's deferred name resolution lets procedures generate successfully while referencing objects that do not exist yet. Set generation_order_no so called subroutines generate first, and verify the generated text rather than trusting the status.

When should a Thinkwise subroutine be published as an API?

Enable api or basic_api only after designing a stable external contract: aliased service and parameter names, typed inputs, granted role authorization, tenant isolation, idempotency, and a versioning plan. Both flags are off by default.