Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » Eclipse Process Manager (Stardust) » BPMS SPI Monitoring - IActivityInstanceMonitor(Discussion on SPI Monitoring using IActivityInstanceMonitor)
icon3.gif  BPMS SPI Monitoring - IActivityInstanceMonitor [message #1143910] Fri, 18 October 2013 14:05 Go to next message
Kunal Suri is currently offline Kunal SuriFriend
Messages: 82
Registered: April 2013
Location: Paris Saclay, France
Member

Hello,

Greetings !

I had been successful in using the push approach (SPI Monitoring) for IWorklistMonitor and IProcessExecutionMonitor. [1]

My implementation of these monitoring is giving the data that I require. But when I am trying to use the IActivityInstanceMonitor its not generating any data for me.

It has only one method i.e. - void activityInstanceStateChanged(IActivityInstance arg0, int arg1)

Thus, I was trying to print out some data when an activity changes it state. But this method is not being triggered. Not even once.

In Eclipse's console, stardust prints some data produced when a activity changes its state (by default) such as:

Quote:
15:42:37 INFO [ttp-8080-2] ActivityInstanceBean - State change for Activity instance 'ClientSetup', oid: 690 (process instance = 105): Created-->Created.

15:42:37 INFO [ttp-8080-2] ActivityInstanceBean - State change for Activity instance 'ClientSetup', oid: 690 (process instance = 105): Created-->Application.

15:42:38 INFO [ttp-8080-2] ActivityInstanceBean - State change for Activity instance 'ClientSetup', oid: 690 (process instance = 105): Application-->Completed.


Now, I wish to produce some extra data when state change occurs by implementing the IActivityInstanceMonitor.

Thus, could you please help me to understand where I could be going wrong? Or how to trigger this method?


My code that I am trying to run as below, that I am running in the same way as described in wiki for IWorklistMonitor [2] (but no desired output) :

Quote:


package xrce.monitoring.experiment.pushmodel;

import org.eclipse.stardust.engine.core.runtime.beans.IActivityInstance;
import org.eclipse.stardust.engine.core.spi.monitoring.IActivityInstanceMonitor;

public class ActivityMonitorProbe implements IActivityInstanceMonitor{

@Override
public void activityInstanceStateChanged(IActivityInstance arg0, int arg1) {
// TODO Auto-generated method stub

System.out.println(" Activity: "+ arg0.getActivity() + " performed by: " + arg0.getPerformedBy() + "Ended at: " + arg0.getLastModificationTime());

}// Method Over

}// Class Over





[1]http://www.eclipse.org/forums/index.php/t/551904/
[2] http://wiki.eclipse.org/Stardust/Knowledge_Base/Java_API/IWorklistMonitor_Example


Thanks,
Kunal

[Updated on: Mon, 21 October 2013 11:06]

Report message to a moderator

Re: BPMS SPI Monitoring - IActivityInstanceMonitor [message #1144155 is a reply to message #1143910] Fri, 18 October 2013 17:41 Go to previous messageGo to next message
Jan Hendrik Scheufen is currently offline Jan Hendrik ScheufenFriend
Messages: 77
Registered: October 2011
Member

Hi Kunal,

did you use the same approach as with the other monitors by providing a services file at META-INF/services/org.eclipse.stardust.engine.core.spi.monitoring.IActivityInstanceMonitor with your implementation class in it?

Just checking before I try to reproduce it.

Thanks!

Jan
Re: BPMS SPI Monitoring - IActivityInstanceMonitor [message #1148072 is a reply to message #1144155] Mon, 21 October 2013 08:40 Go to previous messageGo to next message
Kunal Suri is currently offline Kunal SuriFriend
Messages: 82
Registered: April 2013
Location: Paris Saclay, France
Member

Hi Jan,

Thanks for your time!

I figured out the mistake I was doing, I had a typo in my code in the org.eclipse.stardust.engine.core.spi.monitoring.IActivityInstanceMonitor file. I used the same method again and the code is working.

Regards,
kunal

Jan Hendrik Scheufen wrote on Fri, 18 October 2013 13:41
Hi Kunal,

did you use the same approach as with the other monitors by providing a services file at META-INF/services/org.eclipse.stardust.engine.core.spi.monitoring.IActivityInstanceMonitor with your implementation class in it?

Just checking before I try to reproduce it.

Thanks!

Jan

Re: BPMS SPI Monitoring - IActivityInstanceMonitor [message #1148227 is a reply to message #1148072] Mon, 21 October 2013 11:05 Go to previous messageGo to next message
Kunal Suri is currently offline Kunal SuriFriend
Messages: 82
Registered: April 2013
Location: Paris Saclay, France
Member

Hi,

We used the 'IActivityInstanceMonitor' instance and got some results. But we would like to ask for your help and guidance for clearing some of our doubts.

1. )

Is the method 'activityInstanceStateChanged' executing at the time of state change or after state change i.e the values that we get for various attributes as output are the vaules of the activity just before the change occurred OR are these values after the change has occurred ?


For e.g. We have a manual activity lets say 'InputClientDetails' and it goes through 4 state changes i.e Created-->Created , Created-->Suspended , Suspended-->Application, Application-->Completed.

And we can see that 'activityInstanceStateChanged' has also triggered 4 times displaying us the values of various attributes that we asked for in the code.
But in fact we feel its triggered before the activity change takes place and gives the Current state of activity, i.e. its current start time and other information.



Which means, we get 'Created' state 2 times, but Never get the 'Completed' state in the results!


2.) Continuation of 1.

How should we get all the attribute values for the 'Completed' activity (As we would like to find the total execution time of an Activity). We can see that the 'IProcessExecutionMonitor' can provide the 'LastModificationTime' of the activities in that process, once the process is completed.
But we would like to get the completion time of specific activities before the entire process gets completed?


We feel that the 'activityInstanceStateChanged' triggers only at a state change request and as 'Completed' is the Final state of any activity with no further change needed thus we do not get the details !

why is it important to us?
As in real world some processes may run for days, while some critical activities may run for a few minutes (using web servers).


Could you please help us by providing some insight on the above questions?

Thanks,
Kunal


[Updated on: Mon, 21 October 2013 12:42]

Report message to a moderator

Re: BPMS SPI Monitoring - IActivityInstanceMonitor [message #1151630 is a reply to message #1148227] Wed, 23 October 2013 13:37 Go to previous message
Kunal Suri is currently offline Kunal SuriFriend
Messages: 82
Registered: April 2013
Location: Paris Saclay, France
Member

Hello,

Could you please help and guide us with any pointers on how we could get the execution time for an Activity using IActivityInstanceMonitor ?

Thanks,
Kunal

Kunal Suri wrote on Mon, 21 October 2013 13:05
Hi,

We used the 'IActivityInstanceMonitor' instance and got some results. But we would like to ask for your help and guidance for clearing some of our doubts.

1. )

Is the method 'activityInstanceStateChanged' executing at the time of state change or after state change i.e the values that we get for various attributes as output are the vaules of the activity just before the change occurred OR are these values after the change has occurred ?


For e.g. We have a manual activity lets say 'InputClientDetails' and it goes through 4 state changes i.e Created-->Created , Created-->Suspended , Suspended-->Application, Application-->Completed.

And we can see that 'activityInstanceStateChanged' has also triggered 4 times displaying us the values of various attributes that we asked for in the code.
But in fact we feel its triggered before the activity change takes place and gives the Current state of activity, i.e. its current start time and other information.



Which means, we get 'Created' state 2 times, but Never get the 'Completed' state in the results!


2.) Continuation of 1.

How should we get all the attribute values for the 'Completed' activity (As we would like to find the total execution time of an Activity). We can see that the 'IProcessExecutionMonitor' can provide the 'LastModificationTime' of the activities in that process, once the process is completed.
But we would like to get the completion time of specific activities before the entire process gets completed?


We feel that the 'activityInstanceStateChanged' triggers only at a state change request and as 'Completed' is the Final state of any activity with no further change needed thus we do not get the details !

why is it important to us?
As in real world some processes may run for days, while some critical activities may run for a few minutes (using web servers).


Could you please help us by providing some insight on the above questions?

Thanks,
Kunal



Previous Topic:BPMS SPI Monitoring - IProcessExecutionMonitor
Next Topic:Stardust with JBoss deployment
Goto Forum:
  


Current Time: Mon May 13 01:16:58 GMT 2024

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

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

Back to the top