|
|
Re: Unexpected Variable Filter behaviour [message #1823487 is a reply to message #1823476] |
Fri, 27 March 2020 09:21 |
Keith Ralphs Messages: 4 Registered: March 2020 |
Junior Member |
|
|
Hi Ed,
I have two other variable setupTasks (which I left out for simplicity) that provide the values for dawnbranch and gdabranch when gdabranchindex = 0 so (my understanding is that) these two variables should always be defined, hence other tasks can use them without filtering. As you said, what I'm really trying to do is make one variable selection ( the current gda branch minor number) to produce two related values:
For historical reasons, the two products we produce have minor version numbers which are always 1 apart - the dawn version being the gda version + 1. When we materialize the gda workspace we use some dawn components and thus, if materilizing a specific release branch, need to get gda 9.x components and dawn 2.x+1 components.
I tried to achieve this by making the gdabranchindex an INTEGER variable, but there doesn't seem to be a way to then add 1 to it when required within the oomph syntax. After this, variable filters seemed like they might be an option and as the basePath and lastElement ones are really just string splitters based around the final ocurrence of '/', my hope was I would be able to pass in a string of the form "16/17" and get "16" out from the former and "17" from the latter. However, as I say this wasn't the result.
Instead, when I set the value of gdabranchindex to be "16/17" (meaning the setupTask filter will be satisfied for both the dls.gdabranch and dls.dawnbranch tasks) the value of these variables after applying their variable filters are "" and "16" respectively which I don't understand, can you explain why?
Obviously if there is a less convoluted way of getting (from the selection of one variable) one variable with the value x and another with the value x+1 I'd be very intereseted in that too.
thanks,
Keith
|
|
|
Re: Unexpected Variable Filter behaviour [message #1823490 is a reply to message #1823487] |
Fri, 27 March 2020 09:50 |
Ed Merks Messages: 33145 Registered: July 2009 |
Senior Member |
|
|
I try replicate what you do. So I create this in my Workspace.setup using Navigate -> Open Setup -> Workspace:<?xml version="1.0" encoding="UTF-8"?>
<setup:CompoundTask
xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:setup="http://www.eclipse.org/oomph/setup/1.0">
<setupTask
xsi:type="setup:VariableTask"
type="BOOLEAN"
name="filter"
label="Filter"/>
<setupTask
xsi:type="setup:VariableTask"
name="path"
value="a-true/b-false"/>
<setupTask
xsi:type="setup:VariableTask"
filter="(filter=true)"
name="sample"
value="Value When Filter True ${path|basePath}"/>
<setupTask
xsi:type="setup:VariableTask"
filter="(filter=false)"
name="sample"
value="Value When Filter False ${path|lastSegment}"/>
<setupTask
xsi:type="setup:StringSubstitutionTask"
name="string_substitution"
value="${sample}"/>
<description>Test</description>
</setup:CompoundTask>
Then I do Perform Setup Tasks and I'm prompted for Filter. Then I go to the next page and can look at the String Substitution task. When it's not checked, I see<?xml version="1.0" encoding="UTF-8"?>
<setup:StringSubstitutionTask
xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:setup="http://www.eclipse.org/oomph/setup/1.0"
name="string_substitution"
value="Value When Filter False b-false"/>
When it's checked, I see:<?xml version="1.0" encoding="UTF-8"?>
<setup:StringSubstitutionTask
xmi:version="2.0"
xmlns:xmi="http://www.omg.org/XMI"
xmlns:setup="http://www.eclipse.org/oomph/setup/1.0"
name="string_substitution"
value="Value When Filter True a-true"/>
So from this I conclude that it works properly.
If you have something that doesn't work, I need to see all the context. So ideally you boil it down to an example that you can copy and paste into the forum. (If you use Copy from the context menu and paste that, I can copy it from the forum and paste into in any setup editor to test it.)
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.03127 seconds