createBatchDirector(null);
}
public Flow createFlow(Step step, Director director, boolean forceCreate)
throws Exception {
Flow result = step.getFlow();
if (result == null || forceCreate) {
String stepName = step.getName();
if (stepName != null && !"".equals(stepName.trim())
&& !step.isBlockDelimiter()) {
// Bug 17624
// Added try..catch block to detect sequence load failure
try {
// -------------------------------------------------------------------------------
// ACTORS
// -------------------------------------------------------------------------------
if (StepType.ACTOR.equals(step.getType())) {
Integer stepkey = step.getId();
if (stepkey == null) {
stepkey = random.nextInt();
step.setId(stepkey);
}
// 29/04/2011 HMI 5.5 - engine 5.4 change Erwin to
// enforce right workspace on flow
if (director != null) {
result = new Flow(director.workspace(), null);
result.setName(step.getName() + "_" + stepkey);
// SPJZ : the director is requiered
result.setDirector(director);
// END change SPJZ
} else {
result = new Flow(step.getName() + "_" + stepkey,
null);
}
// END change Erwin
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());
result = FlowManager.readMoml(f.toURL());
result.setName(step.getName() + "_" + random.nextInt());
originalDirectors.put(step, (Director) result
.getDirector());
}
} catch (Exception e) {
// bug 17631