cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a custom integration similar to Alfresco integratio

pgb
Champ in-the-making
Champ in-the-making
Hi,

New here. I'm looking into Activiti as a possible embedded BPM engine for our application platform. As we use Eclipse already for development, I'd like to create a tight integration between our current development tools in Eclipse and the Activiti Designer as well. With that, I mean that instead of users having to use Java Classes, they can utilize the business logic building block that they have already defined in our application platform (which uses JavaScript through Rhino as scripting language).

If I look at the current version (5.9.3), I see there's an integration for Alfresco (some custom tasks, an alfrescoScriptType for Listeners), but looking at the sourcecode, this integration seems completely hardcoded (at least for the ListenerTypes). The sort of integration that seems to have been created for Alfresco however, seems similar to what I'm looking for.

Ideally, I'd like to be able to extend the Designer, possibly through Eclipse extension points. In the process, I'd like to be able to disable the standard Listener Types (Java class, Expression, Delegate Expression and Alfresco Script) and provide my own implementations.

I see there are several topics on extension points already, but they don't seem to cover this angle:
http://forums.activiti.org/en/viewtopic.php?f=8&t=4234&start=0
http://forums.activiti.org/en/viewtopic.php?f=8&t=2718

Is anything along these lines in the planning (or am I missing something and it's already possible)?

TIA, P

Note: I know that I can already just hide the Alfresco integration through preferences.
5 REPLIES 5

tiesebarrell
Champ in-the-making
Champ in-the-making
pgb,

we have functionality to extend Designer diagrams with custom elements in the palette with their own configurable properties. They are called CustomServiceTasks and their implementation and current capabilities are described in the userguide here: http://activiti.org/userguide/index.html#eclipseDesignerCustomizingPalette

Would that not fit your purpose?

pgb
Champ in-the-making
Champ in-the-making
Hi,

As far as I see, those extension options do not allow me to add my own implementation for Listeners, like what was done for the alfrescoScriptType, nor allows me to hide the current ones.

Or is that possible?

I did see I can hide all entries in the Palette, except for the Select, Marquee and SequenceFlow (the last one having a Listeners tab under Properties), so I could replace them all with my own inplementations, but I'm unsure how much control I'd have over the exposed properties on my custom implementations

P.

tiesebarrell
Champ in-the-making
Champ in-the-making
You can use the properties as described in the userguide. At the moment, there's no other way to customize the way for instance a TEXT field will look other than by changing Designer's sources.

With regards to the listeners, you can specify a runtime class for the nodes which must be a JavaDelegate. You can invoke any listeners you want from there - this class is in your full control and unaffected by any user action when modelling the diagram. If you want to go all the way and use the default listener mechanism, you'd have to write your own ExportMarshaller so you have full control over the BPMN generated and can insert the listeners there. ExportMarshallers are currently not invoked in Designer's 5.9.1 version, so you would have to wait for an upcoming release when these will be reintroduced to use that option.

Does that help?

pgb
Champ in-the-making
Champ in-the-making
Hi,

Based on your answer, I think I haven't been able to make clear what I'm after exactly, as I'm not really interested in how things look for example.

What I'm after is providing tight integration with the programming environment of our application platform and at the same time hiding complexity.

For example the ability to assign Listeners to different objects in the workflow: when you add a new Listener to an object in the diagram, you can currently choose "Java class", Expression, DelegateExpression or "Alfresco Script". To the users/developers on our platform, none of these make much sense, as they write their business logic inside our Eclipse based IDE in JavaScript and the JavaScript scopes are setup with a whole bunch of specific "objects" to perform certain activities, like accessing data in SQL databases, printing something to the log files etc.

So, with "tight integration" I mean that I would like to hide the options "Java class", Expression, DelegateExpression or "Alfresco Script" and instead provide our own implementation, so that when users click the new button to add a Listener, they are presented with a dialog that is tailored towards them, with options  that make sense within our environment.

Your suggestion to create a runtime class that implements JavaDelegate which would be under our full control is something that doesn't suit our environment: in our environment users/developers use JavaScript to define logic, to Listener implementations would be JavaScript functions. Going the Java class route you're suggesting would mean that for every listener that the users/developers create, there should be somehow a Java class generated that implements JavaDelegate and calls the JavaScript function, just to be able to design the workflow (without the Javaclass being on the classpath, you cannot select it in the designer). So I'd rather be able to provide my users/developers an interface in the designer where, if they choose to add a listener, they are presented with a UI in which they can select a JavaScript function that they have already defined in our environment and then in the background we'll take care somehow that it gets properly hooked up.

And the tight integration goes further: for example the "Form" tab on properties: our environment already provides mechanisms to create UI's, so instead of having the option to add form properties, tight integration with our platform would mean a completely different approach. I did read a bit about the abilities to work with external UI technologies, so things might be possible in that area. Haven't looked at it in detail yet.

Hope this clarifies things a bit more.

Looking at the code and the available docs, I guess what I'm after is not yet possible, also based on how the Alfresco integration seems to be hardcoded into the source, instead of through extensions. I hope I overlooked something, but if not, the question is: is the type of extending I'm talking about on the roadmap or something that could be considered for the roadmap?

P.

tiesebarrell
Champ in-the-making
Champ in-the-making
OK, that makes it more clear what you're trying to achieve. Simply put, no, at present you can't do that with the features we have. We do however have a request outstanding which would add the option to execute arbitrary SWT code from a button in the properties pane. From that point, you would be on your own though. Which would also make it hard to save the contents from your popup to the BPMN, get them back on re-editing. etc, so we'd have to figure out a way to do that. Which should be doable, especially if we define an extension point to do it.

Would you want to use the default palette's shapes or would you be using custom nodes? That would make a big difference.