Extend NB6.1 BPEL Editor with new activities.

View: New views
11 Messages — Rating Filter:   Alert me  

Extend NB6.1 BPEL Editor with new activities.

by Razvan Popescu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello All, 

I would like to extend the BPEL editor with new activities. 
I would like to add these activities in the BPEL editor's palette 
and use them as normal BPEL activities. 

Hence, I would like to be able to: 
- drag and drop the new activities, 
- generate some XML code (that I will have to define for each 
new activity), 
- modify the XML code either using the XML editor, or using 
the properties window. 

I would be interested to know: 
- where I can find information/documentation on the source 
code of the BPEL editor. The BPEL projects (Core, Debugger 
API, Editors, Editors API, Mapper, Model, and Project) do 
not seem to describe thoroughly the "mechanics" of the editor, 
and I did not find related information on the 
nbentpack@... mailinglist. 

and 

- whether someone could point me in the right direction. For 
example, which projects/packages I should look into, 
general guidelines for adding new activities in the editor's 
palette, aso. 

Any kind of info is welcome of course. 

Thank you, 
razvan. 

Re: Extend NB6.1 BPEL Editor with new activities.

by Gabriel Badescu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Razvan - are you only interested in the design-time model (BPEL
Editor) or would you also like to execute these custom activities you
will be adding. I would like to understand more about your use-case so
we could provide you with the right help.
Thanks,
Gabe

Razvan Popescu wrote:

> Hello All,
>
> I would like to extend the BPEL editor with new activities.
> I would like to add these activities in the BPEL editor's palette
> and use them as normal BPEL activities.
>
> Hence, I would like to be able to:
> - drag and drop the new activities,
> - generate some XML code (that I will have to define for each
> new activity),
> - modify the XML code either using the XML editor, or using
> the properties window.
>
> I would be interested to know:
> - where I can find information/documentation on the source
> code of the BPEL editor. The BPEL projects (Core, Debugger
> API, Editors, Editors API, Mapper, Model, and Project) do
> not seem to describe thoroughly the "mechanics" of the editor,
> and I did not find related information on the
> n bentpack@... <mailto:bentpack@...> mailinglist.
>
> and
>
> - whether someone could point me in the right direction. For
> example, which projects/packages I should look into,
> general guidelines for adding new activities in the editor's
> palette, aso.
>
> Any kind of info is welcome of course.
>
> Thank you,
> razvan.

Re: Extend NB6.1 BPEL Editor with new activities.

by Razvan Popescu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Gabriel,

Thanks for the prompt reply. At the moment I am interested only in the  
design part
(adding the activity in the palette, drag and drop it into the process  
model, edit it's
properties, and deploy/modify its corresponding source code).

I would basically be interested to know which packages deal e.g., with  
the addition
of the new activity in the palette. I would guess that BPEL Editors is  
the project in
charge of this. Is this correct?

Thanks,
razvan.


On 1 May 2008, at 15:25, Gabriel Badescu wrote:

> Hello Razvan - are you only interested in the design-time model  
> (BPEL Editor) or would you also like to execute these custom  
> activities you will be adding. I would like to understand more about  
> your use-case so we could provide you with the right help.
> Thanks,
> Gabe
>
> Razvan Popescu wrote:
>> Hello All,
>> I would like to extend the BPEL editor with new activities. I would  
>> like to add these activities in the BPEL editor's palette and use  
>> them as normal BPEL activities.
>> Hence, I would like to be able to: - drag and drop the new  
>> activities, - generate some XML code (that I will have to define  
>> for each new activity), - modify the XML code either using the XML  
>> editor, or using the properties window.
>> I would be interested to know: - where I can find information/
>> documentation on the source code of the BPEL editor. The BPEL  
>> projects (Core, Debugger API, Editors, Editors API, Mapper, Model,  
>> and Project) do not seem to describe thoroughly the "mechanics" of  
>> the editor, and I did not find related information on the n bentpack@...
>>  <mailto:bentpack@...> mailinglist.
>> and
>> - whether someone could point me in the right direction. For  
>> example, which projects/packages I should look into, general  
>> guidelines for adding new activities in the editor's palette, aso.
>> Any kind of info is welcome of course.
>> Thank you, razvan.


Re: Extend NB6.1 BPEL Editor with new activities.

by Gabriel Badescu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Razvan  - there were 2 similar threads at nbentpack - if you do a
search on the nbentpack mailing list you should be able to find them.
Here are the titles:

1) two questions about how to extend BPEL model
2) still about how to generate BPEL process without GUI designer

Let us know if these help. If you can share more of what use-case you
are trying to implement that would be great also - we are always
interested in how the BPEL Editor can be extended to deal with new
use-cases.
Thanks,
Gabe

Razvan Popescu wrote:

