public void createBatchDirector() throws Exception {
createBatchDirector(null);
}
public Flow createFlow(Step step, boolean forceCreate) throws Exception {
Flow result = step.getFlow();
if (result == null || forceCreate) {
String stepName = step.getName();
if (stepName != null && !"".equals(stepName.trim())) {
// -------------------------------------------------------------------------------
// ACTORS
// -------------------------------------------------------------------------------
if (StepType.ACTOR.equals(step.getType())) {
Integer stepkey = step.getId();
if (stepkey == null) {
stepkey = random.nextInt();
step.setId(stepkey);
}
result = new Flow(step.getName() + "_" + stepkey, null);
TypedAtomicActor actorInstance = RepositoryManager.getActorRepository().getActorForName(
step.getName());
TypedAtomicActor clone = (TypedAtomicActor) actorInstance.clone(result.workspace());
clone.setContainer(result);
if (clone instanceof TransformerV3) {
TransformerV3 transClone = (TransformerV3) clone;
TransformerV3 transInstance = (TransformerV3) actorInstance;
// Field is PUBLIC !!
if (transClone.input == null) {
transClone.input = PortFactory.getInstance().createInputPort(
transClone,
transInstance.input.getName() + " ",
transInstance.input.getExpectedMessageContentType());
}
if (transClone.output == null) {
transClone.output = PortFactory.getInstance().createInputPort(
transClone,
transInstance.output.getName() + " ",
transInstance.output.getExpectedMessageContentType());
}
}
connectAllActorInputs(result, clone);
// -------------------------------------------------------------------------------
// SEQUENCE
// -------------------------------------------------------------------------------
} else if (StepType.SEQUENCE.equals(step.getType())) {
File f = RepositoryManager.getSequenceRepository().getSequenceForName(step.getName());
// try {
result = FlowManager.readMoml(f.toURL());
result.setName(step.getName() + "_" + random.nextInt());
originalDirectors.put(step, (Director) result.getDirector());
}
flowManager.applyParameterSettings(result,