cancel
Showing results for 
Search instead for 
Did you mean: 

Workflow calling external program

christianix
Champ in-the-making
Champ in-the-making
Hi,

I'm new to Alfresco, so excuse my unsophisticated question:

I'd like to set up an Workflow in Alfresco which does the following:
  1. Start: A certain (CSV) files F get updated in a workspace

  2. The statistic program R is called with a fixed script operating on F

  3. The result is written back to an Alfresco workspace
Could this be achieved by simple workflow or do I need to implement an advanced workflow? What steps do I need to take? Could you please give me a rough idea on what needs to be done? And maybe some pointers to further reading?

Thanks,

Martin.

PS: And why is the BBCode not working even it says it's switched on?!
4 REPLIES 4

invictus9
Champ in-the-making
Champ in-the-making
You would need to create an advanced work flow. It doesn't need to be too "advanced".

Your program R needs to be invoked by a chunk of Java code. The Java code needs to transport F to the normal file space of the server, invoke R on the transported copy of F with the appropriate parameters, and then load the resulting file, S, back into Alfresco.

I realize that this is lacking in details. I still need to experiment with this myself. However, you might look into the implementations of data transformers supplied with Alfresco to convert, for instance, Word documents into PDF documents. Alfresco uses Open Office services to do the transformation, but I'm sure there is good educational material there.

(Fellow student.)

christianix
Champ in-the-making
Champ in-the-making
Thanks invictus9 for the hint with the transformers. It seems to be the right track. However, I've been searching the Alfresco source code but couldn't locate where the OpenOffice transform service is connected to Alfresco. Could you - or anybody else - give me a hint, please? Is there some document explaining the source tree layout?

Regards, Martin.

invictus9
Champ in-the-making
Champ in-the-making
I don't know that you need to mine the source for information. Start with http://wiki.alfresco.com/wiki/Content_Transformations – they show a fairly example or two of transforming a file from one form into another, with parameters. I think your original problem can be restated as a transformation. You won't have to write any Java code; just the -context.xml for your particular transformation.

christianix
Champ in-the-making
Champ in-the-making
Hi invictus9,

it turned out that a CustomAction suits best the requirements (the changed a little from the initial ones). I got already quite far with the SDK, having an action which calls an external app (R). However, the documentation is quite a mess and learning curve is quite stiff.

Thanks for your initial help! CU around, Martin.