10-18-2010 07:01 AM
<xsd:element name="baseElement" type="tBaseElement"/>
<xsd:complexType name="tBaseElement" abstract="true">
<xsd:sequence>
<xsd:element ref="documentation" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element ref="extensionElements" minOccurs="0" maxOccurs="1" />
</xsd:sequence>
<xsd:attribute name="id" type="xsd:ID" use="optional"/>
<xsd:anyAttribute namespace="##other" processContents="lax"/>
</xsd:complexType>
<xsd:element name="extensionElements" type="tExtensionElements" />
<xsd:complexType name="tExtensionElements">
<xsd:sequence>
<xsd:any namespace="##other" processContents="lax" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>
</xsd:complexType>
<bpmn:task name="Retrieve Customer Record" id="ID_2">
<bpmn:dataInput name="Order Input" id="ID_3">
<bpmn:typeDefinition typeRef="bo:Order" id="ID_4"/>
</bpmn:dataInput>
<bpmn:dataOutput name="Customer Record Output" id="ID_5">
<bpmn:typeDefinition typeRef="bo:CustomerRecord" id="ID_6"/>
</bpmn:dataOutput>
<bpmn:inputSet name="Inputs" id="ID_7" dataInputRefs="ID_3"/>
<bpmn:outputSet name="Outputs" id="ID_8" dataOutputRefs="ID_5"/>
</bpmn:task>
First violation: extension elements are not contained in an <extensionElements> node.10-18-2010 08:02 AM
<definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:activiti="http://activiti.org/bpmn-extensions"
xmlns:io="http://mynamespaces.com/bpmn-extensions/io"
xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 BPMN20.xsd"
typeLanguage="http://www.w3.org/2001/XMLSchema"
expressionLanguage="http://www.w3.org/1999/XPath"
targetNamespace="http://www.activiti.org/bpmn2.0">
<process id="fileCopySample1" name="File Copy Sample One">
<startEvent id="theStart"/>
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="readFromSource"/>
<serviceTask id="readFromSource"
operationRef="io:readFile"
io:sourceFile="D:\new.txt"
io:targetVariable="fileContent" />
<sequenceFlow id="flow2" sourceRef="readFromSource" targetRef="waitForSignal" />
<manualTask id="waitForSignal" name="Wait for the operator to signal"/>
<sequenceFlow id="flow3" sourceRef="waitForSignal" targetRef="writeToTarget" />
<serviceTask id="writeToTarget"
operationRef="io:writeFile"
io:targetFile="D:\new-copy.txt"
io:sourceVariable="fileContent" />
<sequenceFlow id="flow4" sourceRef="writeToTarget" targetRef="theEnd" />
<endEvent id="theEnd"/>
</process>
<process id="fileCopySample2" name="File Copy Sample Two">
<startEvent id="theStart"/>
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="readFromSource"/>
<serviceTask id="readFromSource"
io:action="readFile"
io:sourceFile="D:\new.txt"
io:targetVariable="fileContent" />
<sequenceFlow id="flow2" sourceRef="readFromSource" targetRef="waitForSignal" />
<manualTask id="waitForSignal" name="Wait for the operator to signal"/>
<sequenceFlow id="flow3" sourceRef="waitForSignal" targetRef="writeToTarget" />
<serviceTask id="writeToTarget"
io:action="writeFile"
io:targetFile="D:\new-copy.txt"
io:sourceVariable="fileContent" />
<sequenceFlow id="flow4" sourceRef="writeToTarget" targetRef="theEnd" />
<endEvent id="theEnd"/>
</process>
<process id="fileCopySample3" name="File Copy Sample Three">
<startEvent id="theStart"/>
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="readFromSource"/>
<serviceTask id="readFromSource">
<extensionElements>
<io:action>readFile</io:action>
<io:sourceFile>D:\new.txt</sourceFile>
<io:targetVariable>fileContent</io:targetVariable>
</extensionElements>
</serviceTask>
<sequenceFlow id="flow2" sourceRef="readFromSource" targetRef="waitForSignal" />
<manualTask id="waitForSignal" name="Wait for the operator to signal"/>
<sequenceFlow id="flow3" sourceRef="waitForSignal" targetRef="writeToTarget" />
<serviceTask id="writeToTarget">
<extensionElements>
<io:action>writeFile</io:action>
<io:targetFile>D:\new-copy.txt</targetFile>
<io:sourceVariable>fileContent</io:sourceVariable>
</extensionElements>
</serviceTask>
<sequenceFlow id="flow4" sourceRef="writeToTarget" targetRef="theEnd" />
<endEvent id="theEnd"/>
</process>
</definitions>
10-19-2010 08:29 AM
10-20-2010 02:11 AM
<serviceTask id="readFromSource"
operationRef="io:readFile"
io:sourceFile="D:\new.txt"
io:targetVariable="fileContent" />
<serviceTask id="readFromSource"
io:action="readFile"
io:sourceFile="D:\new.txt"
io:targetVariable="fileContent" />
<serviceTask id="readFromSource">
<extensionElements>
<io:action>readFile</io:action>
<io:sourceFile>D:\new.txt</sourceFile>
<io:targetVariable>fileContent</io:targetVariable>
</extensionElements>
</serviceTask>
<definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:activiti="http://activiti.org/bpmn-extensions"
xmlns:io="http://mynamespaces.com/bpmn-extensions/io"
xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 BPMN20.xsd"
typeLanguage="http://www.w3.org/2001/XMLSchema"
expressionLanguage="http://www.w3.org/1999/XPath"
targetNamespace="http://www.activiti.org/bpmn2.0">
10-20-2010 08:50 AM
We have an idea in mind that looks like this
<serviceTask activiti:type="someTypeOrAClassName">
<extensionElements>
<field name="cfgParam1">stringValue</field>
<field name="cfgParam2"><integer value="293" /></field>
10-20-2010 10:15 AM
10-20-2010 12:01 PM
3. I am a believer in Spring based development (generally, IoC/DI and compositional architecture). So, allowing all such extensions and integrations to be easy to do with Spring beans is what I have in mind too. But I couldn't quite understand your idea about your third and forth requirement.
We have an idea in mind that looks like this
<serviceTask activiti:type="someTypeOrAClassName">
<extensionElements>
<field name="cfgParam1">stringValue</field>
<field name="cfgParam2"><integer value="293" /></field>
<bean id="BPMNParse"
class="org.activiti.engine.impl.bpmn.parser.BpmnParse">
<property name="taskTypeToHandlerMap">
<map>
<entry key="serviceTask" value-ref="DefaultServiceTaskHandler"/>
<entry key="sendTask" value-ref="DefaultSeendTaskHandler"/>
…
</map>
</property>
<property name="taskInstanceToHandlerMap">
<map>
<entry key="serviceTask01" value-ref="CustomServiceTaskHandler1"/>
<entry key="serviceTask02" value-ref="CustomServiceTaskHandler2"/>
…
</map>
</property>
</bean>
4. To summarize what we have till now, here's what we have as a list of constraints and requirements:
- All customization / extensions should adhere to BPMN 2.0 specification.
- Any extension used in each file should be declared using an <extension> element.
- BPMN Parser should allow any custom attributes on all elements.
- BPMN Parser should allow any custom elements in the <extensionElements> element on all elements.
- BPMN attributes with abstract specification, and QName type, may be extended and handled by an extension.
- Extensions should be able to affect generation of PVM objects based on extention attributes / elements in any way.
- Spring-based composition for the extensibility features should be easily possible.
5. I have a customizability requirement in mind too:What I mean, is that just including an extension in the file (or by other means) one should be able to make BPMN elements (without any extension attributes / elements) parsed in a different way. Since this can allow changing the BPMN semantics, I don't believe supporting this as a first-class requirement is a good idea. But I think this should not be impossible. (We can deliberately make it hard to do).
- Extensions / customizations should be able to alter / replace the default PVM objects generation algorithm for BPMN elements.
An example use case would be, if I want to have my own language which is very similar to BPMN. It's nice if I can re-use the code from BPMN Parser to write my custom Deployer.
Another example would be if I want to write a simulation program, say for education purposes, or if I want to support test-running of the processes where some tasks and activities are not actually run, but just produce a log so that the designer can review it and debug the process definition. I might want to replace, for example, serviceTask behavior with something that shows an animation or produces a log. Again, re-using the code here is a nice thing if it is possible.
Just want to see what you think about this, as if we are thinking about BPMN Parser, we can consider other requirements (in addition to extensibility) too.
Edit: I just came along this post by chance, which is an example of the "simulation" case I was talking about:
http://forums.activiti.org/en/viewtopic.php?f=4&t=122
10-21-2010 04:18 AM
10-21-2010 07:33 AM
11-08-2011 06:50 AM
<definitions xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:activiti="http://activiti.org/bpmn-extensions"
xmlns:io="http://my/custom/namespace"
xsi:schemaLocation="http://schema.omg.org/spec/BPMN/2.0 BPMN20.xsd"
typeLanguage="http://www.w3.org/2001/XMLSchema"
expressionLanguage="http://www.w3.org/1999/XPath"
targetNamespace="http://www.activiti.org/bpmn2.0">
<process id="fileCopyTest" name="File Copy Test">
<startEvent id="theStart"/>
<sequenceFlow id="flow1" sourceRef="theStart" targetRef="readFromSource"/>
<io:readFile id="readFromSource" sourceFile="D:\new.txt" targetVariable="fileContent" />
<sequenceFlow id="flow2" sourceRef="readFromSource" targetRef="writeToTarget" />
<io:writeFile id="writeToTarget" sourceVariable="fileContent" targetFile="D:\new-copied.txt" />
<sequenceFlow id="flow3" sourceRef="writeToTarget" targetRef="theEnd" />
<endEvent id="theEnd"/>
</process>
</definitions>
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.