> Hi Gabriel,
>
> Thanks for the prompt reply. At the moment I am interested only in the
> design part
> (adding the activity in the palette, drag and drop it into the process
> model, edit it's
> properties, and deploy/modify its corresponding source code).
>
> I would basically be interested to know which packages deal e.g., with
> the addition
> of the new activity in the palette. I would guess that BPEL Editors is
> the project in
> charge of this. Is this correct?
>
> Thanks,
> razvan.
>
>
> On 1 May 2008, at 15:25, Gabriel Badescu wrote:
>
>> Hello Razvan - are you only interested in the design-time model (BPEL
>> Editor) or would you also like to execute these custom activities you
>> will be adding. I would like to understand more about your use-case
>> so we could provide you with the right help.
>> Thanks,
>> Gabe
>>
>> Razvan Popescu wrote:
>>> Hello All,
>>> I would like to extend the BPEL editor with new activities. I would
>>> like to add these activities in the BPEL editor's palette and use
>>> them as normal BPEL activities.
>>> Hence, I would like to be able to: - drag and drop the new
>>> activities, - generate some XML code (that I will have to define for
>>> each new activity), - modify the XML code either using the XML
>>> editor, or using the properties window.
>>> I would be interested to know: - where I can find
>>> information/documentation on the source code of the BPEL editor. The
>>> BPEL projects (Core, Debugger API, Editors, Editors API, Mapper,
>>> Model, and Project) do not seem to describe thoroughly the
>>> "mechanics" of the editor, and I did not find related information on
>>> the n bentpack@... <mailto:bentpack@...> mailinglist.
>>> and
>>> - whether someone could point me in the right direction. For
>>> example, which projects/packages I should look into, general
>>> guidelines for adding new activities in the editor's palette, aso.
>>> Any kind of info is welcome of course.
>>> Thank you, razvan.
>

--
Gabriel Badescu
Open ESB Community (http://open-esb.org)  



Re: Extend NB6.1 BPEL Editor with new activities.

by Razvan Popescu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Gabriel,

On 1 May 2008, at 16:42, Gabriel Badescu wrote:

> Hello Razvan  - there were 2 similar threads at nbentpack - if you  
> do a search on the nbentpack mailing list you should be able to find  
> them. Here are the titles:
>
> 1) two questions about how to extend BPEL model

I actually read this first thread yet it deals with a slightly  
different problem (to the best of my understanding): how to add  
activities to a given BPEL process without using the GUI (palette).

>
> 2) still about how to generate BPEL process without GUI designer

I'll have a look at this thread then. It seems though that it does not  
involve the editor's UI.

>
>
> Let us know if these help. If you can share more of what use-case  
> you are trying to implement that would be great also - we are always  
> interested in how the BPEL Editor can be extended to deal with new  
> use-cases.

Roughly, what I'm interested in is adding a new activity call it  
"myNewActivity" in the editor's palette and be able to use it as the  
other existing activities. For example, for simplicity I'd like to add  
a copy of the assign activity
called "myNewActivity".

I'll probably send another email after reading the thread you suggested.

Thanks again,
razvan.

