cancel
Showing results for 
Search instead for 
Did you mean: 

Import external script file from repository [SOLVED]

ericnk
Champ on-the-rise
Champ on-the-rise
Hi,

How do I dynamically import a javascript file from the repository into an activiti script task?  Using JBPM I would accomplish this as follows….


<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
   <runas>admin</runas>
   <script>
      <expression>
         <![CDATA[
            <import resource="/Company Home/Data Dictionary/Scripts/powf-phase-one-task.js">
         ]]>
      </expression>
   </script>
</action>

… But, I am unable to find a similar approach using activiti (BPMN 2.0).  I have read through Jeff Potts Advanced Workflow Tutorial 2nd edition on activiti workflows and haven't found any examples of this.  I haven't come up with any results searching through the workflow forum either.  Does anyone have any ideas as to how this would be accomplished in activiti?  I would welcome any suggestions or comments.  Thank you.

Regards,

Eric
2 REPLIES 2

afaust
Legendary Innovator
Legendary Innovator
Hello,

I haven't tried that one yet, but I would think that using the ScriptTaskListener / ScriptExecutionListener in Activiti with the same approach should work just as fine.
As a side-note, I really dislike the current way of import handling using non-standard tags inside of JavaScript source - I am currently preparing a contribution to enable a cleaner import mechanism.

Regards
Axel

ericnk
Champ on-the-rise
Champ on-the-rise
Axel,

Thank you for your reply.  You're right.  It does work.  It was the Eclipse Activiti design tool that was translating my import statement incorrectly into the process xml file.  After modifying the xml file manually so that the import statement appeared exactly as in the JBPM process, it worked as expected.  I wish you luck in your efforts for the URL import tag.  I agree that the current method of importing an external resource is somewhat inelegant.

Thanks again for your comments. 

Regards,

Eric