Forum OpenACS Q&A: Re: Service contract Tcl API

Collapse
Posted by Jeff Davis on
I like the first form since it does not include an almost infinite number of backslashes. I also don't really think there will be that many cases where the operation list will be built dynamically and hence need interpolation etc.) The first form is much easier to read.

I think a few modifications would be desirable. Lose nargs (computers are pretty good at counting :) ). Also the arg names are less clear than they could be.


acs_sc::contract::new 
    -name [workflow::service_contract::role_default_assignee] \
    -description "Service contract to get the default assignees for a role from parameters case_id, object_id and role_id" 
    -operations {
        GetAssignees {
            description "Get the assignees as a Tcl list of party_ids, of the default assignees for this case, object, role"
            inputs {case_id:integer,object_id:integer,role_id:integer}
            outputs {party_ids:[integer]}
            iscachable_p "f"
        }

        ...
    }