cancel
Showing results for 
Search instead for 
Did you mean: 

How to access space selector in advanced workflow

wernerk
Champ in-the-making
Champ in-the-making
Good day

I need to create a workflow in which certain users are allowed to move documents from one space to another. Now i've got the workflow working and i'm doing the move with javascript, but the destination is hard coded at this stage. My Question is thus how to call the space selector dialog from inside a task in the workflow and access the result it returns?
2 REPLIES 2

aleo
Champ in-the-making
Champ in-the-making
Hi Wernerk,

I am trying to do the same with the Advanced WF. Could you help me on how you could do it with the javascript?
Thanks.

- aleo

wernerk
Champ in-the-making
Champ in-the-making
Hi Aleo

So far I've not been able to access the space selector, but i can help with javascript that the actual does the move.

Below is the code I'm using:
         

                         <event type="task-end">
            <action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
               <script>   
                    <![CDATA[
                                                /* loop through the bpm_package for this workflow */
                  for (var i = 0; i < bpm_package.children.length; i++)
                     {
                     bpm_package.children[i].addAspect("cm:versionable"); /* add versionable aspect to document */
                     bpm_package.children[i].move(companyhome); /* move document to new location, still need to replace companyhome with variable that contains selected space  */
                     }       
                  ]]>
               </script>
            </action>
         </event>
         

If you have a look at the following post, they describe an alternative to using the space selector http://forums.alfresco.com/viewtopic.php?f=34&t=12484
Hope this helps, if have more questions feel free to ask if I cant answer them I'm sure some one else can.