Can I use getDestinationStepName() in Behaviour Plugin when the transition is global?

Begoña Bonet February 16, 2015

Hi, 

I've defined a Global transition named "X" associated to the window "WindowX". This window has 3 customfields "CF1", "CF2" and "CF3".

This global transition is defined as follows:

Name: X

Description:

Destination step: The source step 

View: WindowX

 

I need to configure which customfield must be shown in WindowX depending on the status on which the transition is launched.

I've tried to configure Behaviour plugin in this way:

CF1       is associated to a validation script:

if(getActionName() == "X" && getDestinationStepName() != "En Entrega"){
getFieldByName("CF1").setHidden(false);
}

if(getActionName() == "X" && getDestinationStepName() == "En Entrega"){ 
getFieldByName("CF1").setHidden(true);
}

But, when I launch the action "X" from the "En Entrega" status (where the destination step is "En Entrega"), the customfield "CF1" isn't shown.

All help is welcome!!

 

Begoña

1 answer

1 accepted

1 vote
Answer accepted
JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 16, 2015

I'm not sure why you need to check the destination step name. If the action name is X, and it's a global action you know the destination step name. So you could check the current step name in conjunction with the action name.

That said, getDestStep uses the OSWorkflow API, so if it doesn't give you a destination step for a global action there's not much I can do.

 

Begoña Bonet February 16, 2015

I'll try to explain why I need to know the name of "Destination step": I've defined the Global Transition using the option "The source step" to define the value of the "Destination step" property. Is for this reason that I can launch this transition in every status in the flow, without changing the step (the source step=the destination step): To know the name of the action isn't enough for knowing the destination step because it depends on the step on which the action has been launched. Thanks Jamie, I'll find another solution for this scenario. Begoña

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 16, 2015

> To know the name of the action isn't enough for knowing the destination step because it depends on the step on which the action has been launched. Yes, but what I said was "the action name AS WELL AS the current step name". From those two you can know the destination step... which for this action is the source step.

Begoña Bonet February 16, 2015

Yes you are rigth, if I don't use global transitons the problem is solved. Thanks

JamieA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 17, 2015

I didn't say not to use global transitions, but OK...

Suggest an answer

Log in or Sign up to answer