| [BPMN2] extending attribute of Process node [message #653921] |
Fri, 11 February 2011 15:57  |
tsurdilo Messages: 41 Registered: February 2011 |
Member |
|
|
I was wondering how to add custom attributes do node types. For my app I need to have for example:
<bpmn2:process id="_zoxqUDVBEeCqf5cJFwvEIg" name="myProcess" packageName="myPackage">
the packageName attribute is specific for my use only, however I am struggling to find out how to achieve this without going all the way back to the bpmn.ecore and adding a new property etc...and also cannot find any examples on maybe creating an extension only for the Process node. Is this possible?
Thanks in advance for any input!
[Updated on: Fri, 11 February 2011 15:58] Report message to a moderator
|
|
|
|
| Re: [BPMN2] extending attribute of Process node [message #654303 is a reply to message #654223] |
Mon, 14 February 2011 20:15   |
tsurdilo Messages: 41 Registered: February 2011 |
Member |
|
|
Hi Reiner, thank you for the info!
Regarding your first approach - I am creating the bpmn2 structure programatically and wanted to ask you how I could add this attribute through the API?
For example I have:
Process p = Bpmn2Factory.eINSTANCE.createProcess();
p.setProcessType(....);
p.process.setIsExecutable(...);
...
p.getAnyAttribute().add(what_goes_here??)
if you could show me an example on how to create and use an Entry here, or do I have to create a structural feature and add it, I am just not sure.
Regarding your second approach, that's really cool, do you happen to have example on how to apply the extension schema in the API?
Thanks for any input.
[Updated on: Mon, 14 February 2011 20:16] Report message to a moderator
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| Re: [BPMN2] extending attribute of Process node [message #697154 is a reply to message #697152] |
Fri, 15 July 2011 12:57   |
tsurdilo Messages: 41 Registered: February 2011 |
Member |
|
|
It's not that I would not use an extension schema, just given your time constraints and what is in your document so far, I thought it would be easier and take less time to get the existing example modified a little and get it working...that's all.
The BPMN2 modeller I am working on exposes the process info as JSON and I use eclipse.bpmn2 for marshalling/unmarshalling. The BPMN2 processes should be fully executable in jBPM5 and jBPM5 uses extension elements for on-entry and on-exit actions of task nodes and also has a good number of extension attributes.
You are right, the best scenario for me would be to be able just to have a jBPM5 extension schema to BPMN2 that everyone could use, but just getting the extension elements working in any way would be a great deal for me right now
[Updated on: Fri, 15 July 2011 13:05] Report message to a moderator
|
|
|
|
|
| Re: [BPMN2] extending attribute of Process node [message #707641 is a reply to message #697993] |
Mon, 01 August 2011 18:24   |
tsurdilo Messages: 41 Registered: February 2011 |
Member |
|
|
Hi Reiner, first of all thank you - this got me started in the right direction 
I had a question:
With my xsd I am generating following extension element to the bpmn2 task types:
<bpmn2:extensionElements>
<emfextmodel:onEntry-script scriptFormat="java">
<emfextmodel:script>System.out.println("hello");</emfextmodel:script>
</emfextmodel:onEntry-script>
</bpmn2:extensionElements>
-- is it possible to surpress the namespace of the inner elements? so for example be able to just have <script> instead of <emfextmodel:script> ... </> ?
Thanks.
[Updated on: Tue, 02 August 2011 01:41] Report message to a moderator
|
|
|
|
| Re: [BPMN2] extending attribute of Process node [message #714800 is a reply to message #714705] |
Thu, 11 August 2011 10:20   |
karthick9686@gmail.com Missing name Messages: 41 Registered: July 2011 |
Member |
|
|
i am trying to develop the bpmn2 modeler using GEF alone . I have the emf bpmn2 model in place and really confused of how to use the model and create an fully functional Bpmn2 editor using Gef alone.
i have gone through various tutorials in internet of how to build the graphical editor from emf model, but the emf bpmn2 metamodel is complex and i am stuck in the middle and i face issues when setting the bounds for each shape (setBounds and getBounds) and it goes on.
The bpmn modeler being developed at the following location (www.eclipse.org/modeling/mdt/?project=bpmn2) is using graphiti. the bpmn2 modeler i propose is done enteirly in Gef (graphical editing framework).
if anyone of u are working towards the same effort or if u know anyone creating bpmn2 modeler entirely in Gef please let me know so that we can put our efforts to accomplish the goal.
you are welcome to share your views and any resource related to this effort . Thanks IN Advance
|
|
|
|
|
|
| Re: [BPMN2] extending attribute of Process node [message #758391 is a reply to message #758192] |
Tue, 22 November 2011 23:28   |
Karthikeyan Missing name Messages: 47 Registered: July 2011 |
Member |
|
|
Hi,
Thank you for your reply. I have checked with extension its working fine, but my doubt is, whether is there any optional way of using EObject Annotation for saving the attribute values using its key and value. Because if we use extension then, the colored elements in our file does not apply while opening in other editor, but if we use annotation I can be achieved.
Thanks & Regards,
Karthikeyan
[Updated on: Tue, 22 November 2011 23:29] Report message to a moderator
|
|
|
| Re: [BPMN2] extending attribute of Process node [message #1005114 is a reply to message #697152] |
Thu, 24 January 2013 08:53  |
Marcel Mising name Messages: 5 Registered: January 2011 |
Junior Member |
|
|
Sorry for reviving this old thread.
But I still get trouble with the XML namespace prefix.
With the code:
EAttributeImpl extensionAttribute = (EAttributeImpl) metadata.demandFeature(
"www.mycompany.com/myns", "style", true, false);
I got the following XML File:
<definitions [...] xmlns:myns="www.mycompany.com/myns" [...]>
[...]
<myns:extensionElement>
[...]
</myns:extensionElement>
[...]
But I need the following output:
<definitions [...] xmlns:myns="www.mycompany.com" [...]>
[...]
<myns:extensionElement>
[...]
</myns:extensionElement>
[...]
Is there an easy way to archive this?
I tried to create and register a separated ecore file with my desired ns prefix and ns uri. Seems to have no effect at all...
The ecore registration code:
Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("ecore", new EcoreResourceFactoryImpl());
ResourceSet rs = new ResourceSetImpl();
final ExtendedMetaData extendedMetaData = new BasicExtendedMetaData(rs.getPackageRegistry());
rs.getLoadOptions().put(XMLResource.OPTION_EXTENDED_META_DATA, extendedMetaData);
URI test = URI.createFileURI(new File("file.ecore").getAbsolutePath());
Resource r = rs.getResource(test, true);
EObject eObject = r.getContents().get(0);
if (eObject instanceof EPackage) {
EPackage p = (EPackage)eObject;
rs.getPackageRegistry().put(p.getNsURI(), p);
}
The ecore file:
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmi:version="2.0"
xmlns:xmi="www.omg.org/XMI" xmlns:ecore="www.eclipse.org/emf/2002/Ecore" name="www.mycompany.com"
nsURI="www.mycompany.com" nsPrefix="myns"/>
Thanks for any advise...
P.S.: Sorry, for the missing https of the namespaces. Workaround for the eclipse spam protection -.-
[Updated on: Thu, 24 January 2013 08:56] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.05051 seconds