Ricardo Alves a écrit :
> Andreas Jung wrote:
> Hi there,
> 
> is there a way to determine the workflow id(s) associated with an
> instance of a content-type? Background: with placework workflows each
> instance of a content-type may have a different workflow..what is the
> way to figure out the related workflow id(s)?
> 
>> I'd use something like this:
> 
>> for the workflow id:
> 
>>>>> wf_tool.getChainFor(obj)[0]
> 
> 
>> for the workflow object:
> 
>>>>> wf_tool.getWorkflowsFor(obj)[0]
> 
> 
> 
>> Of, course, if there may be no workflow defined, this code must be more
>> defensive.

You can have several workflows for an object, that's why it returns a tuple.
The first is private. The second one needs 'Manage Portal' rights and use the 
first to returns only workflow objects.

-- 
Encolpe Degoute
INGENIWEB (TM) - S.A.S 50000 Euros - RC B 438 725 632
Bureaux de la Colline
1 rue Royal
92210 Saint Cloud
web : www.ingeniweb.com - « les Services Web Ingénieux »
Tel : 01.78.15.24.08 / Fax : 01 47 57 39 14


_______________________________________________
Product-Developers mailing list
[email protected]
http://lists.plone.org/mailman/listinfo/product-developers

Reply via email to