AnsweredAssumed Answered

Regression in Javascript Workflow related APIs ?

Question asked by iblanco on Oct 15, 2009
Latest reply on Oct 19, 2009 by iblanco
I have an advanced workflow with some custom properties and a script that launches the workflow after setting the properties (in order to use it from a rule). I have also developed the required JSPs and the configuration in order to be able to launch the same workflow from the Advanced Workflow Wizard.

When I set and launch the properties using the Advanced Workflow Wizard it works well in both versions, Labs/Comunnity  3 Final and the actual Community 3.2 .

But when I try to launch it using the script it works like a charm in version 3 Final but fails in Community 3.2. This is the script I'm using in both versions to launch the workflow:


var propiedades = new Object();
propiedades["bpm:workflowDescription"] = "Solicitud de pago de factura " + document.name;
propiedades["bpm:assignee"] = person;
propiedades["bnvwf:departmentChief"] = people.getPerson('usuario1');
propiedades["bnvwf:mainChief"] = people.getPerson('usuario2');
propiedades["bnvwf:archiveFolder"] = companyhome.childByNamePath("Facturacion/Pendientes Pago");
propiedades["bnvwf:removeFolder"] = companyhome.childByNamePath("Facturacion/No aceptadas");
var workflowFactura = workflow.getDefinitionByName('jbpm$bnvwf:departamentalInvoicePayment');
var paquete = workflow.createPackage();
paquete.addNode(document);
var workflowNodoInicial = workflowFactura.startWorkflow(paquete, propiedades);
/**
* Auto finalizar las tareas de inicio del workflow.
**/
var tareas = workflowNodoInicial.getTasks();
for (tarea in tareas) {
   tareas[tarea].endTask(null);
}

The error seems related to the transition signaling mechanism, for two reasons, one is that the log says that it can't signal transition 'null' and the other is that if I delete the last 'for' the workflow is "created", but it is stopped in the start node until the user presses the corresponding button to actually exec the initial transition.

Do you think this is a regression I should report ?

Outcomes