Class SolutionProcessor
- java.lang.Object
-
- org.kie.server.services.taskassigning.planning.RunnableBase
-
- org.kie.server.services.taskassigning.planning.SolutionProcessor
-
- All Implemented Interfaces:
Runnable
public class SolutionProcessor extends RunnableBase
This class manges the processing of new a solution produced by the solver.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSolutionProcessor.Result-
Nested classes/interfaces inherited from class org.kie.server.services.taskassigning.planning.RunnableBase
RunnableBase.Status
-
-
Field Summary
-
Fields inherited from class org.kie.server.services.taskassigning.planning.RunnableBase
status
-
-
Constructor Summary
Constructors Constructor Description SolutionProcessor(TaskAssigningRuntimeDelegate delegate, Consumer<SolutionProcessor.Result> resultConsumer, String targetUserId, int publishWindowSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()protected voiddoProcess(org.kie.server.services.taskassigning.core.model.TaskAssigningSolution solution)booleanisProcessing()voidprocess(org.kie.server.services.taskassigning.core.model.TaskAssigningSolution solution)This method is invoked from a different thread for doing the processing of a solution.voidrun()-
Methods inherited from class org.kie.server.services.taskassigning.planning.RunnableBase
isAlive, isDestroyed
-
-
-
-
Constructor Detail
-
SolutionProcessor
public SolutionProcessor(TaskAssigningRuntimeDelegate delegate, Consumer<SolutionProcessor.Result> resultConsumer, String targetUserId, int publishWindowSize)
- Parameters:
delegate- a TaskAssigningRuntimeDelegate instance for executing methods into the jBPM runtime.resultConsumer- a consumer for processing the results.targetUserId- a user identifier for using as the "on behalf of" user when interacting with the jBPM runtime.publishWindowSize- Integer value > 0 that indicates the number of tasks to be published.
-
-
Method Detail
-
isProcessing
public boolean isProcessing()
- Returns:
- true if a solution is being processed at this time, false in any other case.
-
process
public void process(org.kie.server.services.taskassigning.core.model.TaskAssigningSolution solution)
This method is invoked from a different thread for doing the processing of a solution. If a solution is being processed an exception is thrown, so it's expected that any synchronization required between the isProcessing() and process() methods is performed by the caller. Since only one solution can be processed at time, the caller should typically execute in the following sequence. if (!solutionProcessor.isProcessing()) { solutionProcessor.process(solution); } else { //invoke at a later time. } A null value will throw an exception too.- Parameters:
solution- a solution to process.
-
destroy
public void destroy()
- Overrides:
destroyin classRunnableBase
-
run
public void run()
-
doProcess
protected void doProcess(org.kie.server.services.taskassigning.core.model.TaskAssigningSolution solution)
-
-