<%@ jet 
	imports="
		org.talend.core.model.process.INode 
		org.talend.core.model.process.ElementParameterParser 
		org.talend.core.model.metadata.IMetadataTable 
		org.talend.core.model.metadata.IMetadataColumn 
		org.talend.core.model.process.IConnection
		org.talend.core.model.process.IConnectionCategory
		org.talend.designer.codegen.config.CodeGeneratorArgument
		org.talend.core.model.metadata.types.JavaTypesManager
		org.talend.core.model.metadata.types.JavaType
		java.util.List 
    	java.util.Map		
	" 
%>
<% 
    CodeGeneratorArgument codeGenArgument = (CodeGeneratorArgument) argument;
    INode node = (INode)codeGenArgument.getArgument();
    String cid = node.getUniqueName();
    
	boolean dieOnError = Boolean.parseBoolean(ElementParameterParser.getValue(node, "__DIE_ON_ERROR__"));
%>

try {
	while(<%=cid%>_cronScheduler.isActive()) {
		Thread.sleep(800);
	}
} catch(Exception e) {
	if(<%=dieOnError%>) {
		throw e;
	} else {
		e.printStackTrace();
	}
}																			

if(true) return; 


