|
From: Sinang, D. <D.S...@sp...> - 2006-08-10 08:45:18
|
Dear Marco,
Am getting this error :
Error Type: AttributeError
Error Value: RECEIPT_OF_SOURCE_DOCUMENTS
=20
"RECEIPT_OF_SOURCE_DOCUMENTS" is the activity following "Begin" .
Regards,
Danny
-----Original Message-----
From: Marco Bizzarri [mailto:m.b...@ic...]=20
Sent: Thursday, August 10, 2006 4:18 PM
To: Sinang, Danny
Cc: ope...@li...
Subject: Re: [Openflow-dev] The id "s5/begin" contains characters
illegal in URLs
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 =3D container.GeneralWorkflow
results =3D wf.Catalog(meta_type=3D'Activity')
for metadata in result:
if metadata.id !=3D 'Begin' and metadata.id !=3D '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 =3D container.GeneralWorkflow
results =3D wf.Catalog(meta_type=3D'Transition')
for metadata in result:
t =3D metadata.getObject()
From =3D t.From
To =3D t.To
if From not in ('Begin', 'End):
From =3D From.lower()
if To not in ('Begin', 'End'):
To =3D 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=20
> illegal in URLs
>
> Ok, I got the original mail.
>
> Here what you could do in the script
>
> wf =3D container.GeneralWorkflow
>
> results =3D wf.Catalog(meta_type=3D'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=20
> not sure I grabbed it.
>
> Regards
> Marco
>
> Sinang, Danny ha scritto:
> =20
>> Hello,
>>
>> The Zope mailing list guys can't figure this out, and referred me to=20
>> you.
>>
>> Hope someone here can help.
>>
>> Regards,
>> Danny
>>
>> -----Original Message-----
>> From: zop...@zo... [mailto:zop...@zo...] On Behalf=20
>> 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=20
>> URLs
>>
>>
>> =20
>> =20
>>> You must call manage_renameObject on the object *container*, passing
>>> =20
>>> =20
>> the old name and the new name. Something like this:
>>
>> =20
>> =20
>>> object =3D result[1]
>>> container =3D object.aq_parent
>>> container.manage_renameObject(object.id, object.id.lower())
>>> =20
>>> =20
>> 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=20
>> OpenFlow or Zope - not really sure.
>>
>> In any case, I tried skipping it, but ran into another error message=20
>> saying :
>>
>> /////////////////////////////////////////////////////////////////////
>> / / The object RECEIPT_OF_SOURCE_DOCUMENTS does not support this=20
>> operation.
>> /////////////////////////////////////////////////////////////////////
>> /
>> /
>>
>> My code looks like this :
>>
>> /////////////////////////////////////////////////////////////////////
>> /
>> //
>> /
>>
>> wf =3D container.GeneralWorkflow
>> catalog =3D wf.Catalog
>>
>> results =3D catalog.ZopeFind(wf, obj_metatypes=3D['Activity'],
>> search_sub=3D1)
>>
>>
>> for result in results:
>> print result[1].id
>> if result[1].id <> 'Begin':
>> object =3D result[1]
>> container =3D 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,=20
>> security?
>> Get stuff done quickly with pre-integrated technology to make your=20
>> job
>> =20
>
> =20
>> easier Download IBM WebSphere Application Server v.1.0.1 based on=20
>> Apache Geronimo
>> =
http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D=
121
>> 6
>> 42 _______________________________________________
>> Openflow-dev mailing list
>> Ope...@li...
>> https://lists.sourceforge.net/lists/listinfo/openflow-dev
>> =20
>> =20
>
>
> ----------------------------------------------------------------------
> --- Using Tomcat but need to do more? Need to support web services,=20
> 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=20
> Apache Geronimo
> =
http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D120709&bid=3D263057&dat=3D=
1216
> 42 _______________________________________________
> Openflow-dev mailing list
> Ope...@li...
> https://lists.sourceforge.net/lists/listinfo/openflow-dev
> =20
|