cancel
Showing results for 
Search instead for 
Did you mean: 

Code reuse in jBPM action scripts

bedag-moo
Champ in-the-making
Champ in-the-making
Aside from using action references, there appears to be no way to reuse code in action scripts? In particular, I can not call a JavaScript function because there is no place I can put the function definition that would be visible to all action scripts? (importing the definition from a file in the classpath does not work, as the xml-like nature of Alfresco's JavaScript import disturbs xml-parsing the processdefinition.)

I ask because I am tasked with informing a workflow's initiator about every step of the workflow by e-mail. There are 5 such steps, and the e-mails differ only in subject and text.
2 REPLIES 2

tbillard
Champ in-the-making
Champ in-the-making
Hi,

You may able to do what you want by the use of the import way.
I think you can import resources in JBPM.
With that you'll be able to use a function with the args you want.

Another way is to use the processTemplate within the text of the e-mail action. In this case you'll be able to pass params.

Hope it will help you,

Regards,
Thomas Billard
KNOWINGS company

bedag-moo
Champ in-the-making
Champ in-the-making
Hm, I did not find any mention of an import capability in the jBPM 3.2 reference documentation: the table of contents doesn't contain the word "import", nor do the chapters dealing with scripting or jPDL syntax. Have I been looking in the wrong place?

There is little redundancy in the text of the email, so the processTemplate doesn't help much.