> On 2012-05-02 19:20:13, brian Foster wrote:
> > ./trunk/workflow/src/test/org/apache/oodt/cas/workflow/engine/TestTaskQuerier.java,
> >  line 79
> > <https://reviews.apache.org/r/4961/diff/1/?file=105932#file105932line79>
> >
> >     When Success/done is passed in, the processor created is incorrect 
> > since it has a sub-processor in Queued/waiting
> 
> Chris Mattmann wrote:
>     Thoughts on how to fix?
> 
> Sheryl John wrote:
>     If 'anydoneStates'/done is passed, then don't add taskProcessor and 
> return the 'done' processor?
> 
> Chris Mattmann wrote:
>     Good idea, Sheryl, I will try that.

Maybe change getProcessor signature to something along the lines of:

private WorkflowProcessor getProcessor(String id,
                                       double priority,
                                       String stateName,
                                       String categoryName,
                                       List<WorkflowProcessor> subProcessors);

Then just make some helper methods which build test WorkflowProcessors... Maybe 
even make a WorkflowProcessorBuilder class:

public class WorkflowProcessorBuilder {

  private String id;
  private double priority;
  private List<WorkflowProcessor> subProcessors;

  private WorkflowProcessorBuilder() {
    subProcessors = Lists.newArrayList();
  }

  public static WorkflowProcessorBuilder aWorkflowProcessorBuilder() {
    return new WorkflowProcessorBuilder();
  }

  public WorkflowProcessorBuilder withId(String id) {
    this.id = id;
    return this;
  }

  public WorkflowProcessorBuilder withPriority(double priority) {
    this.priority = priority;
    return this;
  }

  public WorkflowProcessorBuilder with(WorkflowProcessorBuilder wpb) {
    subProcessors.add(wpb.build());
    return this;
  }
  ...
  ...
  ...

  public WorkflowProcessor build() {
    WorkflowProcessor wp = new ...
    wp.setId(id);
    wp.setPriority(priority);
    wp.setSubProcessors(subProcessors);
    ...
    return wp;
  }
}


- brian


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/4961/#review7482
-----------------------------------------------------------


On 2012-05-02 05:08:45, Chris Mattmann wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/4961/
> -----------------------------------------------------------
> 
> (Updated 2012-05-02 05:08:45)
> 
> 
> Review request for oodt, brian Foster, Ricky Nguyen, Paul Ramirez, Sheryl 
> John, and Thomas Bennett.
> 
> 
> Summary
> -------
> 
> Task Querier thread for OODT-310. See javadocs on: 
> https://builds.apache.org/job/oodt-trunk/javadoc/org/apache/oodt/cas/workflow/engine/TaskQuerier.html
> 
> 
> This addresses bug OODT-310.
>     https://issues.apache.org/jira/browse/OODT-310
> 
> 
> Diffs
> -----
> 
>   
> ./trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/TaskQuerier.java
>  1332505 
>   
> ./trunk/workflow/src/main/java/org/apache/oodt/cas/workflow/engine/WorkflowProcessor.java
>  1331866 
>   
> ./trunk/workflow/src/test/org/apache/oodt/cas/workflow/engine/TestTaskQuerier.java
>  PRE-CREATION 
> 
> Diff: https://reviews.apache.org/r/4961/diff
> 
> 
> Testing
> -------
> 
> Includes unit test, that currently isn't passing. I think I know why 
> (something up with my threading logic and synchronized keywords) but wanted 
> to throw it up for review. I'll likely be working on this tomorrow or the 
> following evening.
> 
> 
> Thanks,
> 
> Chris
> 
>

Reply via email to