Module org.cruk.clarity.api
Class ClarityProcessAutomationImpl
java.lang.Object
org.cruk.clarity.api.automation.impl.ClarityProcessAutomationImpl
- All Implemented Interfaces:
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.2
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructor.Constructor. -
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.voidsetClarityAPI(ClarityAPI api) Set the API.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.
-
Field Details
-
logger
Logger. -
api
Clarity API.
-
-
Constructor Details
-
ClarityProcessAutomationImpl
public ClarityProcessAutomationImpl()Constructor. -
ClarityProcessAutomationImpl
Constructor.- Parameters:
api- The Clarity API.
-
-
Method Details
-
setClarityAPI
Set the API.- Parameters:
api- The Clarity API.
-
getWait
public int getWait()Get the time to wait between polls.- Specified by:
getWaitin interfaceClarityProcessAutomation- Returns:
- The wait time, in milliseconds.
-
setWait
public void setWait(int wait) Set the wait time between polls.- Specified by:
setWaitin interfaceClarityProcessAutomation- Parameters:
wait- The wait time, in milliseconds.
-
getWaitAttempts
public int getWaitAttempts()Get the number of times to ask for a state change before stopping.- Specified by:
getWaitAttemptsin interfaceClarityProcessAutomation- Returns:
- The number of polls.
-
setWaitAttempts
public void setWaitAttempts(int waitAttempts) Set the number of times to ask for a state change before stopping.- Specified by:
setWaitAttemptsin interfaceClarityProcessAutomation- Parameters:
waitAttempts- The number of polls.
-
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.- Specified by:
beginProcessStepin interfaceClarityProcessAutomation- Parameters:
stepCreation- The step creation object. See Genologics' API documentation.- Returns:
- The
ProcessStepobject for the step started. - 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.- Specified by:
advanceStepin interfaceClarityProcessAutomation- Parameters:
step- The step to advance.- Throws:
InterruptedException- if the thread is interrupted while waiting for the state to change.- See Also:
-
waitUntilProcessInState
public 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.- Specified by:
waitUntilProcessInStatein interfaceClarityProcessAutomation- 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.
-
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.- Specified by:
startProgramin interfaceClarityProcessAutomation- Parameters:
program- The program, as listed in theProcessStepobject.- Returns:
- An updated program status structure.
- See Also:
-
waitUntilProgramCompletes
public 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.- Specified by:
waitUntilProgramCompletesin interfaceClarityProcessAutomation- 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.
-
findWorkflow
Find a work flow by name.- Specified by:
findWorkflowin interfaceClarityProcessAutomation- Parameters:
name- The name of the work flow.- Returns:
- The Workflow object.
-
findStage
Find a stage in a work flow by name.- Specified by:
findStagein interfaceClarityProcessAutomation- Parameters:
workflow- The workflow object.name- The name of the stage.- Returns:
- The Stage object.
-
findProtocol
Find a protocol by name.- Specified by:
findProtocolin interfaceClarityProcessAutomation- Parameters:
name- The name of the protocol.- Returns:
- The Protocol object.
-
findStep
Find a step in a protocol by name.- Specified by:
findStepin interfaceClarityProcessAutomation- Parameters:
protocol- The protocol object.name- The name of the step.- Returns:
- The ProtocolStep object.
-