cancel
Showing results for 
Search instead for 
Did you mean: 

Execute a system command from a rule

ilias
Champ in-the-making
Champ in-the-making
Hello,

I'd like to know if it's possible to execute a script (bash, python, perl, ruby, no matter) when a rule is triggered.

In particular, when a zip file is droped in a space, it should be unzipped and have some some text files modified before being zipped again. I've written a simple bash script doing that, but I have no clue how to integrate that on Alfresco (Labs 3 stable).

I've seen a 'select a script' option when creating a rule, but every script there is a javascript one.

Is such operation possible? Any ideas or directions are welcomed.

Thanks,
Ilias.
2 REPLIES 2

phileas
Champ in-the-making
Champ in-the-making
Hi,

one way to do this could be to install the PHP-Integration AMP and upload a PHP script into "Company Home > Data Dictionary > Scripts". From this script you could call arbitrary commands (e.g. other scripts in the file system) via the PHP exec call.

Cheers,

p.

zaizi
Champ in-the-making
Champ in-the-making
You can define a custom transformation. Take a look at org.alfresco.repo.content.transform.RuntimeExecutableContentTransformer and how that has been configured.

More info on the wiki http://wiki.alfresco.com/wiki/Content_Transformations#RuntimeExecutableContentTransformer