private String cfg = null;
private String properties = null;
public void execute() throws BuildException {
// get the JbpmSessionFactory
JbpmConfiguration jbpmConfiguration = AntHelper.getJbpmConfiguration(cfg,properties);
// 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+" ..." );
File identitiesFile = new File(file);
FileInputStream fileInputStream = null;
try {
fileInputStream = new FileInputStream(identitiesFile);
} 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]);
}