|
From: Marco B. <m.b...@ic...> - 2006-08-10 08:17:39
|
When you get this error? I suspect when you try to start a process,
because you are no more able to find the "Begin" activity.
Let's try again:
Here what you could do in the script
wf = container.GeneralWorkflow
results = wf.Catalog(meta_type='Activity')
for metadata in result:
if metadata.id != 'Begin' and metadata.id != 'End:
wf.manage_renameObject(metadata.id, metadata.id.lower())
However, please note that this will not be enough: you will have to rename *ALSO* the transitions From and To attributes:
wf = container.GeneralWorkflow
results = wf.Catalog(meta_type='Transition')
for metadata in result:
t = metadata.getObject()
From = t.From
To = t.To
if From not in ('Begin', 'End):
From = From.lower()
if To not in ('Begin', 'End'):
To = To.lower()
t.edit(t.condition, From, To, t.description)
Regards
Marco
Not sure if the attributes from and to are instead From and To
Sinang, Danny ha scritto:
> Tried it, but got this error :
>
> Error Type: AttributeError
> Error Value: Begin
>
> -----Original Message-----
> From: Marco Bizzarri [mailto:m.b...@ic...]
> Sent: Thursday, August 10, 2006 3:55 PM
> To: Sinang, Danny
> Cc: ope...@li...
> Subject: Re: [Openflow-dev] The id "s5/begin" contains characters
> illegal in URLs
>
> Ok, I got the original mail.
>
> Here what you could do in the script
>
> wf = container.GeneralWorkflow
>
> results = wf.Catalog(meta_type='Activity')
>
> for metadata in result:
> wf.manage_renameObject(metadata.id, metadata.id.lower())
>
> Please, check if this work. Also, can you restate your problem? I'm not
> sure I grabbed it.
>
> Regards
> Marco
>
> Sinang, Danny ha scritto:
>
>> Hello,
>>
>> The Zope mailing list guys can't figure this out, and referred me to
>> you.
>>
>> Hope someone here can help.
>>
>> Regards,
>> Danny
>>
>> -----Original Message-----
>> From: zop...@zo... [mailto:zop...@zo...] On Behalf
>> Of Sinang, Danny
>> Sent: Thursday, August 10, 2006 3:02 PM
>> To: zo...@zo...
>> Subject: RE: [Zope] The id "s5/begin" contains characters illegal in
>> URLs
>>
>>
>>
>>
>>> You must call manage_renameObject on the object *container*, passing
>>>
>>>
>> the old name and the new name. Something like this:
>>
>>
>>
>>> object = result[1]
>>> container = object.aq_parent
>>> container.manage_renameObject(object.id, object.id.lower())
>>>
>>>
>> Thanks Gabriel.
>>
>> I did exactly as you suggested, but ran into this error :
>>
>> /////////////////////////////////////////////////
>> The id "begin" is invalid - it is already in use.
>> /////////////////////////////////////////////////
>>
>> "Begin" is the first activity. It could be some reserved word within
>> OpenFlow or Zope - not really sure.
>>
>> In any case, I tried skipping it, but ran into another error message
>> saying :
>>
>> //////////////////////////////////////////////////////////////////////
>> / The object RECEIPT_OF_SOURCE_DOCUMENTS does not support this
>> operation.
>> //////////////////////////////////////////////////////////////////////
>> /
>>
>> My code looks like this :
>>
>> //////////////////////////////////////////////////////////////////////
>> //
>> /
>>
>> wf = container.GeneralWorkflow
>> catalog = wf.Catalog
>>
>> results = catalog.ZopeFind(wf, obj_metatypes=['Activity'],
>> search_sub=1)
>>
>>
>> for result in results:
>> print result[1].id
>> if result[1].id <> 'Begin':
>> object = result[1]
>> container = object.aq_parent
>> container.manage_renameObject(object.id, object.id.lower())
>>
>> return printed
>>
>> //////////////////////////////////////////////////////////////////////
>> //
>> /
>>
>>
>> Regards,
>> Danny
>>
>> _______________________________________________
>> Zope maillist - Zo...@zo...
>> http://mail.zope.org/mailman/listinfo/zope
>> ** No cross posts or HTML encoding! **
>> (Related lists -
>> http://mail.zope.org/mailman/listinfo/zope-announce
>> http://mail.zope.org/mailman/listinfo/zope-dev )
>>
>> ----------------------------------------------------------------------
>> --- Using Tomcat but need to do more? Need to support web services,
>> security?
>> Get stuff done quickly with pre-integrated technology to make your job
>>
>
>
>> easier Download IBM WebSphere Application Server v.1.0.1 based on
>> Apache Geronimo
>> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=1216
>> 42 _______________________________________________
>> Openflow-dev mailing list
>> Ope...@li...
>> https://lists.sourceforge.net/lists/listinfo/openflow-dev
>>
>>
>
>
> -------------------------------------------------------------------------
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Openflow-dev mailing list
> Ope...@li...
> https://lists.sourceforge.net/lists/listinfo/openflow-dev
>
|