* In this case, it can be assumed, that the duplicate was found in the
* database, rather than in the cache.
* @throws Exception ...
*/
public void checkUpdatedProcessDefinition() throws Exception {
ProcessDefinitionDirectory pdd
= WorkflowServiceFactory.newInstance()
.newWorkflowService().processDefinitionDirectory();
// import the origin process definition
InputStream is = getClass().getResourceAsStream
("/procdef/initialProcessesCache1.xml");
assertTrue (is != null);
BufferedReader br = new BufferedReader
(new InputStreamReader(is, "ISO-8859-1"));
StringBuffer sb = new StringBuffer();
String st;
while ((st = br.readLine()) != null) {
sb.append(st + "\n");
}
pdd.importProcessDefinitions(sb.toString());
// Lookup for the process definition and save creation date
ProcessDefinition pd
= pdd.lookupProcessDefinition("ut-procdef", "jut2");
assertTrue (pd!=null);
String firstDate = pd.processHeader().packageHeader().created();
// Import the duplicate process definition
is = getClass().getResourceAsStream
("/procdef/initialProcessesCache2.xml");
assertTrue (is != null);
br = new BufferedReader
(new InputStreamReader(is, "ISO-8859-1"));
sb = new StringBuffer();
st = null;
while ((st = br.readLine()) != null) {
sb.append(st + "\n");
}
pdd.importProcessDefinitions(sb.toString());
// Lookup for the duplicate process definition
pd = pdd.lookupProcessDefinition("ut-procdef", "jut2");
assertTrue (pd!=null);
String secondDate = pd.processHeader().packageHeader().created();
// check for different creation dates
//System.err.println(firstDate);