ObjectWeb Consortium
Search ObjectWeb Mail Archive: 

Advanced Search - Powered by Google


Mail Archive Home | jawe List | June 2004 Index

<--  Date Index  --> <--  Thread Index  -->

Re: [jawe] Error in getProcessObject


Hi,
 
currently I have no time to test your code, but in Rich Robinson post (Re: [shark] Evaluating Shark and its possibilities) from May 18th, you can find a class that uses JaWE to get the XPDL from shark and to produce JPG of process definitions - you can look at this class, and maybe you can discover what is wrong in your code. Maybe Rich can also help you.
 
Regards,
Sasa.
----- Original Message -----
Sent: Monday, June 14, 2004 11:43 AM
Subject: [jawe] Error in getProcessObject

I’ve a standalone application, and I want to show a process definition in it. I’m looking the example that generates an image. My code is really similar, but doesn’t work.

The differences are:

1)       Method putPkgIdToFileContentMapping is not static now and I have an instance of XML in my code

2)       I’m reading xpdls directly (not using shark connection)

3)       When I call openDocument, I’m not sure if I’ve to pass the xpdlId or the name of the file…

 

private XML xml = new XML ();

private JaWE jawe = JaWE.getInstance();

 

String path = "C:/xpdls/" + xpdlId + "A.xpdl";

java.io.File f = new java.io.File (path);

java.io.FileInputStream fis = new java.io.FileInputStream (f);

byte [] fileCont = new byte [fis.available()];

fis.read(fileCont);

fis.close();

 

String fileContStr = new String(fileCont, "UTF8");

xml.putPkgIdToFileContentMapping(xpdlId, fileContStr);

 

//pkg = jawe.openDocument(path, false, true);

pkg = jawe.openDocument(xpdlId, false, true);

 

jawe.getPackageEditor().setNewPackage(pkg, false);

pkg.setReadOnly(true);

 

WorkflowProcesses wps=(WorkflowProcesses)pkg.get("WorkflowProcesses");

WorkflowProcess wp=wps.getWorkflowProcess(pid);

 

PackageEditor peditor = jawe.getPackageEditor();

org.webdocwf.util.jawe.graph.Process process = peditor.getProcessObject(wp);// I get an error on this line…

ProcessEditor procEditor = process.getImplementationEditor();

ProcessGraph graph = (ProcessGraph)procEditor.getGraph();

 

 

I’m getting this error when I call getProcessObject in PackageEditor:

 

java.lang.NullPointerException

        at java.util.Hashtable.get(Hashtable.java:333)

        at org.webdocwf.util.jawe.PackageEditor.getProcessObject(PackageEditor.java:127)

        at com.nexusit.workflow.interfaz.SharkProcessViewer.cargaGraph(SharkProcessViewer.java:96)

        at com.nexusit.workflow.interfaz.SharkProcsAdmin.jButtonAuditoriaGraficaActionPerformed(SharkProcsAdmin.java:126)

        at com.nexusit.workflow.interfaz.SharkProcsAdmin.access$200(SharkProcsAdmin.java:18)

        …

Are there any problems with this code? Maybe I’m forgetting to initialize something?

 

Thanks in advance…

 

 

Iván Roza | Technical Analyst | IconMedialab™
voice: +34 91 521 00 80 e-mail: ivan.roza@xxxxxxxxxxxxxxx
office: C/José Echegaray, 6-Edificio B- 1ª planta- Parque Empresarial Las Rozas-  Madrid Spain

 



<--  Date Index  --> <--  Thread Index  -->

Reply via email to:

Powered by MHonArc.

Copyright © 1999-2005, ObjectWeb Consortium | contact | webmaster.