acs_sc::impl::new_from_spec (public)
acs_sc::impl::new_from_spec -spec spec
Defined in packages/acs-service-contract/tcl/implementation-procs.tcl
Add new service contract implementation from an array-list style implementation, and binds it to the specified contract.
The specification takes the following form:
And here's the explanation:set spec { contract_name "Action_SideEffect" owner "bug-tracker" name "CaptureResolutionCode" pretty_name "Capture Resolution Code" aliases { GetObjectType bug_tracker::bug::object_type GetPrettyName bug_tracker::bug::capture_resolution_code::pretty_name DoSideEffect bug_tracker::bug::capture_resolution_code::do_side_effect } } acs_sc::impl::new_from_spec -spec $specThe spec is an array-list with the following entries:
The aliases section is itself an array-list. The keys are the operation names from the service contract. The values are the names of Tcl procedures in your package, which implement these operations.
- contract_name: The name of the service contract you're implementing.
- owner: Owner of the implementation, use the package-key.
- name: Name of your implementation.
- name: Pretty name of your implementation. You'd typically use this when displaying the service contract implementation through a UI.
- aliases: Specification of the Tcl procedures for each of the service contract's operations.
- Switches:
- -spec (required)
- The specification for the new service contract implementation.
- Returns:
- the impl_id of the newly registered implementation
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- acs_sc_impl_new_from_spec
Source code: # Spec contains: contract_name, name, pretty_name, owner, aliases array set impl $spec if { ![info exists impl(pretty_name)] } { set impl(pretty_name) "" } db_transaction { set impl_id [new -contract_name $impl(contract_name) -name $impl(name) -pretty_name $impl(pretty_name) -owner $impl(owner)] acs_sc::impl::alias::parse_aliases_spec -contract_name $impl(contract_name) -impl_name $impl(name) -spec $impl(aliases) acs_sc::impl::binding::new -contract_name $impl(contract_name) -impl_name $impl(name) } # Initialize the procs so we can start calling them right away acs_sc::impl::binding::init_procs -impl_id $impl_id return $impl_idGeneric XQL file: packages/acs-service-contract/tcl/implementation-procs.xql
PostgreSQL XQL file: packages/acs-service-contract/tcl/implementation-procs-postgresql.xql
Oracle XQL file: packages/acs-service-contract/tcl/implementation-procs-oracle.xql