yawlfoundation / yawl

Yet Another Workflow Language
http://www.yawlfoundation.org
GNU Lesser General Public License v3.0
90 stars 35 forks source link

InterfaceB custom service exception when getting TaskInformation for a composite task #610

Closed mlawry closed 7 years ago

mlawry commented 7 years ago

I have a YAWL specification where the root net contains a composite task that decomposes to a subnet. In my InterfaceB custom service, I call the following method to get information about the composite task:

InterfaceBWebsideController.getTaskInformation(YSpecficationID specId, String taskId, String engineSessionId)

The above method throws the following exception (in my custom service):

org.jdom2.input.JDOMParseException: Error on line 1: Content is not allowed in prolog.
    at org.jdom2.input.sax.SAXBuilderEngine.build(SAXBuilderEngine.java:232) ~[jdom2-2.0.6.jar:?]
    at org.jdom2.input.sax.SAXBuilderEngine.build(SAXBuilderEngine.java:303) ~[jdom2-2.0.6.jar:?]
    at org.jdom2.input.SAXBuilder.build(SAXBuilder.java:1196) ~[jdom2-2.0.6.jar:2.0.6]
    at org.yawlfoundation.yawl.util.JDOMUtil.stringToDocument(JDOMUtil.java:99) [yawl-standalone-4.1.jar:?]
    at org.yawlfoundation.yawl.util.JDOMUtil.stringToElement(JDOMUtil.java:114) [yawl-standalone-4.1.jar:?]
    at org.yawlfoundation.yawl.engine.interfce.Marshaller.unmarshalTaskInformation(Marshaller.java:90) [yawl-standalone-4.1.jar:?]
    at org.yawlfoundation.yawl.engine.interfce.interfaceB.InterfaceB_EnvironmentBasedClient.parseTaskInformation(InterfaceB_EnvironmentBasedClient.java:920) [yawl-standalone-4.1.jar:?]
    at org.yawlfoundation.yawl.engine.interfce.interfaceB.InterfaceBWebsideController.getTaskInformation(InterfaceBWebsideController.java:471) [yawl-standalone-4.1.jar:?]
    at au.com.customservice.YawlIbController.getTaskInformation(YawlIbController.java:296) ~[classes/:?]

On the YAWL engine side, I found the following exception in the tomcat/logs/catalina.out file:

java.lang.ClassCastException: org.yawlfoundation.yawl.elements.YNet cannot be cast to org.yawlfoundation.yawl.elements.YAWLServiceGateway
    at org.yawlfoundation.yawl.elements.YTask.getInformation(YTask.java:1505)
    at org.yawlfoundation.yawl.engine.interfce.EngineGatewayImpl.getTaskInformation(EngineGatewayImpl.java:653)
    at org.yawlfoundation.yawl.engine.interfce.interfaceB.InterfaceB_EngineBasedServer.processPostQuery(InterfaceB_EngineBasedServer.java:348)
    at org.yawlfoundation.yawl.engine.interfce.interfaceB.InterfaceB_EngineBasedServer.doPost(InterfaceB_EngineBasedServer.java:224)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:648)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:292)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)

The issue looks to be the YTask.getInformation() method, which expects the decomposition to be a YAWLServiceGateway but it is actually a YNet because the composite task decomposes to a subnet.

yawlfoundation commented 7 years ago

fixed in latest commit