Is a different inbound payload allowed when signaling a BPM process?
dustin.barlow May 27, 2013 9:44 PMHere is the BPM process model:
I have the following interface:
public interface AsyncSignalEvent { public RequestAck startProcess(ProcessInfo processInfo); public RequestAck updateTask(TaskInfo taskInfo); }
I am mapping the two methods to the following BPM actions:
The updateTask method is mapped to a SIGNAL_EVENT:
I am able to map the inputMessage and the outputMessage variables found on the I/O Parameters properties tab on all the BPM tasks. The inputMessage variable correctly gives a fully populated instance of the ProcessInfo class. The outputMessage variable correctly returns an instance of the RequestAck class to my JUnit test client.
My issue is how to now get the TaskInfo object into my signal flow. I thought that since the signalInput variable was not showing up in any of the I/O Parameters properties tab, that I needed to add it to the Data Items sections similiar to how the _inputMessage and _outputMessage were done. However, when I do this, as shown in the image below, I don't have the option of selecting any form of TaskInfo as a data type.
So then I go to the Data Definitions area thinking I need to define a new data definition so that it will show up in the Data Mappings area.
When I save the project and try to run it even before I try to map it to any of my BPM tasks, I get the following stack trace:
21:20:31,212 ERROR [xml.ExtensibleXmlParser] (null: 10, 48): cvc-complex-type.2.4.a: Invalid content was found starting with element 'bpmn2:documentation'. One of '{"http://www.omg.org/spec/BPMN/20100524/MODEL":supportedInterfaceRef, "http://www.omg.org/spec/BPMN/20100524/MODEL":ioSpecification, "http://www.omg.org/spec/BPMN/20100524/MODEL":ioBinding, "http://www.omg.org/spec/BPMN/20100524/MODEL":auditing, "http://www.omg.org/spec/BPMN/20100524/MODEL":monitoring, "http://www.omg.org/spec/BPMN/20100524/MODEL":property, "http://www.omg.org/spec/BPMN/20100524/MODEL":laneSet, "http://www.omg.org/spec/BPMN/20100524/MODEL":flowElement, "http://www.omg.org/spec/BPMN/20100524/MODEL":artifact, "http://www.omg.org/spec/BPMN/20100524/MODEL":resourceRole, "http://www.omg.org/spec/BPMN/20100524/MODEL":correlationSubscription, "http://www.omg.org/spec/BPMN/20100524/MODEL":supports}' is expected. 21:20:31,243 ERROR [xml.ExtensibleXmlParser] (null: 86, 28): cvc-complex-type.2.4.a: Invalid content was found starting with element 'bpmn2:outMessageRef'. One of '{"http://www.omg.org/spec/BPMN/20100524/MODEL":documentation, "http://www.omg.org/spec/BPMN/20100524/MODEL":extensionElements, "http://www.omg.org/spec/BPMN/20100524/MODEL":inMessageRef}' is expected. java.lang.IllegalArgumentException: No messages found 21:20:31,249 ERROR [impl.KnowledgeBuilderImpl] ProcessLoadError: unable to parse xml : Exception class java.lang.IllegalArgumentException : No messages found at org.jbpm.bpmn2.xml.InMessageRefHandler.end(InMessageRefHandler.java:62) at org.drools.xml.ExtensibleXmlParser.endElement(ExtensibleXmlParser.java:422) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:601) at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.endElement(XMLSchemaValidator.java:828) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:1782) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2939) at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647) at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140) at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808) at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119) at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) at javax.xml.parsers.SAXParser.parse(SAXParser.java:395) at org.drools.xml.ExtensibleXmlParser.read(ExtensibleXmlParser.java:301) at org.drools.xml.ExtensibleXmlParser.read(ExtensibleXmlParser.java:180) at org.jbpm.compiler.xml.XmlProcessReader.read(XmlProcessReader.java:46) at org.jbpm.compiler.ProcessBuilderImpl.addProcessFromXml(ProcessBuilderImpl.java:262) at org.drools.compiler.PackageBuilder.addProcessFromXml(PackageBuilder.java:673) at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:709) at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:51) at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:40) at org.switchyard.component.common.knowledge.util.Resources.addResources(Resources.java:62) at org.switchyard.component.common.knowledge.session.KnowledgeBaseSessionFactory.newBase(KnowledgeBaseSessionFactory.java:115) at org.switchyard.component.common.knowledge.session.KnowledgeBaseSessionFactory.<init>(KnowledgeBaseSessionFactory.java:58) at org.switchyard.component.common.knowledge.session.KnowledgeSessionFactory.newSessionFactory(KnowledgeSessionFactory.java:122) at org.switchyard.component.common.knowledge.exchange.KnowledgeExchangeHandler.start(KnowledgeExchangeHandler.java:181) at org.switchyard.component.bpm.exchange.BPMExchangeHandler.start(BPMExchangeHandler.java:90) at org.switchyard.deploy.internal.Deployment.deployImplementations(Deployment.java:483) at org.switchyard.deploy.internal.Deployment.start(Deployment.java:140) at org.switchyard.test.SwitchYardTestKit.deploy(SwitchYardTestKit.java:277) at org.switchyard.test.SwitchYardTestKit.start(SwitchYardTestKit.java:180) at org.switchyard.test.SwitchYardRunner.createTest(SwitchYardRunner.java:65) at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:236) at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15) at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:233) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68) at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47) at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231) at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60) at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229) at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50) at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222) at org.junit.runners.ParentRunner.run(ParentRunner.java:300) at org.switchyard.test.SwitchYardRunner.run(SwitchYardRunner.java:90) at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50) at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
I searched around and really didn't find anything helpful as to why simply adding the TaskInfo object as a defintion caused this issue. So, what am I doing wrong or what am I missing when it comes to creating a new defintion?
I read elsewhere in an unrelated thread that you can only send a String object in as the payload type in a signal event. Is that true?
EDIT: I am using switchyard version 0.8.Final, Eclipse JUNO SR2, and all the latest JBoss plugins.
Thanks!