Yes, that should work because whenever you want your different input params you'll have specify in the config (conditions.xml or tasks.xml).
On Wed, Apr 11, 2012 at 8:57 AM, Mattmann, Chris A (388J) < [email protected]> wrote: > Hi Chintu, > > From: "Mistry, Chintu (GSFC-586.0)[COLUMBUS TECHNOLOGIES AND SERVICES > INC]" <[email protected]> > > > > > > > > Sheryl, > > > > No. We already know that. > > > > We want to define generic condition class in policy/conditions.xml file. > And we want use that condition class with different input params > (properties - look for "CustomCondition" in following example) in tasks.xml > file. > > Gotcha. OK, I looked at the below. It's totally possible. What you would > is the following: > > 1. Write a Java class that implements WorkflowConditionInstance, e.g., > CustomCondition.java > 2. In your example below, define in your conditions.xml the following: > > <condition id="urn:oodt:CustomConditionWithParamSet1" > name="MyConditionParam1" class="CustomCondition"> > <configuration> > <property name="Param1" value="Value1"/> > </configuration> > </condition> > > <condition id="urn:oodt:CustomConditionWithParamSet2" > name="MyConditionParam2" class="CustomCondition"> > <configuration> > <property name="Param2" value="Value2"/> > </configuration> > </condition> > > (note both the conditions use the same *implementing class*, but are > configured with diff params, and have diff IDs > and names) > > 3. Reference these conditions in tasks.xml > > I think this will take care of what you are trying to do. > > Thanks! > > Cheers, > Chris > > > > > So for example: > > > > <task id="urn:oodt:HelloWorld" name="Hello World" > class="org.apache.oodt.cas.workflow.examples.HelloWorld"> > > <conditions> > > <condition id="urn:oodt:CustomCondition"> > > <property name="searchFile" value="VIIRS[0-9]{1,3}" /> > > </conditions> > > <configuration> > > <property name="Person" value="Task1" /> > > </configuration> > > </task> > > > > <task id="urn:oodt:HelloWorld1" name="Hello World1" > class="org.apache.oodt.cas.workflow.examples.HelloWorld1"> > > <conditions> > > <condition id="urn:oodt:CustomCondition"> > > <property name="searchFile" value="CrIs_[0-9]{1,3}" /> > > </conditions> > > <configuration> > > <property name="Person" value="Task2" /> > > </configuration> > > </task> > > > > > > Thanks > > Chintu > > > > > > > > > > ________________________________________ > > From: Sheryl John [[email protected]] > > Sent: Tuesday, April 10, 2012 10:46 PM > > To: [email protected] > > Cc: Mistry, Chintu (GSFC-586.0)[COLUMBUS TECHNOLOGIES AND SERVICES INC] > > Subject: Re: workflow task/condition question > > > > Hi Ryan, > > > > You can specify properties for your conditions in the conditions.xml. > > There's an example with properties for "urn:oodt:CheckForMetadataKeys" > in the /policy/conditions.xml. Also check out the other examples. > > So if you're defining a new condition class, you'll have add that to the > conditions.xml and include properties for that condition. > > > > Is that what you were looking for? > > > > > > > > On Tue, Apr 10, 2012 at 12:35 PM, Gerard, Ryan S. (GSFC-586.0)[COLUMBUS > TECHNOLOGIES AND SERVICES INC] <[email protected]<mailto: > [email protected]>> wrote: > > Hello, > > > > We have a question regarding our workflow tasks. We are configuring our > tasks.xml file and need to define some properties for our conditions. We > would like to create a general condition and reuse it for many tasks. Is > there a way to do this? > > > > <task id="urn:oodt:HelloWorld" name="Hello World" > > class="org.apache.oodt.cas.workflow.examples.HelloWorld"> > > <conditions> > > <condition id="urn:oodt:TrueCondition" > > IS THERE A WAY TO DEFINE A PROPERTY IN THE > CONDITION HERE > > /> > > </conditions> > > <configuration> > > <property name="Person" value="Chris" /> > > </configuration> > > </task> > > > > Thanks, > > Ryan Gerard > > > > > > > > -- > > -Sheryl > > > > > > > > > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > Chris Mattmann, Ph.D. > Senior Computer Scientist > NASA Jet Propulsion Laboratory Pasadena, CA 91109 USA > Office: 171-266B, Mailstop: 171-246 > Email: [email protected] > WWW: http://sunset.usc.edu/~mattmann/ > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > Adjunct Assistant Professor, Computer Science Department > University of Southern California, Los Angeles, CA 90089 USA > ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ > > -- -Sheryl
