[jboss-user] [jBPM] - Re: How to Save jBPM 5.1 Process Definition Created via API?

Victor Lewis do-not-reply at jboss.com
Mon Dec 5 10:50:32 EST 2011

Victor Lewis [http://community.jboss.org/people/victor.lewis] created the discussion

"Re: How to Save jBPM 5.1 Process Definition Created via API?"

To view the discussion, visit: http://community.jboss.org/message/639861#639861


The exception you show isn't complaining about your cast to a WorkflowProcess but looks to be deeper in the call to dump (although I cannot tell because you cut off the stack trace).  It says you have an instance of org.jbpm.context.def.ContextDefinition that is trying to be cast to org.drools.process.core.Context.  I don't know where the org.jbpm.context.def.ContextDefinition is being created but it probably a part of processDefinition.  The stack trace with the exception should tell you where the cast is being done.

Here is the code I use to get thet XML:

protected String xmlForProcess(ProcessDefinitionDTO procDef, List<WorkflowNode> nodes, RPCResult result) {
     RuleFlowProcessFactory factory = processDefinitionService.createProcesFactory(procDef.getIdString());
     addNodesToProcess(nodes, factory);
     addLinksToProcess(procDef, factory);
     RuleFlowProcess process = factory.getProcess();
     ProcessValidationError[] errors = RuleFlowProcessValidator.getInstance().validateProcess(process);
     for (ProcessValidationError e : errors) {
          result.addMessage(new MessageDTO(MessageCategory.WARNING, e.getMessage()));
     String asXml = XmlBPMNProcessDumper.INSTANCE.dump(process, XmlBPMNProcessDumper.NO_META_DATA);
     return asXml;


 returns a 


I hope this helps.


Reply to this message by going to Community

Start a new discussion in jBPM at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20111205/d34ccf8b/attachment.html 

More information about the jboss-user mailing list