Hello Adei,
thank you very much again for your answer.
Actually I resolve half of this problem, with this….
var revisionSite = siteService.getSite("revision");
var publieesSite = siteService.getSite("publiees");
var documentLibraryRevision = revisionSite.getContainer("documentLibrary");
var documentLibraryPubliees = publieesSite.getContainer("documentLibrary");
var myDocument = documentLibraryRevision.childByNamePath("test.doc");
var trans = myDocument.transformDocument("application/pdf");
I just replaced the "path/to/my/document.doc" for "test.doc", and it works now. But, unfortunatelly, It brought me to another problem, I wrote test.doc because I know the .doc I am using to do my test, but in a real situation I would not know the name of the file. Is there anyway to this in a generic way?!!
As you requested, here is my workflow definition process:
<?xml version="1.0" encoding="UTF-8"?>
<process-definition xmlns="urn:jbpm.org:jpdl-3.3"
name="capvpwf:validation_procedure">
<swimlane name="initiator" />
<swimlane name="reviewer">
<assignment class="org.alfresco.repo.workflow.jbpm.AlfrescoAssignment">
<actor>#{bpm_assignee}</actor>
</assignment>
</swimlane>
<start-state name="start-state">
<task name="capvpwf:validProcedureStartTask" swimlane="initiator" />
<transition to="validation_procedure"></transition>
</start-state>
<task-node name="validation_procedure">
<task name="capvpwf:validProcedureTask" swimlane="reviewer">
<event type="task-create">
<action class="com.lacapitale.workflow.action.LacapitaleTaskStart" />
</event>
<event type="task-end">
<action class="com.lacapitale.workflow.action.LacapitaleTaskEnd" />
</event>
</task>
<event type="node-enter">
<action class="com.lacapitale.workflow.action.DeplaceProcedureAction"
config-type="bean">
<site>revision</site>
</action>
</event>
<transition to="end-state" name="approuver">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
var revisionSite = siteService.getSite("revision");
var publieesSite = siteService.getSite("publiees");
var documentLibraryRevision = revisionSite.getContainer("documentLibrary");
var documentLibraryPubliees = publieesSite.getContainer("documentLibrary");
var myDocument = documentLibraryRevision.childByNamePath("test.doc");
var trans = myDocument.transformDocument("application/pdf");
</script>
</action>
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
logger.log("*** approuver ***");
var group = people.getGroup('GROUP_NOTIFICATION_PROCEDURES');
if (group != null){
for each(user in people.getMembers(group)){
logger.log("*** User name: " + user.properties.firstName);
logger.log("*** User mail: " + user.properties.email);
var mail = actions.create("mail");
mail.parameters.to = user.properties.email;
mail.parameters.subject = "" + bpm_workflowDescription;
mail.parameters.from = bpm_assignee.properties.email;
mail.parameters.text = "Procédure a été APPROUVÉE";
mail.execute(bpm_package);
}
}
</script>
</action>
<action class="com.lacapitale.workflow.action.DeplaceProcedureAction"
config-type="bean">
<site>publiees</site>
</action>
<!– <action class="com.lacapitale.workflow.action.Test"></action> –>
</transition>
<transition to="end-state" name="rejeter">
<action class="org.alfresco.repo.workflow.jbpm.AlfrescoJavaScript">
<script>
logger.log("*** rejeter ***");
var mail = actions.create("mail");
mail.parameters.to = initiator.properties.email;
mail.parameters.subject = "" + bpm_workflowDescription;
mail.parameters.from = bpm_assignee.properties.email;
mail.parameters.text = "Procédure a été REJETÉE";
mail.execute(bpm_package);
</script>
</action>
<action class="com.lacapitale.workflow.action.ReplaceProcedureAction">
</action>
</transition>
</task-node>
<end-state name="end-state"></end-state>
</process-definition>
Thanks very much,
Best Regards,
Rodrigo Araujo