cancel
Showing results for 
Search instead for 
Did you mean: 

companyhome is not defined!!

pde74
Champ in-the-making
Champ in-the-making
Hi,
I have this error when in my script i try to execute this code:

16:13:14,735 ERROR [graph.def.GraphElement] action threw exception: Failed to execute supplied script: ReferenceError: "companyhome" is not defined. (AlfrescoScript#1)
org.alfresco.service.cmr.repository.ScriptException: Failed to execute supplied script: ReferenceError: "companyhome" is not defined. (AlfrescoScript#1)


var nodoPartenza = companyhome.childByNamePath("test");

It seems that this variable is not defined in Alfresco?

The same for search variable….


Can you help me please?
4 REPLIES 4

davidc
Star Contributor
Star Contributor
You will find these variables available the following versions of Alfresco:
- SVN HEAD
- 1.4.0 Enterprise

The 1.4.0 Community did not receive these fixes.

pde74
Champ in-the-making
Champ in-the-making
You will find these variables available the following versions of Alfresco:
- SVN HEAD
- 1.4.0 Enterprise

The 1.4.0 Community did not receive these fixes.

Thank you for yuor reply,
but i've read on Alfresco Wiki, http://wiki.alfresco.com/wiki/WorkflowAdministration, that the following "root" objects are available:
-search
-actions
-logger
-session
-classification
-utils

On this base i've created a workflow with some of this :

var fromNode = companyhome.childByNamePath(bpm_context.name);

var toNode = companyhome.childByNamePath(destination);

for (var i = 0; i < bpm_package.children.length; i++)
   {
     if (fromNode.children.isDocument)        
         {
           nodoPartenza.children.copy(nodoDestinazione);
     }
   }



Now, how can i accomplish the same result on an Community release?
There is some workaround?

ps I've tried to use the search API but of course the search root object is not defined….


Thanks

red15
Champ in-the-making
Champ in-the-making
FYI: I have been able to use companyhome in a script (not inside a jBPM but a regular script) in a 1.4.0 Community version

(Community Network): Current version 1.4.0 (build-105) schema 21

davidc
Star Contributor
Star Contributor
Scripts within process definitions did not have all the documented root objects - that was fixed after 1.4 community released.

The fixes are in HEAD, or 1.4 Enterprise.