[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
[
List Home]
Re: [ptp-dev] ETFW classes and methods to query togoption settings
|
For now the approach you are using is probably the way to go. I didn't realize you were working with coded data manager classes here. Possibly I could simplify the API for this but what Dave described is pretty much what has to happen.
=Wyatt
On Fri, Mar 2, 2012 at 7:26 AM, Brian Watt
<bwatt@xxxxxxxxxx> wrote:
> Just to make sure I'm clear: The middle step has a UI element, the
> value of which sets an environment variable. You need to access
> that value from within the first step. This isn't possible with the
> current architecture because each 'step' is encapsulated in its own
> object and only has access to the values assigned to it in the
> launch configuration. What I was suggesting above is that you could
> have two elements, one for each step, with the same value. The
> idiom of the system is that each tool defined in the xml workflow is
> gets its parameters set by a distinct set of widgets with no
> sharing. The proper fix, though, is to allow a single xml element
> to set a value for more than one tool. I think I could implement
> something like that, but I want to make sure what I'm describing
> addresses your requirements.
>
> =Wyatt
Hi Wyatt, thanks for the response. After a side conversation with
Dave Wootton I think I have found a way which doesn't require you
to make any changes.
Dave wrote (with a few edits on my part):
> Your BeforeInvocation and AfterInvocation classes aren't steps in the
> sense of ETFW steps. The ETFW steps Wyatt is describing are more
> like individual tool/processes invocations chained together.
>
> These two classes are more like pre-process and post-process hooks
> specified by org.eclipse.ptp.etfw.dataManagers extensions in
> plugin.xml and by the analyze stanzas in your ETFW workflow xml file
> where the BeforeCommand and AfterCommand command tags match to the
> MODULE_ID returned by getString() for each class.
>
> You also have the run configuration for the application passed to
> each of these classes, where I think the variables you are looking
> for from the togoptions are part of the run configuration. Assuming
> that the current setting is in the environment pool, you should be
> able to query it in your class' process method using the
> ILaunchConfiguration's getAttribute() method.
So a sample of my workflow xml file looks like this, and it is the
OUTPUT_NAME that I'm trying to access in my BeforeCommand class:
<toolset.01>
<tool name="Tool Name" explicitexecution="true">
<analyze>
<utility command="BeforeCommand" group="internal" />
</analyze>
<execute>
<global name="Global Name">
<optionpane title="TOOL">
<togoption label="Output file name:" optname=
"OUTPUT_NAME" envvar="true" required="true" tooltip="Specify output file
name">
<optvalue type="text" fieldrequired=
"true" />
</togoption>
...
</optionpane>
</global>
</execute>
<analyze>
<utility command="AfterCommand" group="internal" />
</analyze>
</tool>
</toolset.01>
So I have now coded in my process(String projname, ILaunchConfiguration
configuration, String projectLocation) method of the BeforeCommand class:
String outputName = configuration.getAttribute(
"TOOL.performance.options.configuration_id_OUTPUT_NAME_ARGUMENT_SAVED","");
This works although it is quite hardcoded which is a weakness. It is indeed
sufficient to allow me to make progress. What are your thoughts on this
approach?