private File file = null;
private String jbpmCfg = null;
public void execute() throws BuildException {
// get the JbpmSessionFactory
JbpmConfiguration jbpmConfiguration = AntHelper.getJbpmConfiguration(jbpmCfg);
// if attribute file is set, deploy that file file
if (file==null) throw new BuildException("no file specified in the loadidentities task");
log( "loading identities from "+file+" ..." );
FileInputStream fileInputStream = null;
try {
fileInputStream = new FileInputStream(file);
} catch (FileNotFoundException e) {
throw new BuildException("identities file '"+file+"' not found");
}
Entity[] entities = IdentityXmlParser.parseEntitiesResource(fileInputStream);
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
try {
Session session = jbpmContext.getSession();
for (int i=0; i<entities.length; i++) {
session.save(entities[i]);
}