acs_sc::contract::new_from_spec (public)
acs_sc::contract::new_from_spec -spec spec
Defined in packages/acs-service-contract/tcl/contract-procs.tcl
Takes a complete service contract specification and creates the new service contract.
The spec looks like this:
Here's the detailed explanation:set spec { name "Action_SideEffect" description "Get the name of the side effect to create action" operations { GetObjectTypes { description "Get the object types for which this implementation is valid." output { object_types:string,multiple } iscachable_p "t" } GetPrettyName { description "Get the pretty name of this implementation." output { pretty_name:string } iscachable_p "t" } DoSideEffect { description "Do the side effect" input { case_id:integer object_id:integer action_id:integer entry_id:integer } } } } acs_sc::contract::new_from_spec -spec $specThe spec should be an array-list with 3 entries:
The operations array-list has the operation name as key, and another array-list containing the specification for the operation as the value. That array-list has the following entries:
- name: The name of the service contract.
- description: A human-readable description.
- operations: An array-list of operations in this service contract.
- description: Human-readable description of the operation.
- input: Specification of the input to this operation.
- output: Specification of the output of this operation.
- iscachable_p: A 't' or 'f' for whether output from this service contract implementation should automatically be cached using util_memoize.
The format of the 'input' and 'output' specs is a Tcl list of parameter specs, each of which consist of name, colon (:), datatype plus an optional comma (,) and the flag 'multiple'.
- Switches:
- -spec (required)
- The service contract specification as described above.
- Returns:
- The contract_id of the newly created service contract.
- See Also:
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- acs_sc_impl_new_from_spec
Source code: # Default values array set contract { description "" } # Get the spec array set contract $spec db_transaction { set contract_id [new -name $contract(name) -description $contract(description)] acs_sc::contract::operation::parse_operations_spec -name $contract(name) -spec $contract(operations) } return $contract_idXQL Not present: Generic PostgreSQL XQL file: packages/acs-service-contract/tcl/contract-procs-postgresql.xql
Oracle XQL file: packages/acs-service-contract/tcl/contract-procs-oracle.xql