Creating objects using External method (Workflow related problem)

4 Messages Forum Options Options
Permalink
kralos123
Creating objects using External method (Workflow related problem)
Reply Threaded More
Print post
Permalink
Hi there.

I'm using an external method to create objects for product POI Issue Tracker.
The thing is that I'm using _createObjectByType(), but when I try to change the object's state to "in progress" automatically, the system returns that there is no workflow that provides this action.

So, I checked the initial state of the object created with this method and the state is "new", like "being created", but when I call the action "post" (as defined in my workflow), the system throws me the same error (no workflow provides that action)

If I call wftool.getInfoFor(context, 'review_state') to see the related transitions, I got nothing... just an empty dict [] for the state "new" (that state have 2 transitions defined in portal_workflow).

Is there something that i'm missing, like an special flag, or an event that updates the workflow for that item?

Thank you very much in advance!
PS: Sorry about my english!

Regards,
Carlos B.


eleddy
Re: Creating objects using External method (Workflow related problem)
Reply Threaded More
Print post
Permalink
I would start with the idea that you are creating the object with
something that starts with a "_" which is usually a no no :)  try
using the public facing versions of that function that plone is
official on (which I'm see you've already been here:
http://plone.org/documentation/tutorial/manipulating-plone-objects-programmatically/creating-items-and-setting-attributes
but I would go back there and rewrite first.

Is there a reason to use this factory method instead of the plethora
of others that are listed?

Also, I would double check that everything works through the regular
interface.

eleddy

On Jul 23, 10:16 am, kralos123 <cbra...@...> wrote:

> Hi there.
>
> I'm using an external method to create objects for product POI Issue
> Tracker.
> The thing is that I'm using _createObjectByType(), but when I try to change
> the object's state to "in progress" automatically, the system returns that
> there is no workflow that provides this action.
>
> So, I checked the initial state of the object created with this method and
> the state is "new", like "being created", but when I call the action "post"
> (as defined in my workflow), the system throws me the same error (no
> workflow provides that action)
>
> If I call wftool.getInfoFor(context, 'review_state') to see the related
> transitions, I got nothing... just an empty dict [] for the state "new"
> (that state have 2 transitions defined in portal_workflow).
>
> Is there something that i'm missing, like an special flag, or an event that
> updates the workflow for that item?
>
> Thank you very much in advance!
> PS: Sorry about my english!
>
> Regards,
> Carlos B.
>
> --
> View this message in context:http://n2.nabble.com/Creating-objects-using-External-method-%28Workfl...
> Sent from the General Questions mailing list archive at Nabble.com.
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the worldhttp://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Plone-Users mailing list
> Plone-Us...@...://lists.sourceforge.net/lists/listinfo/plone-users

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Plone-Users mailing list
Plone-Users@...
https://lists.sourceforge.net/lists/listinfo/plone-users
kralos123
Re: Creating objects using External method (Workflow related problem)
Reply Threaded More
Print post
Permalink
Thank you for your reply.
I'm using "_createObjectByType" because I have to bypass a POI Issue Tracker global_allow flag.
Using invokeFactory is not working because this flag.

I can create the object, but i can't change the workflow (no actions)... it's weird. It seems like the workflow doesn't update until something happens... is there any event or something that "tells" the workflow that the object has been created?

Thank you.
Regards
Carlos B.

eleddy wrote:
I would start with the idea that you are creating the object with
something that starts with a "_" which is usually a no no :)  try
using the public facing versions of that function that plone is
official on (which I'm see you've already been here:
http://plone.org/documentation/tutorial/manipulating-plone-objects-programmatically/creating-items-and-setting-attributes
but I would go back there and rewrite first.

Is there a reason to use this factory method instead of the plethora
of others that are listed?

Also, I would double check that everything works through the regular
interface.

eleddy

On Jul 23, 10:16 am, kralos123 <cbra...@gmail.com> wrote:
> Hi there.
>
> I'm using an external method to create objects for product POI Issue
> Tracker.
> The thing is that I'm using _createObjectByType(), but when I try to change
> the object's state to "in progress" automatically, the system returns that
> there is no workflow that provides this action.
>
> So, I checked the initial state of the object created with this method and
> the state is "new", like "being created", but when I call the action "post"
> (as defined in my workflow), the system throws me the same error (no
> workflow provides that action)
>
> If I call wftool.getInfoFor(context, 'review_state') to see the related
> transitions, I got nothing... just an empty dict [] for the state "new"
> (that state have 2 transitions defined in portal_workflow).
>
> Is there something that i'm missing, like an special flag, or an event that
> updates the workflow for that item?
>
> Thank you very much in advance!
> PS: Sorry about my english!
>
> Regards,
> Carlos B.
>
> --
> View this message in context:http://n2.nabble.com/Creating-objects-using-External-method-%28Workfl...
> Sent from the General Questions mailing list archive at Nabble.com.
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the worldhttp://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Plone-Users mailing list
> Plone-Us...@lists.sourceforge.nethttps://lists.sourceforge.net/lists/listinfo/plone-users

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Plone-Users mailing list
Plone-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plone-users
eleddy
Re: Creating objects using External method (Workflow related problem)
Reply Threaded More
Print post
Permalink
What do you mean by "bypass" the global allow flag? Maybe this is a
better approach to debug because if you are using a function that
starts with an underscore and you aren't writing in the class itself,
then you are accepting responsibility for whatever random things may
happen (i.e. workflow isn't invoked).

There are events that are invoked when created, but your object
creation should be taking care of this, as long as a default state is
selected.

eleddy

On Jul 25, 11:51 am, kralos123 <cbra...@...> wrote:

> Thank you for your reply.
> I'm using "_createObjectByType" because I have to bypass a POI Issue Tracker
> global_allow flag.
> Using invokeFactory is not working because this flag.
>
> I can create the object, but i can't change the workflow (no actions)...
> it's weird. It seems like the workflow doesn't update until something
> happens... is there any event or something that "tells" the workflow that
> the object has been created?
>
> Thank you.
> Regards
> Carlos B.
>
>
>
> eleddy wrote:
>
> > I would start with the idea that you are creating the object with
> > something that starts with a "_" which is usually a no no :)  try
> > using the public facing versions of that function that plone is
> > official on (which I'm see you've already been here:
> >http://plone.org/documentation/tutorial/manipulating-plone-objects-pr...
> > but I would go back there and rewrite first.
>
> > Is there a reason to use this factory method instead of the plethora
> > of others that are listed?
>
> > Also, I would double check that everything works through the regular
> > interface.
>
> > eleddy
>
> > On Jul 23, 10:16 am, kralos123 <cbra...@...> wrote:
> >> Hi there.
>
> >> I'm using an external method to create objects for product POI Issue
> >> Tracker.
> >> The thing is that I'm using _createObjectByType(), but when I try to
> >> change
> >> the object's state to "in progress" automatically, the system returns
> >> that
> >> there is no workflow that provides this action.
>
> >> So, I checked the initial state of the object created with this method
> >> and
> >> the state is "new", like "being created", but when I call the action
> >> "post"
> >> (as defined in my workflow), the system throws me the same error (no
> >> workflow provides that action)
>
> >> If I call wftool.getInfoFor(context, 'review_state') to see the related
> >> transitions, I got nothing... just an empty dict [] for the state "new"
> >> (that state have 2 transitions defined in portal_workflow).
>
> >> Is there something that i'm missing, like an special flag, or an event
> >> that
> >> updates the workflow for that item?
>
> >> Thank you very much in advance!
> >> PS: Sorry about my english!
>
> >> Regards,
> >> Carlos B.
>
> >> --
> >> View this message in
> >> context:http://n2.nabble.com/Creating-objects-using-External-method-%28Workfl...
> >> Sent from the General Questions mailing list archive at Nabble.com.
>
> >> -------------------------------------------------------------------------
> >> This SF.Net email is sponsored by the Moblin Your Move Developer's
> >> challenge
> >> Build the coolest Linux based applications with Moblin SDK & win great
> >> prizes
> >> Grand prize is a trip for two to an Open Source event anywhere in the
> >> worldhttp://moblin-contest.org/redirect.php?banner_id=100&url=/
> >> _______________________________________________
> >> Plone-Users mailing list
> >> Plone-Us...@...://lists.sourceforge.net/lists/listinfo/plone-users
>
> > -------------------------------------------------------------------------
> > This SF.Net email is sponsored by the Moblin Your Move Developer's
> > challenge
> > Build the coolest Linux based applications with Moblin SDK & win great
> > prizes
> > Grand prize is a trip for two to an Open Source event anywhere in the
> > world
> >http://moblin-contest.org/redirect.php?banner_id=100&url=/
> > _______________________________________________
> > Plone-Users mailing list
> > Plone-Us...@...
> >https://lists.sourceforge.net/lists/listinfo/plone-users
>
> --
> View this message in context:http://n2.nabble.com/Creating-objects-using-External-method-%28Workfl...
> Sent from the General Questions mailing list archive at Nabble.com.
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
> Build the coolest Linux based applications with Moblin SDK & win great prizes
> Grand prize is a trip for two to an Open Source event anywhere in the worldhttp://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Plone-Users mailing list
> Plone-Us...@...://lists.sourceforge.net/lists/listinfo/plone-users

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Plone-Users mailing list
Plone-Users@...
https://lists.sourceforge.net/lists/listinfo/plone-users