Module org.cruk.clarity.api
Package org.cruk.clarity.api.automation
Interface ClarityProcessAutomation
- All Known Implementing Classes:
ClarityProcessAutomationImpl
public interface ClarityProcessAutomation
Helper for moving Clarity processes through their stages
using the "click through" newer methods rather than the API's
ExecutableProcess end point.- Since:
- 2.31.4
-
Method Summary
Modifier and TypeMethodDescriptionvoidadvanceStep(ProcessStep step) Move a process step on to the next stage.beginProcessStep(StepCreation stepCreation) Start a protocol step as if running through Clarity.findProtocol(String name) Find a protocol by name.Find a stage in a work flow by name.Find a step in a protocol by name.findWorkflow(String name) Find a work flow by name.intgetWait()Get the time to wait between polls.intGet the number of times to ask for a state change before stopping.voidsetWait(int wait) Set the wait time between polls.voidsetWaitAttempts(int waitAttempts) Set the number of times to ask for a state change before stopping.startProgram(AvailableProgram program) Start execution of an EPP as part of a process step moving through Clarity.voidwaitUntilProcessInState(ProcessStep step, ProcessState desiredState) Wait until a process has reached a certain state.voidwaitUntilProgramCompletes(AvailableProgram program, ProgramStatus status) Wait for an EPP to finish running.
-
Method Details
-
getWait
int getWait()Get the time to wait between polls.- Returns:
- The wait time, in milliseconds.
-
setWait
void setWait(int wait) Set the wait time between polls.- Parameters:
wait- The wait time, in milliseconds.- Throws:
IllegalArgumentException- if the wait time is too short (minimum 500ms).
-
getWaitAttempts
int getWaitAttempts()Get the number of times to ask for a state change before stopping.- Returns:
- The number of polls.
-
setWaitAttempts
void setWaitAttempts(int waitAttempts) Set the number of times to ask for a state change before stopping.- Parameters:
waitAttempts- The number of polls.- Throws:
IllegalArgumentException- if there is not at least one poll attempt.
-
beginProcessStep
Start a protocol step as if running through Clarity. This is a call through to the same method on the Java client API, provided here to allow the whole process to be run through this utility.- Parameters:
stepCreation- The step creation object. See Genologics' API documentation.- Returns:
- The
ProcessStepobject for the step started. - Throws:
IllegalArgumentException- ifstepCreationis null.- See Also:
-
advanceStep
Move a process step on to the next stage. Tries this a number of times, testing and waiting for that change to complete.- Parameters:
step- The step to advance.- Throws:
InterruptedException- if the thread is interrupted while waiting for the state to change.ClarityException- if there is a problem from Clarity.- See Also:
-
waitUntilProcessInState
void waitUntilProcessInState(ProcessStep step, ProcessState desiredState) throws InterruptedException Wait until a process has reached a certain state. Tries this a number of times, testing and waiting for the state to reach that asked for.- Parameters:
step- The step to advance.desiredState- The state we're waiting for.- Throws:
InterruptedException- if the thread is interrupted while waiting for the state to change.ClarityException- if there is a problem from Clarity.ClarityAutomationException- if the process didn't reach the required state before the time and number of polling attempts ran out.
-
startProgram
Start execution of an EPP as part of a process step moving through Clarity. This is a call through to the same method on the Java client API, provide here to allow the whole program to be run through this utility.- Parameters:
program- The program, as listed in theProcessStepobject.- Returns:
- An updated program status structure.
- See Also:
-
waitUntilProgramCompletes
void waitUntilProgramCompletes(AvailableProgram program, ProgramStatus status) throws InterruptedException Wait for an EPP to finish running. Tries this a number of times, testing and waiting for the program to finish.- Parameters:
program- The program that is being run.status- The program status object. This is updated in place.- Throws:
InterruptedException- if the thread is interrupted while waiting for the program to end.ClarityException- if there is a problem from Clarity.ClarityAutomationException- if the EPP has failed.
-
findWorkflow
Find a work flow by name.- Parameters:
name- The name of the work flow.- Returns:
- The Workflow object.
- Throws:
ClarityAutomationException- if there is no such work flow.
-
findStage
Find a stage in a work flow by name.- Parameters:
workflow- The workflow object.name- The name of the stage.- Returns:
- The Stage object.
- Throws:
ClarityAutomationException- if there is no such stage in the work flow.
-
findProtocol
Find a protocol by name.- Parameters:
name- The name of the protocol.- Returns:
- The Protocol object.
- Throws:
ClarityAutomationException- if there is no such protocol.
-
findStep
Find a step in a protocol by name.- Parameters:
protocol- The protocol object.name- The name of the step.- Returns:
- The ProtocolStep object.
- Throws:
ClarityAutomationException- if there is no such step in the protocol.
-