As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
<serviceTask id="sendMail" activiti:type="mail"><br> <extensionElements><br> <activiti:field activiti:name="from" activiti:string-value="order-shipping@thecompany.com" /><br> <activiti:field activiti:name="to" activiti:string-value="${recipient}" /><br> <activiti:field activiti:name="subject" activiti:string-value="Your order ${orderId} has been shipped" /><br> <activiti:field activiti:name="html"><br> <activiti:string><br> <![CDATA[<br> <html><br> <body><br> Hello ${male ? 'Mr.' : 'Mrs.' } ${recipientName},<br/><br/><br> <br> As of ${now}, your order has been <b>processed and shipped</b>.<br/><br/><br> <br> Kind regards,<br/><br> <br> TheCompany.<br> </body><br> </html><br> ]]><br> </activiti:string><br> </activiti:field> <br> </extensionElements><br></serviceTask> <br>
About warnings on unsupported BPMN elements, I think the current Activiti parser produces warnings on the log output, but I'm not sure. But in my refactored code, each unsupported element inside the scopes, are reported as a WARNING on the log output.
from a first incomplete glance, i would be concerned with 1) i don't think your proposal is valid bpmn. it's not allowed to define custom activities like that.
<serviceTask activiti:type="someTypeOrAClassName"><br> <extensionElements><br> <field name="cfgParam1">stringValue</field><br> <field name="cfgParam2"><integer value="293" /></field>
<br><?xml version="1.0" encoding="UTF-8"?><br><schema<br> xmlns="<a href="http://www.w3.org/2001/XMLSchema" rel="nofollow noopener noreferrer">http://www.w3.org/2001/XMLSchema</a>"<br> targetNamespace="<a href="http://my/custom/namespace" rel="nofollow noopener noreferrer">http://my/custom/namespace</a>"<br> xmlns:tns="<a href="http://my/custom/namespace" rel="nofollow noopener noreferrer">http://my/custom/namespace</a>"<br> xmlns:bpmn="<a href="http://www.omg.org/spec/BPMN/20100524/MODEL" rel="nofollow noopener noreferrer">http://www.omg.org/spec/BPMN/20100524/MODEL</a>"<br> elementFormDefault="qualified"><br><br> <!–<br> This is a schema-valid BPMN extension, which is invalid with respect<br> to the meta model as described in section "8.2.3 Extensibility" of the<br> BPMN specification.<br> –><br><br> <import namespace="<a href="http://www.omg.org/spec/BPMN/20100524/MODEL" rel="nofollow noopener noreferrer">http://www.omg.org/spec/BPMN/20100524/MODEL</a>" /><br><br> <!– <io:readFile id="readFromSource" sourceFile="D:\new.txt" targetVariable="fileContent" /> –><br><br> <element name="readFile" type="tns:tReadFile" substitutionGroup="bpmn:flowElement" /><br><br> <complexType name="tReadFile"><br> <complexContent><br> <extension base="bpmn:tTask"><br> <attribute name="sourceFile" type="string" /><br> <attribute name="targetVariable" type="string" /><br> </extension><br> </complexContent><br> </complexType><br><br></schema><br>
We're don't think its a good idea to switch our BpmnParser to JAXB.
I agree with not using JAXB. The current parser, in my opinion, is both more flexible and more efficient, than if you'd used JAXB. (except the long list of if .. else if … else if … comparisons in the parser, which can be made more efficient using a lookup map)
What other considerations make you both feel that its not a good fit for parsing BPMN2?
What other considerations make you both feel that its not a good fit for parsing BPMN2?Maybe if I wanted to write the BPMN Parser from scratch, I might have used JAXB. Specially provided that we have an XSD ready for generating JAXB classes. So, I'm not saying that JAXB is not a good fit. Anyway, here's why I felt I'm not comfortable with JAXB in here:(Note that none of these are concrete reasons, just generally the way I feel about the issue)1. BpmnParser does two things. One is parsing the XML, and one is generating PVM objects based on what is read from XML. So if we use JAXB, most of the current code will remain, not replaced.2. Using JAXB means strict conformance of the XML to the object model. In the current implementation, it's rather easier to handle errors in custom ways.3. It's easier to change / extend the current parser, than if the parser have used JAXB. For example, in JAXB code you need to specify possible sub-classes of a super class user @XmlSeeAlso. So if you want the parser to handle a new element, you'll either have to change the library code, or re-implement the whole JAXB class hierarchy that is bound to BPMN. In the current parser, it's a matter of comparing strings.All of the above items can be considered a positive point for JAXB too, depending on your point of view.Even for the performance, since there is many string comparisons and string lookups in the current code, we can't be sure that using JAXB means lower performance.I think the concrete reason for not changing it would be: there's no (special) gain for the user of Activiti to do so.From your point of view, as a user of Activiti, what can be better if Activiti uses JAXB or not internally?