cancel
Showing results for 
Search instead for 
Did you mean: 

Access to file properties jbpm

rafael
Champ in-the-making
Champ in-the-making
Need to know how to access a file properties from a processdefinition.xml properties, which form part of the definition of a workflow.

thanks for your help
3 REPLIES 3

mrogers
Star Contributor
Star Contributor
Could you clarify what you mean by "file properties"?   

If you are trying to find the filename of the processdefinition for a workflow then I'm afraid you may be out of luck since the physical filename is fairly irrelevant to a workflow, what is important are the contents of the file.    As a workaround you could put in a property containing a filename into the processdefinition.

rafael
Champ in-the-making
Champ in-the-making
Thanks for your reply.
What I want is access from a workflow defined in processdefinition.xml to a file.properties where I can set the name of the espace where I want to move a document.

ej: my code is

<transition name="Definitivo" to="Fin">
         <script>
            var dest = companyhome.childByNamePath("XXX/Definitivo");

            for (var i = 0; i  &lt; bpm_package.children.length; i++)
            {
               bpm_package.children.move(dest);
            }


         </script>
</transition>


I would like make configurable text:"XXX/Definitivo"

mrogers
Star Contributor
Star Contributor
You are using the plain <script> tag which means that you are running "bean shell" script.

bean shell has a "load" method that may do what you want.
http://www.beanshell.org/manual/bshmanual.pdf

Heare are  some alternative approaches.
You could read your properties file using java and put the value into the process variables which can then be used by your script.  
Or you use Alfresco script and add a "root scoped script bean" to provide access to the contents of a properties file.