- fix merges conflicts
- set first chunk to be always created in READY
This commit is contained in:
parent
1a7e4d4401
commit
0aabdbdf4f
|
@ -37,7 +37,7 @@ public interface ITestFixture {
|
|||
|
||||
WorkChunk freshFetchWorkChunk(String theChunkId);
|
||||
|
||||
String storeWorkChunk(String theJobDefinitionId, String theTargetStepId, String theInstanceId, int theSequence, String theSerializedData);
|
||||
String storeWorkChunk(String theJobDefinitionId, String theTargetStepId, String theInstanceId, int theSequence, String theSerializedData, boolean theGatedExecution);
|
||||
|
||||
void runInTransaction(Runnable theRunnable);
|
||||
|
||||
|
@ -62,6 +62,8 @@ public interface ITestFixture {
|
|||
*/
|
||||
String createChunk(String theJobInstanceId);
|
||||
|
||||
String createChunk(String theJobInstanceId, boolean theGatedExecution);
|
||||
|
||||
/**
|
||||
* Enable/disable the maintenance runner (So it doesn't run on a scheduler)
|
||||
*/
|
||||
|
|
|
@ -19,9 +19,6 @@
|
|||
*/
|
||||
package ca.uhn.hapi.fhir.batch2.test;
|
||||
|
||||
import ca.uhn.fhir.batch2.model.WorkChunk;
|
||||
import ca.uhn.fhir.batch2.model.WorkChunkStatusEnum;
|
||||
|
||||
import ca.uhn.fhir.batch2.model.JobDefinition;
|
||||
import ca.uhn.fhir.batch2.model.WorkChunk;
|
||||
import ca.uhn.fhir.batch2.model.WorkChunkStatusEnum;
|
||||
|
@ -61,7 +58,8 @@ public interface IWorkChunkStateTransitions extends IWorkChunkCommon, WorkChunkT
|
|||
PointcutLatch sendLatch = getTestManager().disableWorkChunkMessageHandler();
|
||||
sendLatch.setExpectedCount(1);
|
||||
|
||||
String jobInstanceId = getTestManager().createAndStoreJobInstance(withJobDefinition(theGatedExecution));
|
||||
JobDefinition<?> jobDef = getTestManager().withJobDefinition(false);
|
||||
String jobInstanceId = getTestManager().createAndStoreJobInstance(jobDef);
|
||||
String myChunkId = getTestManager().createChunk(jobInstanceId, theGatedExecution);
|
||||
|
||||
getTestManager().runMaintenancePass();
|
||||
|
|
|
@ -64,11 +64,15 @@ public class WorkChunkCreateEvent {
|
|||
isGatedExecution = theGatedExecution;
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates the WorkChunkCreateEvent for the first chunk of a job.
|
||||
*/
|
||||
public static WorkChunkCreateEvent firstChunk(JobDefinition<?> theJobDefinition, String theInstanceId) {
|
||||
String firstStepId = theJobDefinition.getFirstStepId();
|
||||
String jobDefinitionId = theJobDefinition.getJobDefinitionId();
|
||||
int jobDefinitionVersion = theJobDefinition.getJobDefinitionVersion();
|
||||
boolean isGatedExecution = theJobDefinition.isGatedExecution();
|
||||
// the first chunk of a job is always READY, no matter whether the job is gated
|
||||
boolean isGatedExecution = false;
|
||||
return new WorkChunkCreateEvent(
|
||||
jobDefinitionId, jobDefinitionVersion, firstStepId, theInstanceId, 0, null, isGatedExecution);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue