How to extend BPMN 2.0 - business-process-management

Currently, I'm investigating the ways to extend BPMN. I want to create a new task type with less properties than a task and also with some non-BPMN properties and a new type of pool.
Until now I saw that people mentioned of two ways, using Extension Points and using an external schema. Unfortunately in Internet, I could not find that many resources to understand these methods extensively.
What I understood from these methods:
Extension Points: There are some standard extension points provided by BPMN engine vendors (Aktiviti, jBPM, etc...). For instance in Activiti there is a Custom Service Task which can be extended with user desired properties but I did not find any resources if this newly created extension task can be deployed on the Aktiviti workflow engine and also it would be nice to see the new BPMN schema for this extension.
Using an external schema: Defining desired properties in an external schema and referencing this schema from Semantic.xsd. In this case we will also need to adapt our Workflow Engine but it's more flexible than the method I mentioned before or am I missing missing something?
The only thing that is not clear is this method does not extend directly task definition so these properties can be used by every element in BPMN?
An example external schema is:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema elementFormDefault="qualified" attributeFormDefault="unqualified"
xmlns="http://myproject.org//bpmn/extensions/NEWTask"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:exvar="http://myproject.org/externalDefs"
targetNamespace="http://myproject.org//bpmn/extensions/NEWTask"
>
<xsd:import namespace="http://www.omg.org/spec/BPMN/20100524/MODEL" schemaLocation="BPMN20.xsd"/>
<xsd:import schemaLocation="externalDefs.xsd" namespace="http://myproject.org/externalDefs" />
<xsd:complexType name="tProperty1" abstract="false">
<xsd:sequence>
<xsd:any namespace="##any" processContents="lax" minOccurs="0" />
</xsd:sequence>
</xsd:complexType>
<xsd:group id="tNEWTask" name="tNEWTask">
<xsd:sequence>
<xsd:element name="Property2" type="xsd:string" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="Property1" type="tProperty1" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="Property2" type="exvar:Varaible1" minOccurs="0" maxOccurs="unbounded"/>
</xsd:sequence>
</xsd:group>
</xsd:schema>
Are there any other methods for extending BPMN or any resources that you can point me so that I can have a better insight about this topic?
Any help will be appreciated, thanks in advance!

There's this tool developed by a brazilian researcher: http://code.google.com/p/bpmnx/
it works on extension points as far as i remember.

As you are not talking about any concrete BPMN implementation (activiti, jbpm), and you are talking about your own process engine I assume that what you want to do is extend the XML in accordance to BPMN rules.
That said, you can look at BPMN 2.0 specification (I think it's very long, and probably boring) or you can try to look at some bpmn book. BPMN method & style book has a part about implementing BPMN, so maybe that's useful to you.
Note: When there's a standard like BPMN, which has a lot of support, sometimes it's useful if you really need to extended. Is it worth extending something standard, which hasn't been considered? (Not saying you can't do it, but you should think what it brings to you and if couldn't you do it with the regular stuff).

Here is some discussion of this topic on the Activiti Forums and on the MDT Eclipse plugin forum.
Unfortunately, with some simple testing I have not been able to implement a new namespace
(e.g. xmlns:newns="http://www.mynewns.com/newns in
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:activiti="http://activiti.org/bpmn"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI"
typeLanguage="http://www.w3.org/2001/XMLSchema"
xmlns:newns="http://www.mynewns.com/newns"
expressionLanguage="http://www.w3.org/1999/XPath"
targetNamespace="http://www.activiti.org/bpmn2.0">
and an element like <userTask newns:ownerID="owner1">).
Custom elements in my Activiti diagram don't work either -- the Eclipse plugin seems to discard my custom namespace and ignore my elements. Don't know why; still researching.

You can take a look at the Eclipse BPMN2 Modeler.
There are some tutorials available (e.g. extending the runtime and creating a custom task).

Related

attaching #Entity annotations to jaxb-generated classes from a wsdl

My goal is to add #Entity annotations to the classes that are generated from a wsdl. I'm using cxf-codegen-plugin's wsdl2java goal, and pointing at a local wsdl file. I can generate all the sources without any problem, but when I try to add a binding file, I'm running into problems.
Here's a segment of the wsdl (the file is CAAudit.wsdl and is in my resources directory):
<?xml version="1.0" encoding="UTF-8" ?>
<wsdl:definitions targetNamespace="http://www.ocse.gov/quick/wsdl/CAAudit.wsdl"
xmlns:audw="http://www.ocse.gov/quick/wsdl/CAAudit.wsdl"
xmlns:audx="http://www.ocse.gov/quick/wsdl/CAAudit.xsd"
xmlns:qikrsp="urn:us:gov:hhs:acf:qikrsp"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
name="CAAudit"
>
<wsdl:types>
<xsd:schema targetNamespace="http://www.ocse.gov/quick/wsdl/CAAudit.xsd"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
>
<xsd:import namespace="urn:us:gov:hhs:acf:qikrsp"
schemaLocation="QuickResponse.xsd" />
<xsd:complexType name="NotifyCAAuditRequest" >
<xsd:sequence>
<xsd:element ref="qikrsp:QuickResponse" />
</xsd:sequence>
</xsd:complexType>
....
My first question is I'm really not certain what should go in the binding file. First, I'm pretty sure that I need jaxws bindings to work with the wsdl (the jaxb binding only has the schemaLocation attribute), although I don't need to generate web service classes.
Next, I'm not sure I'm not sure if the introduction of a new xmlns in the schema element will cause problems for an xpath search. I did have problems running it with notepad++'s xpath evaluation.
Also, I'm not sure if the fact that the QuickResponse element (which is the class I want to annotate) is defined by a reference is hindering my efforts. I'm not sure if or how (or where) I would include the referenced xsd file.
Here is one possible binding file (I was just trying to get an #Generated on the class to start with):
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<jaxb:bindings
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
xmlns:jaxws="http://java.sun.com/xml/ns/jaxws"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:annox="http://annox.dev.java.net"
jaxb:extensionBindingPrefixes="annox"
jaxb:version="2.1"
>
<jaxws:bindings wsdlLocation="CAAudit.wsdl"
node="/wsdl:definitions/wsdl:types">
<jaxb:bindings node=".//xsd:schema">
<annox:annotate>#javax.annotation.Generated({"JAXWS"})</annox:annotate>
</jaxb:bindings>
</jaxws:bindings>
</jaxb:bindings>
I did not manage to customize schema embedded in WSDL. This are my latest efforts:
https://github.com/highsource/jaxb2-annotate-plugin/blob/master/tests/jaxws/src/main/resources/wsdl-bindings.xjb
What works with WSDLs is attaching customizations via SCD. But SCD does not allow proprietary customization elements (like annotate:*). So that won't help with jaxb2-annotate-plugin.
So the only thing which would probably work is to extract schema from the WSDL into an own file.

Ant tasks don't run IN IzPack installer

.
Hello, everyone
I'm studying IzPack as a tool to be used in a future project and I'm really enjoying it. It's as flexible as I need and makes the process much more easy. I have even submmited a silly pull request at github with a modification I needed to my purposes. Who knows?
Although I don't find it particularly complicated, I've been stuck trying to use a resource for some days. I need that certain Ant Tasks to be executed in certain points of the installation process (right before everything is unpacked is the really one that matters) and that is not working, besides all the efford. :(
My current state, that seems right looking at examples, is the following:
[ My current use of this is based on an example I found here (the docs don't clear too much when It cames to these kind of Actions.]
In my definitions xml file, I included some things:
First, the AntActionsSpect.xml and the .jars, followed by the listeners:
<resources>
...
<res id="AntActionsSpec.xml" src="specs/AntActionsSpec.xml" />
...
</resources>
<jar src="libs/ant/ant.jar" stage="both" />
<jar src="libs/ant/ant-launcher.jar" stage="both" />
<listeners>
<listener classname="AntActionInstallerListener" stage="install" />
<listener classname="AntActionUninstallerListener" stage="uninstall" />
</listeners>
<pack name="test_app" required="yes" installGroups="Application Core">
...
In the specs/AntActionsSpec.xml file, I have the following:
<pack name="test_app">
<antcall order="beforepacks" quiet="no" verbose="yes" buildfile="$INSTALL_PATH/ant-tasks.xml">
<property name="INSTALL_PATH" value="$INSTALL_PATH" />
<target name="touch_beforepacks" />
</antcall>
</pack>
And the ant-tasks.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<project>
<target name="touch_beforepacks">
<touch file="$INSTALL_PATH/beforepacks.txt"/>
</target>
</project>
Nothing special here, just creating a dumb file.
The ant-tasks.xml is unpacked right before anyone else. Everything builds with no error, even if I create one "mistake" at AntActionsSpec or ant-tasks.xml, what suggests me that they aren't even been loaded, though if I mess with the path where the definitions file has them, the build will fail.
I would like some help addressing that. I'm probably making some stupid little error and just can't see it by myself. If any of you could provide an example of a running build, that would be sweet.
If I can give any more information, please, let me known so I can update the question.
Thank you very much.
Just found it using a forum on a Google Groups discussion: [izpack-user] Quick question on variable substitution.
Unfortunattly the I will conclude that the docs are misleading. The docs in
"AntActionInstallerListener and AntActionUninstallerListener" until this date are stating that I should use this listener configuration:
<listeners>
<listener classname="AntActionInstallerListener" stage="install" />
<listener classname="AntActionUninstallerListener" stage="uninstall" />
</listeners>
That is what is up there, in the question. Comparing my XML code with the one in the Google Groups discussion, I found a different use of it:
<listeners>
<listener installer="AntActionInstallerListener"
uninstaller="AntActionUninstallerListener" />
</listeners>
In fact, that is the instruction given in the other wiki: Ant Actions (InstallerListener and UninstallerListener), what points out that I something can be wrong under the hood, but that is a story to another episode.
That just works. The Ant tasks are executed properly. :)
I just could not find where freaking Codehaus will allow me to grab a login and edit the docs wiki. >:( . If someone could endorse-me with some testing and then adjust the wiki for future happiness or just give a link to this tired programmer, I'd be happy.

Modifying Wsdl2Apex Generated Classes to Handle xs:extension and imported namespaces

I am having trouble with wsdl2apex code generation, mainly due to the use of xs:import namespace and xs:extension in my WSDL.
In particular, I am seeing the error System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element . . .. The raw SOAP response returned by the web service looks as I would expect.
I would like to modify the generated Apex classes to work around this issue, as server-side changes to the web service is not an option.
The SOAP response looks like the below:
<ns:getAccountsResponse>
<ns:return xsi:type="ax1:AccountReturn">
<ax2:successful>true</ax2:successful>
<ax2:transactionId>1000</ax2:transactionId>
<ax1:Accounts xsi:type="ax1:Account">
And the WSDL looks like this for the ax1 target namespace:
<xs:complexType name="AccountReturn">
<xs:complexContent>
<xs:extension base="ax100:BaseReturnObject">
<xs:sequence>
<xs:element maxOccurs="unbounded" minOccurs="0" name="Accounts" nillable="true" type="ax1:Account"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
And for the ax2 target namespace:
<xs:complexType name="BaseReturnObject">
<xs:sequence>
<xs:element minOccurs="0" name="successful" type="xs:boolean"/>
<xs:element minOccurs="0" name="transactionId" nillable="true" type="xs:integer"/>
</xs:sequence>
</xs:complexType>
The generated Apex Class which maps to AccountReturn only contains the fields for Accounts in ax1, but not the BaseReturnObject fields in ax2, since the wsdl2apex generation does not respect the use of xs:extension or the importing of namespaces (based on my research).
Is there anyway to modify the Apex Class to make this work? I tried adding the fields from BaseReturnObject to AccountReturn, and modifying field_order_type_info. However, it appears that apex_schema_type_info can only point to one namespace, and this may be the reason that the parsing of the callout response is still failing.
I've built a tool for automating the creation of the Apex classes. It includes support for xs:extension and xs:import (among other things).
In the case of an ex:extension, the tool will pull the required fields from the base class into the subclass and correctly configure the _type_info members.
You can get it for free - FuseIT SFDC Explorer. Currently in only runs directly in Windows. I've had reports of people running it successfully using Wine. (Disclosure: I work for the company that releases this tool).
Incidentally, the salesforce.stackexchange.com site is a great place to ask Salesforce specific questions.

svcutil generated unneccesary wrapper classes

I am working on a project that uses the contract first approach. I was given a WSDL and three xsd's. When I use svcutil it generates a wrapper around the response class like so:
public partial class getDataByIdResponse1 {
public getDataByIdResponse getDataByIdResponse;
public getDataByIdResponse1() {
}
public getDataByIdResponse1(getDataByIdResponse getDataByIdResponse) {
this.getDataByIdResponse = getDataByIdResponse;
}
}
The getDataByIdResponse is wrapped inside a getDataByIdResponse1 object. This is done by svcutil and I have no idea why. The getDataByIdResponse1 object does not exist in the WSDL:
<wsdl:message name="getDataById">
<wsdl:part name="response" element="tns:getDataByIdResponse"/>
</wsdl:message>
<xs:element name="getDataByIdResponse">
<xs:complexType>
<xs:sequence>
<xs:element name="data" type="sbc:DataType" minOccurs="1" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
</xs:element>
Why is the type getDataByIdResponse wrapped in getDataByIdResponse1? Is there a switch for svcutil I should have used?
I'm in the same boat as you but I don't just want to live with it. I want to generate clean (unwrapped) contracts. If the wsdl and xsd's were given to you then there are some rules that your schema and wsdl need to follow in order for svc util to generate unwrapped code. These links helped me understand the issue a little better
http://pzf.fremantle.org/2007/05/handlign.html
http://mharbauer.wordpress.com/2007/10/19/wcf-datacontract-serializer-and-documentwrapped/
For now my schema and wsdl are small enough that I can tweak them to adhere to this rules.
However, like Ron, I've also been in situations where the easiest thing is just to live with it.
Hope this helps.
I am in the same situation (contract-first) and svcutil is generating this same kind of code for me but I just closed my eyes took a deep breath and accepted it :-)
Just use the types without the numeric postfix and it just works.

Importing schema with XMLmapper in Delphi?

I try to import some valid schema (for xmlspy and oxygen) with XMLMapper in delphi and I have this error
"Error Flux if:InfofileType unknown".
I use namespace and this type is define in another file.
Is there a way to solve this ?
(I also try with Delphi 2010 demo and it still not work)
<?xml version="1.0" encoding="UTF-8" ?>
- <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:if="http://www.gtest.fr/Apps/InfoFile" xmlns:ca="http://www.gtest.fr/Apps/CommandAnswer" elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:import namespace="http://www.gtest.fr/Apps/InfoFile" schemaLocation="InfoFile.xsd" />
<xs:import namespace="http://www.gtest.fr/Apps/CommandAnswer" schemaLocation="CommandAnswer.xsd" />
- <xs:element name="ServerAnswer">
- <xs:annotation>
<xs:documentation>Reponse serveur socket</xs:documentation>
</xs:annotation>
- <xs:complexType>
- <xs:sequence>
<xs:element name="InfoFile" type="if:InfoFileType" />
<xs:element name="Command" type="ca:CommandAnswerType" />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
reported in QC : http://qc.embarcadero.com/wc/qcmain.aspx?d=80124
I would still try to grab a Delphi 2010 (trial) and see if it works there.
I know there has been significant work done there in D2009 and D2010. It was notoriously bad at doing imports and includes.
Much better now...
If you cannot solve this, I would recommend to manually edit the schemas to remove the include/import and build a big fat XSD without the external file. It should work better.
That's how I did with a rather intricate set of schemas that even .Net lib would choke on.
Update: Could you try to replace the if:InfoFile by another symbol to avoid any clash with the if reserved word; i.e. search 'n' replace if in the schemas by _if_ or anything else... The XML mapper is supposed to care of this but, ya know...
Eric Thorniley finally give me the way to go here.
It seems XML Mapper does not
understand the namespaces correctly.
You can however coax it into life by
adding an extra namespace definition
into the imported files. This is, I am
sure, not right.
So, for instance, in your
Insurance.xsd you declare
xmlns:Utils="http://www.gtest.fr/Apps/Utils"
If you add exactly the same definition
into Utils.xsd, XML Mapper imports it
correctly (I think!)
Ther is a fair chance that XML Spy
would strip out my modifications -
certainly Enterprise Architect ignores
them completely.
I'd like to see the message that Eric Thorniley pointed you to, but it is no longer there. I might be able to find it in an archive somewhere, if I had the subject of the message. I tried a Google search but all I found were duplicate copies of this post on different sites.
Thanks

Resources