>
> Thanks,
> Gabe
>
> Razvan Popescu wrote:
>> Hi Gabriel,
>>
>> Thanks for the prompt reply. At the moment I am interested only in  
>> the design part
>> (adding the activity in the palette, drag and drop it into the  
>> process model, edit it's
>> properties, and deploy/modify its corresponding source code).
>>
>> I would basically be interested to know which packages deal e.g.,  
>> with the addition
>> of the new activity in the palette. I would guess that BPEL Editors  
>> is the project in
>> charge of this. Is this correct?
>>
>> Thanks,
>> razvan.
>>
>>
>> On 1 May 2008, at 15:25, Gabriel Badescu wrote:
>>
>>> Hello Razvan - are you only interested in the design-time model  
>>> (BPEL Editor) or would you also like to execute these custom  
>>> activities you will be adding. I would like to understand more  
>>> about your use-case so we could provide you with the right help.
>>> Thanks,
>>> Gabe
>>>
>>> Razvan Popescu wrote:
>>>> Hello All,
>>>> I would like to extend the BPEL editor with new activities. I  
>>>> would like to add these activities in the BPEL editor's palette  
>>>> and use them as normal BPEL activities.
>>>> Hence, I would like to be able to: - drag and drop the new  
>>>> activities, - generate some XML code (that I will have to define  
>>>> for each new activity), - modify the XML code either using the  
>>>> XML editor, or using the properties window.
>>>> I would be interested to know: - where I can find information/
>>>> documentation on the source code of the BPEL editor. The BPEL  
>>>> projects (Core, Debugger API, Editors, Editors API, Mapper,  
>>>> Model, and Project) do not seem to describe thoroughly the  
>>>> "mechanics" of the editor, and I did not find related information  
>>>> on the n bentpack@... <mailto:bentpack@...>  
>>>> mailinglist.
>>>> and
>>>> - whether someone could point me in the right direction. For  
>>>> example, which projects/packages I should look into, general  
>>>> guidelines for adding new activities in the editor's palette, aso.
>>>> Any kind of info is welcome of course.
>>>> Thank you, razvan.
>>
>
> --
> Gabriel Badescu
> Open ESB Community (http://open-esb.org)
>


Re: Extend NB6.1 BPEL Editor with new activities.

by Razvan Popescu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Gabriel, Hi All, 

I couldn't find the info I needed in the second thread neither. 

I'll try to expand a bit the topic. So, I'd like to add a button on the Palette Manager 
(see Tools/Palette/BPEL Activities in NB's menu), call it "AddNewActivity" that once 
pressed adds a new activity in the selected category. It might bring up a window that 
lets users specify e.g., where from to take the info on the new activity. Such description 
of the new activity (such as xml template, icon(s) aso.) I could load it from an existing 
package (which I haven't defined yet btw.). 

I hope this explanation clarifies a bit the way in which I'm trying to extend the editor. 

As regards the info/documentation, I'm mainly investigating the following: 

1. The NB source code (mostly the BPEL modules), 
and 

From the source code, it looks like I have to deal with the PaletteFactory, 
PaletteController, PaletteActions, aso. 

Do you agree? 

On the one hand, if I'm not wrong, it looks like the BPEL activities are hard 
coded (tightly integrated) in the editor (e.g., basic activities are defined in 
...modules.bpel.palette.resources.basic). 

Do you agree with this as well? 

What I am trying to do is to allow the "dynamic" (run-time) addition of activities. 
So, I wouldn't like to have to re-compile the BPEL editor every time I need to add 
a new activity. Instead, I would like to plug them in the editor at run-time. 

I recently found this tutorial that might help: NetBeans Editor Component Palette 

I'll be back with some more questions/comments as soon as I'll have some new 
info. 

Thanks, 
razvan. 
 
On 1 May 2008, at 16:42, Gabriel Badescu wrote:

Hello Razvan  - there were 2 similar threads at nbentpack - if you do a search on the nbentpack mailing list you should be able to find them. Here are the titles:

1) two questions about how to extend BPEL model
2) still about how to generate BPEL process without GUI designer

Let us know if these help. If you can share more of what use-case you are trying to implement that would be great also - we are always interested in how the BPEL Editor can be extended to deal with new use-cases.
Thanks,
Gabe

Razvan Popescu wrote:
Hi Gabriel,

Thanks for the prompt reply. At the moment I am interested only in the design part
(adding the activity in the palette, drag and drop it into the process model, edit it's
properties, and deploy/modify its corresponding source code).

I would basically be interested to know which packages deal e.g., with the addition
of the new activity in the palette. I would guess that BPEL Editors is the project in
charge of this. Is this correct?

Thanks,
razvan.


On 1 May 2008, at 15:25, Gabriel Badescu wrote:

Hello Razvan - are you only interested in the design-time model (BPEL Editor) or would you also like to execute these custom activities you will be adding. I would like to understand more about your use-case so we could provide you with the right help.
Thanks,
Gabe

Razvan Popescu wrote:
Hello All,
I would like to extend the BPEL editor with new activities. I would like to add these activities in the BPEL editor's palette and use them as normal BPEL activities.
Hence, I would like to be able to: - drag and drop the new activities, - generate some XML code (that I will have to define for each new activity), - modify the XML code either using the XML editor, or using the properties window.
I would be interested to know: - where I can find information/documentation on the source code of the BPEL editor. The BPEL projects (Core, Debugger API, Editors, Editors API, Mapper, Model, and Project) do not seem to describe thoroughly the "mechanics" of the editor, and I did not find related information on the n bentpack@... <bentpack@...> mailinglist.
and
- whether someone could point me in the right direction. For example, which projects/packages I should look into, general guidelines for adding new activities in the editor's palette, aso.
Any kind of info is welcome of course.
Thank you, razvan.


--
Gabriel Badescu
Open ESB Community (http://open-esb.org)  



Re: Extend NB6.1 BPEL Editor with new activities.

by Ritesh Adval :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Razvan,

I am replying to your question here. See attached module, just compile it and install as shown below. This will install your activity in bpel palette. I have Foo activity.
Look at layer.xml and PaletteDrop to understand whats going on.
Palette is pluggable , it is what you want to do after you installed a custom activity that gets little involved and we do not have it very pluggable but there is some work around as I shown below.




This installed the bpel extension module in netbeans. See BPEL Extensions category and a "Foo Activity" installed.



unfortunately the drag and drop of the activity and creating your own extension element is not pluggable yet but should be doable. Bpel editor team
can help here.

What you can do is have drag and drop to source view and create your own xml element. (or you can get handle to bpel model and create your custom model element)  This is also not perfect as when you switch to xml view the bpel palette becomes invisible. As a work around you can try opening the palette from tools menu.



Then drag and drop the foo activity to source view as shown.




This a workaround not sure will satisfy your needs now but definitely some work can be done to make it really pluggable.

Razvan Popescu wrote:
Hi Gabriel, Hi All,

I couldn't find the info I needed in the second thread neither.

I'll try to expand a bit the topic. So, I'd like to add a button on the Palette Manager
(see Tools/Palette/BPEL Activities in NB's menu), call it "AddNewActivity" that once
pressed adds a new activity in the selected category. It might bring up a window that
lets users specify e.g., where from to take the info on the new activity. Such description
of the new activity (such as xml template, icon(s) aso.) I could load it from an existing
package (which I haven't defined yet btw.).

I hope this explanation clarifies a bit the way in which I'm trying to extend the editor.

As regards the info/documentation, I'm mainly investigating the following:

1. The NB source code (mostly the BPEL modules),
2. The NB APIs (http://bits.netbeans.org/6.1/javadoc/),
and
3. The NB Developer Faq (http://wiki.netbeans.org/NetBeansDeveloperFAQ).

From the source code, it looks like I have to deal with the PaletteFactory,
PaletteController, PaletteActions, aso.

Do you agree?

On the one hand, if I'm not wrong, it looks like the BPEL activities are hard
coded (tightly integrated) in the editor (e.g., basic activities are defined in
...modules.bpel.palette.resources.basic).

Do you agree with this as well?

What I am trying to do is to allow the "dynamic" (run-time) addition of activities.
So, I wouldn't like to have to re-compile the BPEL editor every time I need to add
a new activity. Instead, I would like to plug them in the editor at run-time.

I recently found this tutorial that might help: NetBeans Editor Component Palette
Module Tutorial (http://platform.netbeans.org/tutorials/60/nbm-palette-api2.html).

I'll be back with some more questions/comments as soon as I'll have some new
info.

Thanks,
razvan.

On 1 May 2008, at 16:42, Gabriel Badescu wrote:

Hello Razvan  - there were 2 similar threads at nbentpack - if you do a search on the nbentpack mailing list you should be able to find them. Here are the titles:

1) two questions about how to extend BPEL model
2) still about how to generate BPEL process without GUI designer

Let us know if these help. If you can share more of what use-case you are trying to implement that would be great also - we are always interested in how the BPEL Editor can be extended to deal with new use-cases.
Thanks,
Gabe

Razvan Popescu wrote:
Hi Gabriel,

Thanks for the prompt reply. At the moment I am interested only in the design part
(adding the activity in the palette, drag and drop it into the process model, edit it's
properties, and deploy/modify its corresponding source code).

I would basically be interested to know which packages deal e.g., with the addition
of the new activity in the palette. I would guess that BPEL Editors is the project in
charge of this. Is this correct?

Thanks,
razvan.


On 1 May 2008, at 15:25, Gabriel Badescu wrote:

Hello Razvan - are you only interested in the design-time model (BPEL Editor) or would you also like to execute these custom activities you will be adding. I would like to understand more about your use-case so we could provide you with the right help.
Thanks,
Gabe

Razvan Popescu wrote:
Hello All,
I would like to extend the BPEL editor with new activities. I would like to add these activities in the BPEL editor's palette and use them as normal BPEL activities.
Hence, I would like to be able to: - drag and drop the new activities, - generate some XML code (that I will have to define for each new activity), - modify the XML code either using the XML editor, or using the properties window.
I would be interested to know: - where I can find information/documentation on the source code of the BPEL editor. The BPEL projects (Core, Debugger API, Editors, Editors API, Mapper, Model, and Project) do not seem to describe thoroughly the "mechanics" of the editor, and I did not find related information on the n bentpack@... bentpack@... mailinglist.
and
- whether someone could point me in the right direction. For example, which projects/packages I should look into, general guidelines for adding new activities in the editor's palette, aso.
Any kind of info is welcome of course.
Thank you, razvan.


--Gabriel Badescu
Open ESB Community (http://open-esb.org)




-- 
Ritesh Adval
Open ESB Community (http://open-esb.org) 






BPELEditorNewActivityPlugin.zip (9M) Download Attachment

Re: Extend NB6.1 BPEL Editor with new activities.

by Ritesh Adval :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

There is a how to page on bpel, xslt, iep etc, where you can get more
info/video/tutorial etc on these technologies.

http://wiki.open-esb.java.net/Wiki.jsp?page=HowToDo

I have added a link on some pointers on extending bpel editor etc. This
can be updated with additional info on this topic.

http://wiki.open-esb.java.net/Wiki.jsp?page=ExtendingNetBeansBPELEditorWithYourNewActivities


Razvan Popescu wrote:

> Hi Gabriel, Hi All,
>
> I couldn't find the info I needed in the second thread neither.
>
> I'll try to expand a bit the topic. So, I'd like to add a button on
> the Palette Manager
> (see Tools/Palette/BPEL Activities in NB's menu), call it
> "AddNewActivity" that once
> pressed adds a new activity in the selected category. It might bring
> up a window that
> lets users specify e.g., where from to take the info on the new
> activity. Such description
> of the new activity (such as xml template, icon(s) aso.) I could load
> it from an existing
> package (which I haven't defined yet btw.).
>
> I hope this explanation clarifies a bit the way in which I'm trying to
> extend the editor.
>
> As regards the info/documentation, I'm mainly investigating the
> following:
>
> 1. The NB source code (mostly the BPEL modules),
> 2. The NB APIs (http://bits.netbeans.org/6.1/javadoc/),
> and
> 3. The NB Developer Faq (http://wiki.netbeans.org/NetBeansDeveloperFAQ).
>
> From the source code, it looks like I have to deal with the
> PaletteFactory,
> PaletteController, PaletteActions, aso.
>
> Do you agree?
>
> On the one hand, if I'm not wrong, it looks like the BPEL activities
> are hard
> coded (tightly integrated) in the editor (e.g., basic activities are
> defined in
> ...modules.bpel.palette.resources.basic).
>
> Do you agree with this as well?
>
> What I am trying to do is to allow the "dynamic" (run-time) addition
> of activities.
> So, I wouldn't like to have to re-compile the BPEL editor every time I
> need to add
> a new activity. Instead, I would like to plug them in the editor at
> run-time.
>
> I recently found this tutorial that might help: NetBeans Editor
> Component Palette
> Module Tutorial
> (http://platform.netbeans.org/tutorials/60/nbm-palette-api2.html).
>
> I'll be back with some more questions/comments as soon as I'll have
> some new
> info.
>
> Thanks,
> razvan.
>  
> On 1 May 2008, at 16:42, Gabriel Badescu wrote:
>
>> Hello Razvan  - there were 2 similar threads at nbentpack - if you do
>> a search on the nbentpack mailing list you should be able to find
>> them. Here are the titles:
>>
>> 1) two questions about how to extend BPEL model
>> 2) still about how to generate BPEL process without GUI designer
>>
>> Let us know if these help. If you can share more of what use-case you
>> are trying to implement that would be great also - we are always
>> interested in how the BPEL Editor can be extended to deal with new
>> use-cases.
>> Thanks,
>> Gabe
>>
>> Razvan Popescu wrote:
>>> Hi Gabriel,
>>>
>>> Thanks for the prompt reply. At the moment I am interested only in
>>> the design part
>>> (adding the activity in the palette, drag and drop it into the
>>> process model, edit it's
>>> properties, and deploy/modify its corresponding source code).
>>>
>>> I would basically be interested to know which packages deal e.g.,
>>> with the addition
>>> of the new activity in the palette. I would guess that BPEL Editors
>>> is the project in
>>> charge of this. Is this correct?
>>>
>>> Thanks,
>>> razvan.
>>>
>>>
>>> On 1 May 2008, at 15:25, Gabriel Badescu wrote:
>>>
>>>> Hello Razvan - are you only interested in the design-time model
>>>> (BPEL Editor) or would you also like to execute these custom
>>>> activities you will be adding. I would like to understand more
>>>> about your use-case so we could provide you with the right help.
>>>> Thanks,
>>>> Gabe
>>>>
>>>> Razvan Popescu wrote:
>>>>> Hello All,
>>>>> I would like to extend the BPEL editor with new activities. I
>>>>> would like to add these activities in the BPEL editor's palette
>>>>> and use them as normal BPEL activities.
>>>>> Hence, I would like to be able to: - drag and drop the new
>>>>> activities, - generate some XML code (that I will have to define
>>>>> for each new activity), - modify the XML code either using the XML
>>>>> editor, or using the properties window.
>>>>> I would be interested to know: - where I can find
>>>>> information/documentation on the source code of the BPEL editor.
>>>>> The BPEL projects (Core, Debugger API, Editors, Editors API,
>>>>> Mapper, Model, and Project) do not seem to describe thoroughly the
>>>>> "mechanics" of the editor, and I did not find related information
>>>>> on the n bentpack@... <mailto:bentpack@...>
>>>>> mailinglist.
>>>>> and
>>>>> - whether someone could point me in the right direction. For
>>>>> example, which projects/packages I should look into, general
>>>>> guidelines for adding new activities in the editor's palette, aso.
>>>>> Any kind of info is welcome of course.
>>>>> Thank you, razvan.
>>>
>>
>> --
>> Gabriel Badescu
>> Open ESB Community (http://open-esb.org)  
>>
>

--
Ritesh Adval
Open ESB Community (http://open-esb.org)


Re: Extend NB6.1 BPEL Editor with new activities.

by Razvan Popescu :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Ritesh, 

Thanks a lot for the sources. 

- I had to remove and then add the dependencies to the "Text API" and "Utilities API" to get it working 
because I was getting compilation errors due to different versions of the two modules. 

- I successfully installed the module in Target Platform and then I got a warning message saying that 
"File SoaPalette.properties already exists in .../BPELEditorNewActivityPlugin/build/testuserdir/config". 
It actually gives me this this message every time I refresh the BPEL palette. 

- Just for curiosity, I tested the drag and drop while using the "Design view", and it creates an "invoke". 
I'm not sure why. I'll have to look carefully at the code you sent me. 

- I have also tested the drag and drop from the "Palette Manager" to the "Source view" as you suggested 
and it creates the FooActivity indeed. (BTW, The closing tag of the FooActivity is missing the "/". :) 

- I also get a javax.swing.text.BadLocationException if I try to drop the activity in a "forbidden zone" 
(e.g.,before these two closing tags </sequence> </process>). I'm not sure why I can drop the 
FooActivity yet not the other activities in the Palette Manager. 


The code you sent me is definitely a step forward. Still, I'd like to be able to: 
1. Drag/drop into the "Design view" and have a graphical representation for the new activity as well as 
a corresponding XML code in the "Source view", and 
2. Have the possibility to configure the new activity. For example, I would like to use (a slightly modified 
version of) the Mapper to map process variables on to the inputs and outputs of the new activity. 

Do you have any other suggestions that might help tackle these tasks? 

Thanks again, 
razvan. 

On 2 May 2008, at 20:09, ritesh adval wrote:

Razvan,

I am replying to your question here. See attached module, just compile it and install as shown below. This will install your activity in bpel palette. I have Foo activity.
Look at layer.xml and PaletteDrop to understand whats going on.
Palette is pluggable , it is what you want to do after you installed a custom activity that gets little involved and we do not have it very pluggable but there is some work around as I shown below.


<moz-screenshot-5.jpg>

This installed the bpel extension module in netbeans. See BPEL Extensions category and a "Foo Activity" installed.

<moz-screenshot-6.jpg>

unfortunately the drag and drop of the activity and creating your own extension element is not pluggable yet but should be doable. Bpel editor team
can help here.

What you can do is have drag and drop to source view and create your own xml element. (or you can get handle to bpel model and create your custom model element)  This is also not perfect as when you switch to xml view the bpel palette becomes invisible. As a work around you can try opening the palette from tools menu.

<moz-screenshot-7.jpg>

Then drag and drop the foo activity to source view as shown.

<moz-screenshot-9.jpg>


This a workaround not sure will satisfy your needs now but definitely some work can be done to make it really pluggable.

Razvan Popescu wrote:
Hi Gabriel, Hi All,

I couldn't find the info I needed in the second thread neither.

I'll try to expand a bit the topic. So, I'd like to add a button on the Palette Manager
(see Tools/Palette/BPEL Activities in NB's menu), call it "AddNewActivity" that once
pressed adds a new activity in the selected category. It might bring up a window that
lets users specify e.g., where from to take the info on the new activity. Such description
of the new activity (such as xml template, icon(s) aso.) I could load it from an existing
package (which I haven't defined yet btw.).

I hope this explanation clarifies a bit the way in which I'm trying to extend the editor.

As regards the info/documentation, I'm mainly investigating the following:

1. The NB source code (mostly the BPEL modules),
2. The NB APIs (http://bits.netbeans.org/6.1/javadoc/),
and
3. The NB Developer Faq (http://wiki.netbeans.org/NetBeansDeveloperFAQ).

From the source code, it looks like I have to deal with the PaletteFactory,
PaletteController, PaletteActions, aso.

Do you agree?

On the one hand, if I'm not wrong, it looks like the BPEL activities are hard
coded (tightly integrated) in the editor (e.g., basic activities are defined in
...modules.bpel.palette.resources.basic).

Do you agree with this as well?

What I am trying to do is to allow the "dynamic" (run-time) addition of activities.
So, I wouldn't like to have to re-compile the BPEL editor every time I need to add
a new activity. Instead, I would like to plug them in the editor at run-time.

I recently found this tutorial that might help: NetBeans Editor Component Palette
Module Tutorial (http://platform.netbeans.org/tutorials/60/nbm-palette-api2.html).

I'll be back with some more questions/comments as soon as I'll have some new
info.

Thanks,
razvan.

On 1 May 2008, at 16:42, Gabriel Badescu wrote:

Hello Razvan  - there were 2 similar threads at nbentpack - if you do a search on the nbentpack mailing list you should be able to find them. Here are the titles:

1) two questions about how to extend BPEL model
2) still about how to generate BPEL process without GUI designer

Let us know if these help. If you can share more of what use-case you are trying to implement that would be great also - we are always interested in how the BPEL Editor can be extended to deal with new use-cases.
Thanks,
Gabe

Razvan Popescu wrote:
Hi Gabriel,

Thanks for the prompt reply. At the moment I am interested only in the design part
(adding the activity in the palette, drag and drop it into the process model, edit it's
properties, and deploy/modify its corresponding source code).

I would basically be interested to know which packages deal e.g., with the addition
of the new activity in the palette. I would guess that BPEL Editors is the project in
charge of this. Is this correct?

Thanks,
razvan.


On 1 May 2008, at 15:25, Gabriel Badescu wrote:

Hello Razvan - are you only interested in the design-time model (BPEL Editor) or would you also like to execute these custom activities you will be adding. I would like to understand more about your use-case so we could provide you with the right help.
Thanks,
Gabe

Razvan Popescu wrote:
Hello All,
I would like to extend the BPEL editor with new activities. I would like to add these activities in the BPEL editor's palette and use them as normal BPEL activities.
Hence, I would like to be able to: - drag and drop the new activities, - generate some XML code (that I will have to define for each new activity), - modify the XML code either using the XML editor, or using the properties window.
I would be interested to know: - where I can find information/documentation on the source code of the BPEL editor. The BPEL projects (Core, Debugger API, Editors, Editors API, Mapper, Model, and Project) do not seem to describe thoroughly the "mechanics" of the editor, and I did not find related information on the n bentpack@... bentpack@... mailinglist.
and
- whether someone could point me in the right direction. For example, which projects/packages I should look into, general guidelines for adding new activities in the editor's palette, aso.
Any kind of info is welcome of course.
Thank you, razvan.


--Gabriel Badescu
Open ESB Community (http://open-esb.org)




-- 
Ritesh Adval
Open ESB Community (http://open-esb.org) 
<BPELEditorNewActivityPlugin.zip>


Re: Extend NB6.1 BPEL Editor with new activities.

by Ritesh Adval :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The build directory should go away once you do clean build.

Here are some pointers for design view when you drop the activity in it.

Look at
org.netbeans.modules.bpel.design.DnDHandler

public void drop(final DropTargetDropEvent dtde) {

put a break point in drop to debug what happens when you drop.

Look at this too:

public void dragEnter(DropTargetDragEvent dtde) {

When you drag on canvas, this method is called, here it tries to get
bpel model element for the dragged activity:
            BpelEntity entity = getBpelEntity(tr);


getBpelEntity() tries to get bpel model element from transferable:

look at this and you will know why it creates invoke when you drop new
custom activity (it is because in test module I created I still have
invoke.xml as name in layer.xml). Here there should be a pluggable
mechansim to create custom activity model.


private BpelEntity getBpelEntity(Transferable t) {

else if (Node.class.isAssignableFrom(repClass)) {
                    //DnD from palette or ProjectTree
                    entity = getPaletteItem((Node) data);
                }

getPaletteItem returns a bpel model element from palette node.


see some answer below too:


Razvan Popescu wrote:

> Hi Ritesh,
>
> Thanks a lot for the sources.
>
> - I had to remove and then add the dependencies to the "Text API" and
> "Utilities API" to get it working
> because I was getting compilation errors due to different versions of
> the two modules.
>
> - I successfully installed the module in Target Platform and then I
> got a warning message saying that
> "File SoaPalette.properties already exists in
> .../BPELEditorNewActivityPlugin/build/testuserdir/config".
> It actually gives me this this message every time I refresh the BPEL
> palette.
>
> - Just for curiosity, I tested the drag and drop while using the
> "Design view", and it creates an "invoke".
> I'm not sure why. I'll have to look carefully at the code you sent me.
>
> - I have also tested the drag and drop from the "Palette Manager" to
> the "Source view" as you suggested
> and it creates the FooActivity indeed. (BTW, The closing tag of the
> FooActivity is missing the "/". :)
>
> - I also get a javax.swing.text.BadLocationException if I try to drop
> the activity in a "forbidden zone"
> (e.g.,before these two closing tags </sequence> </process>). I'm not
> sure why I can drop the
> FooActivity yet not the other activities in the Palette Manager.
>
>
> The code you sent me is definitely a step forward. Still, I'd like to
> be able to:
> 1. Drag/drop into the "Design view" and have a graphical
> representation for the new activity as well as
> a corresponding XML code in the "Source view", and
I already answered this, there might some work  to create the gui  
representation  of your custom activity.
> 2. Have the possibility to configure the new activity. For example, I
> would like to use (a slightly modified
> version of) the Mapper to map process variables on to the inputs and
> outputs of the new activity.
>
Take a look at bpel.model.

Look at EntityFactory, I think this would allow new extension creation
factory to be registered.

Now you can register your own factory in META-INF/services of your
module. Take a look at  org.netbeans.modules.bpel.model.spi.EntityFactory
at META-INF/services in bpel editor source to see how to register this.
Also look at what extension like logging etc are done to get and idea.

Now as I mentioned above in getPaletteItem if none of the existing name
matches it should probably allow creation on custom extension.
Look at how logging extension are created in bpel editor gui. There
might be already pluggability to do this. Let me know how it goes.








> Do you have any other suggestions that might help tackle these tasks?
>
> Thanks again,
> razvan.
>
> On 2 May 2008, at 20:09, ritesh adval wrote:
>
>> Razvan,
>>
>> I am replying to your question here. See attached module, just
>> compile it and install as shown below. This will install your
>> activity in bpel palette. I have Foo activity.
>> Look at layer.xml and PaletteDrop to understand whats going on.
>> Palette is pluggable , it is what you want to do after you installed
>> a custom activity that gets little involved and we do not have it
>> very pluggable but there is some work around as I shown below.
>>
>>
>> <moz-screenshot-5.jpg>
>>
>> This installed the bpel extension module in netbeans. See BPEL
>> Extensions category and a "Foo Activity" installed.
>>
>> <moz-screenshot-6.jpg>
>>
>> unfortunately the drag and drop of the activity and creating your own
>> extension element is not pluggable yet but should be doable. Bpel
>> editor team
>> can help here.
>>
>> What you can do is have drag and drop to source view and create your
>> own xml element. (or you can get handle to bpel model and create your
>> custom model element)  This is also not perfect as when you switch to
>> xml view the bpel palette becomes invisible. As a work around you can
>> try opening the palette from tools menu.
>>
>> <moz-screenshot-7.jpg>
>>
>> Then drag and drop the foo activity to source view as shown.
>>
>> <moz-screenshot-9.jpg>
>>
>>
>> This a workaround not sure will satisfy your needs now but definitely
>> some work can be done to make it really pluggable.
>>
>> Razvan Popescu wrote:
>>> Hi Gabriel, Hi All,
>>>
>>> I couldn't find the info I needed in the second thread neither.
>>>
>>> I'll try to expand a bit the topic. So, I'd like to add a button on
>>> the Palette Manager
>>> (see Tools/Palette/BPEL Activities in NB's menu), call it
>>> "AddNewActivity" that once
>>> pressed adds a new activity in the selected category. It might bring
>>> up a window that
>>> lets users specify e.g., where from to take the info on the new
>>> activity. Such description
>>> of the new activity (such as xml template, icon(s) aso.) I could
>>> load it from an existing
>>> package (which I haven't defined yet btw.).
>>>
>>> I hope this explanation clarifies a bit the way in which I'm trying
>>> to extend the editor.
>>>
>>> As regards the info/documentation, I'm mainly investigating the
>>> following:
>>>
>>> 1. The NB source code (mostly the BPEL modules),
>>> 2. The NB APIs (http://bits.netbeans.org/6.1/javadoc/),
>>> and
>>> 3. The NB Developer Faq
>>> (http://wiki.netbeans.org/NetBeansDeveloperFAQ).
>>>
>>> From the source code, it looks like I have to deal with the
>>> PaletteFactory,
>>> PaletteController, PaletteActions, aso.
>>>
>>> Do you agree?
>>>
>>> On the one hand, if I'm not wrong, it looks like the BPEL activities
>>> are hard
>>> coded (tightly integrated) in the editor (e.g., basic activities are
>>> defined in
>>> ...modules.bpel.palette.resources.basic).
>>>
>>> Do you agree with this as well?
>>>
>>> What I am trying to do is to allow the "dynamic" (run-time) addition
>>> of activities.
>>> So, I wouldn't like to have to re-compile the BPEL editor every time
>>> I need to add
>>> a new activity. Instead, I would like to plug them in the editor at
>>> run-time.
>>>
>>> I recently found this tutorial that might help: NetBeans Editor
>>> Component Palette
>>> Module Tutorial
>>> (http://platform.netbeans.org/tutorials/60/nbm-palette-api2.html).
>>>
>>> I'll be back with some more questions/comments as soon as I'll have
>>> some new
>>> info.
>>>
>>> Thanks,
>>> razvan.
>>>
>>> On 1 May 2008, at 16:42, Gabriel Badescu wrote:
>>>
>>>> Hello Razvan  - there were 2 similar threads at nbentpack - if you
>>>> do a search on the nbentpack mailing list you should be able to
>>>> find them. Here are the titles:
>>>>
>>>> 1) two questions about how to extend BPEL model
>>>> 2) still about how to generate BPEL process without GUI designer
>>>>
>>>> Let us know if these help. If you can share more of what use-case
>>>> you are trying to implement that would be great also - we are
>>>> always interested in how the BPEL Editor can be extended to deal
>>>> with new use-cases.
>>>> Thanks,
>>>> Gabe
>>>>
>>>> Razvan Popescu wrote:
>>>>> Hi Gabriel,
>>>>>
>>>>> Thanks for the prompt reply. At the moment I am interested only in
>>>>> the design part
>>>>> (adding the activity in the palette, drag and drop it into the
>>>>> process model, edit it's
>>>>> properties, and deploy/modify its corresponding source code).
>>>>>
>>>>> I would basically be interested to know which packages deal e.g.,
>>>>> with the addition
>>>>> of the new activity in the palette. I would guess that BPEL
>>>>> Editors is the project in
>>>>> charge of this. Is this correct?
>>>>>
>>>>> Thanks,
>>>>> razvan.
>>>>>
>>>>>
>>>>> On 1 May 2008, at 15:25, Gabriel Badescu wrote:
>>>>>
>>>>>> Hello Razvan - are you only interested in the design-time model
>>>>>> (BPEL Editor) or would you also like to execute these custom
>>>>>> activities you will be adding. I would like to understand more
>>>>>> about your use-case so we could provide you with the right help.
>>>>>> Thanks,
>>>>>> Gabe
>>>>>>
>>>>>> Razvan Popescu wrote:
>>>>>>> Hello All,
>>>>>>> I would like to extend the BPEL editor with new activities. I
>>>>>>> would like to add these activities in the BPEL editor's palette
>>>>>>> and use them as normal BPEL activities.
>>>>>>> Hence, I would like to be able to: - drag and drop the new
>>>>>>> activities, - generate some XML code (that I will have to define
>>>>>>> for each new activity), - modify the XML code either using the
>>>>>>> XML editor, or using the properties window.
>>>>>>> I would be interested to know: - where I can find
>>>>>>> information/documentation on the source code of the BPEL editor.
>>>>>>> The BPEL projects (Core, Debugger API, Editors, Editors API,
>>>>>>> Mapper, Model, and Project) do not seem to describe thoroughly
>>>>>>> the "mechanics" of the editor, and I did not find related
>>>>>>> information on the n bentpack@...
>>>>>>> <mailto:bentpack@...> mailinglist.
>>>>>>> and
>>>>>>> - whether someone could point me in the right direction. For
>>>>>>> example, which projects/packages I should look into, general
>>>>>>> guidelines for adding new activities in the editor's palette, aso.
>>>>>>> Any kind of info is welcome of course.
>>>>>>> Thank you, razvan.
>>>>>
>>>>
>>>> --Gabriel Badescu
>>>> Open ESB Community (http://open-esb.org)
>>>>
>>>
>>>
>>
>> --
>> Ritesh Adval
>> Open ESB Community (http://open-esb.org)
>> <BPELEditorNewActivityPlugin.zip>
>

--
Ritesh Adval
Open ESB Community (http://open-esb.org)


Re: Extend NB6.1 BPEL Editor with new activities.