cancel
Showing results for 
Search instead for 
Did you mean: 

Listener implementation ScriptExecutionListener

patrickvanhoof
Confirmed Champ
Confirmed Champ
Hi,

I am creating a simple workflow as a test, based on an article by Jeff Potts. I need to define an execution listener on a flow, so I select the Listeners tab, select New, and enter following info:
Event = start
Type = Java class
Fields
   Field name = script
String value / Expression = logger.log("Hello, World!");

Then I click on 'Select class' to get the ScriptExecutionListener class, but I can not find it.

Do I need to import something in my Eclipse first?

Thanks,
Patrick
6 REPLIES 6

ronald_van_kuij
Champ on-the-rise
Champ on-the-rise
Did you implement the ScriptExecutionListener yourself? Does it implement the correct interface? Is it on the classpath? Please answer those basic questions first.

frederikherema1
Star Contributor
Star Contributor
If you're using the Alfresco-tasks, the ScriptExecutionListener can be used INSIDE an alfresco-context. This listener runs Alfresco-javascript and is cannot be used using activiti standalone…

patrickvanhoof
Confirmed Champ
Confirmed Champ
I did not implement the listener myself.
I am using the Alfresco user task, but not sure with what you mean by 'inside an alfresco-context".
I was thinking that I maybe needed to declare a dependency in the pom.xml like
<dependency>
  <groupId>org.alfresco.enterprise</groupId>
  <artifactId>alfresco-core</artifactId>
  <version>${alfresco.version}</version>
</dependency>
but that gives me errors on the pom.xml.

frederikherema1
Star Contributor
Star Contributor
It will only work if you're deploying the process into an Alfresco, NOT when using activiti standalone.

If you're interested how the class looks, you can look into the Alfresco codebase:

http://dev.alfresco.com/resource/docs/java/repository/org/alfresco/repo/workflow/activiti/listener/S...
http://svn.alfresco.com/repos/alfresco-open-mirror/alfresco/HEAD/root/projects/repository/source/jav...

patrickvanhoof
Confirmed Champ
Confirmed Champ
Hi Frederik,

Still not sure what you mean with "the ScriptExecutionListener can be used INSIDE an alfresco-context". What is the Alfresco-context?
Do I have to manually add the listener in the generated xml and then deploy it to Alfresco?

Thanks,
Patrick

frederikherema1
Star Contributor
Star Contributor
As I sais, "inside alfresco context" is when you're deploying the process to Alfresco… Activiti is used most of the time as a standalone-library. If you're using the ScriptExecutionListener in a process deployed to alfresco, you DON'T need to add anything special. The class is present in alfresco by default.

So there is no need to "browse for the class" in the eclipse designer… If you want the sources, I gave you the pouter to the SVN.
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.