Re: [Perl-workflow-devel] Can't get grouped actions
Brought to you by:
jonasbn
From: Andrew O'B. <an...@or...> - 2009-04-26 23:53:19
|
Hi Ivan, We have exactly the same type set in the workflow.xml as in our associated actions.xml. Ie given a workflow "helpdesk" and the following files: wf_helpdesk.xml wf_helpdesk_action.xml wf_helpdesk_condition.xml .. Each of these files has a <type>helpdesk</type> entity. As far as I under stand the config structure, that's almost required but if not, it certainly saves a lot of confusion. In that case you could just call ->type() and use it directly which I believe is the way things should be set up. Can anyone else comment whether setting the same type value in all files for a worklog is The Way Things Are Supposed To Be? Cheers, Andrew > -----Original Message----- > From: Ivan Paponov [mailto:iva...@gm...] > Sent: Saturday, 25 April 2009 5:40 PM > To: Andrew O'Brien; per...@li... > Subject: Re: [Perl-workflow-devel] Can't get grouped actions > > Hi Andrew, > > Thanks for your answer. > > I didn't have time to work over that issue earlier, but now I would > like to fix it. Here are my thoughts about it. > > We have action types (didn't pay much attention it it before > actually), so that means line in > State.pm, which I submitted in group patch, won't work. > That one: > my $action_group = > FACTORY->{_action_config}{$action_name}{'group'}; > > (Actually I'm still wondering why it worked in 0.31) > So we need to change it to something like > my $type = exists $some_type ? $some_type : 'default'; > FACTORY->{_action_config}{$type}{$action_name}{'group'} > > So where can we find that $some_type variable? > In state we have $self->type() which is workflow type, but I need > clarification here - how does workflow type corresponds with action > types? > Actually, when I look at the XML structure of <workflow> it's > clear that I have > workflow, with some type, and number of actions that are it's > children. And it's clear without action type definition. > But actually it's not clear in script, because all actions go under > 'default' key, but not not under 'Workflow type' key. > > So, here is my main question, where I can find action type variable in > State.pm? And should I mark all actions in my_type_workflow.xml with > workflow type? > (I don't mind my_type_actions.xml here, because State.pm doesn't work > with it at all, and actions are taken from my_type_workflow.xml file) > > >> From: Ivan Paponov [mailto:iva...@gm...] > >> Sent: Monday, 2 March 2009 10:37 AM > > > > Hi Ivan, > > >> Recently, I updated workflow 0.31 to 1.32 and I faced with > one problem > >> in my system. Links that were connected to actions disappeared. I > >> didn't have much time to go deep into debugging, but here is what I > >> found for now. > >> > >> I retrieve actions with get_current_actions($group) function. > >> It refers to get_available_action_names($self,$group), which > >> is in State.pm > >> I analyzed that function, and I found that > >> my $action_group = > FACTORY->{_action_config}{$action_name}{'group'}; > >> returns nothing. > >> So, I looked at FACTORY->{_action_config} and found out that all > >> actions are under 'default' key. I added that key: > >> my $action_group = > >> FACTORY->{_action_config}{'default'}{$action_name}{'group'}; > >> And my action links returned on the screen. > > > Each of your action, condition and top-level workflow files need to > > define the <type> parameter - One of the other developers here was > > bitten by this a while back :-) > > > Eg: > > > my_type_here.xml: > > <workflow type="my_type_here"> > > ... > > </workflow> > > > my_type_here_action.xml: > > <action> > > <type>my_type_here</type> > > ... > > </action> > > > Etc. > > > Then things should work as expected. The hash key is the > workflow type > > from memory which defaults to 'default' if not set. > > > Cheers, > > > Andrew > > > > -- > Best regards, > Ivan Paponov > iva...@gm... > > |