Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Process Manager (Stardust) » BPMS SPI Monitoring - IProcessExecutionMonitor(Some query on using the SPI monitoring technique )
BPMS SPI Monitoring - IProcessExecutionMonitor [message #1139059] Tue, 15 October 2013 14:05 Go to next message
Kunal Suri is currently offline Kunal SuriFriend
Messages: 60
Registered: April 2013
Location: Grenoble, France
Member
Hello,

Thanks a lot for the wiki page update and explanation on the use of IWorklistMonitor [1]. I used it and it worked pretty fine.

Now, I am trying to use the IProcessExecutionMonitor in the similar way. I created my own class called ProcessMonitoringProbe and want to give custom push notifications when the process complete and starts

While trying to add my fully qualified implementation class name to org.eclipse.stardust.engine.core.spi.monitoring.IProcessExecutionMonitor in the META-INF/services folder of carnot-engine.jar, I found some other class name already present there i.e. org.eclipse.stardust.engine.core.monitoring.DefaultProcessExecutionMonitor

I removed this class name and added the class file I created and my code was giving the push notifications when the process started to run and when it got completed.

But, I am not sure how to give both the file names together ?
org.eclipse.stardust.engine.core.monitoring.DefaultProcessExecutionMonitor and org.eclipse.stardust.example.IProcessExecutionMonitor

This is because, I am not sure what the DefaultProcessExecutionMonitor class is doing and thus do not want to remove it.

The same with the *.IActivityInstanceMonitor file in the META-INF/services folder.

Please do guide me how to make use of my custom class along with the default class present in the *.IProcessExecutionMonitor file.

Thanks!
Kunal


[1] http://wiki.eclipse.org/Stardust/Knowledge_Base/Java_API/IWorklistMonitor_Example

[Updated on: Fri, 18 October 2013 14:06]

Report message to a moderator

Re: BPMS Push Monitoring - IProcessExecutionMonitor [message #1139175 is a reply to message #1139059] Tue, 15 October 2013 15:39 Go to previous messageGo to next message
Jan Hendrik Scheufen is currently offline Jan Hendrik ScheufenFriend
Messages: 65
Registered: October 2011
Member

Hi Kunal,

you can just add your implementation to the appropriate 'services' file (org.eclipse.stardust.engine.core.spi.monitoring.IProcessExecutionMonitor). Simply put your class name on a separate line.

See also: http://docs.oracle.com/javase/6/docs/api/java/util/ServiceLoader.html

As far as I understand the contract, you don't even need to open the carnot-engine.jar to add your implementation there. You can provide your own JAR with the META-INF/services/org.eclipse.stardust.engine.core.spi.monitoring.IProcessExecutionMonitor file and it should be recognized by the ServiceLoader as long as its on the classpath.

Regards,

Jan
Re: BPMS Push Monitoring - IProcessExecutionMonitor [message #1140553 is a reply to message #1139175] Wed, 16 October 2013 12:42 Go to previous messageGo to next message
Kunal Suri is currently offline Kunal SuriFriend
Messages: 60
Registered: April 2013
Location: Grenoble, France
Member
Hi Jan,

Could you please provide a bit more details on the your below point:

you don't even need to open the carnot-engine.jar to add your implementation there. You can provide your own JAR with the META-INF/services/org.eclipse.stardust.engine.core.spi.monitoring.IProcessExecutionMonitor file

I normally define my classes in the Java Resource/src Folder in my Project in Eclipse tool and deploy my programs that I create from there directly to test them.

Could you kindly let me know which META-INF/ folder should I choose to put my file?
As there is an META-INF under ipp-portal folder and one also in WebContent.

Thanks,
Kunal
Re: BPMS Push Monitoring - IProcessExecutionMonitor [message #1140683 is a reply to message #1140553] Wed, 16 October 2013 14:32 Go to previous messageGo to next message
Jan Hendrik Scheufen is currently offline Jan Hendrik ScheufenFriend
Messages: 65
Registered: October 2011
Member

Hi,

I think you have two location options for storing your own services file

  1. Inside the web project
    As you noted correctly there are already two folders in the web project called META-INF. The content of both gets merged when the project is deployed, so it does not matter which one you use. I'd recommend to use the location WebContent/META-INF/services/, because it's more of a standard location where others would expect to find such files.
  2. In a custom JAR project
    If you want to go one step further, you can also create your own JAR project (in Eclipse: File > New > Other > JEE > Utility Project) and include it into the web project for deployment: Right-click on the web project > Properties > Deployment Assembly > Add > Project.
    In your utility project you can then create the required folders and files underneath the src/ folder.
    We typically recommend this approach, because it makes life easier in the long run to keep custom code and files outside of the web project. For example, you can upgrade or just throw away and recreate the web project without losing any of your custom files.


Let me know if you have any further questions. Disclaimer: I've not tried the above setup myself, yet, but according to the specification this SHOULD work. Smile
Re: BPMS Push Monitoring - IProcessExecutionMonitor [message #1140793 is a reply to message #1140683] Wed, 16 October 2013 16:10 Go to previous message
Kunal Suri is currently offline Kunal SuriFriend
Messages: 60
Registered: April 2013
Location: Grenoble, France
Member
Hi Jan,

Thanks a lot for your quick response Smile

I tried using the step 1 - No Outcome (I hope I didn't do it wrong!)

I tried Step 2 and got the results as expected Very Happy

Thus, its preferably easier for Stardust to read from the jar file as described in step 2 and I totally agree its more cleaner and reusable to write the code in that format.

Thanks again!
Kunal

Jan Hendrik Scheufen wrote on Wed, 16 October 2013 10:32
Hi,

I think you have two location options for storing your own services file

  1. Inside the web project
    As you noted correctly there are already two folders in the web project called META-INF. The content of both gets merged when the project is deployed, so it does not matter which one you use. I'd recommend to use the location WebContent/META-INF/services/, because it's more of a standard location where others would expect to find such files.
  2. In a custom JAR project
    If you want to go one step further, you can also create your own JAR project (in Eclipse: File > New > Other > JEE > Utility Project) and include it into the web project for deployment: Right-click on the web project > Properties > Deployment Assembly > Add > Project.
    In your utility project you can then create the required folders and files underneath the src/ folder.
    We typically recommend this approach, because it makes life easier in the long run to keep custom code and files outside of the web project. For example, you can upgrade or just throw away and recreate the web project without losing any of your custom files.


Let me know if you have any further questions. Disclaimer: I've not tried the above setup myself, yet, but according to the specification this SHOULD work. Smile

Previous Topic:Getting error while deploying processes in updated version of Startdust
Next Topic:BPMS SPI Monitoring - IActivityInstanceMonitor
Goto Forum:
  


Current Time: Fri Dec 19 21:43:55 GMT 2014

Powered by FUDForum. Page generated in 0.02097 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software