06-05-2013 12:10 AM
var pdfFile = bpm_package.children[0];
logger.log("pdfFile:" + pdfFile.name);
execution.setVariable("pdfFile", pdfFile);
SEVERE: Error while closing command context
org.alfresco.scripts.ScriptException: 05050229 Failed to execute supplied script: Passed value is not an instance of ActivitiScriptNode, cannot set variable value.
at org.alfresco.repo.jscript.RhinoScriptProcessor.executeString(RhinoScriptProcessor.java:278)
at org.alfresco.repo.processor.ScriptServiceImpl.executeString(ScriptServiceImpl.java:286)
at org.alfresco.repo.processor.ScriptServiceImpl.executeScriptString(ScriptServiceImpl.java:193)
at org.alfresco.repo.processor.ScriptServiceImpl.executeScriptString(ScriptServiceImpl.java:183)
at sun.reflect.GeneratedMethodAccessor584.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
<more left out> ….
Caused by: org.activiti.engine.ActivitiException: Passed value is not an instance of ActivitiScriptNode, cannot set variable value.
at org.alfresco.repo.workflow.activiti.variable.ScriptNodeVariableType.setValue(ScriptNodeVariableType.java:76)
at org.activiti.engine.impl.persistence.entity.VariableInstanceEntity.setValue(VariableInstanceEntity.java:164)
at org.activiti.engine.impl.persistence.entity.VariableInstanceEntity.create(VariableInstanceEntity.java:72)
at org.activiti.engine.impl.persistence.entity.VariableInstanceEntity.createAndInsert(VariableInstanceEntity.java:58)
at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.createVariableLocal(VariableScopeImpl.java:225)
at org.activiti.engine.impl.persistence.entity.VariableScopeImpl.setVariable(VariableScopeImpl.java:175)
<userTask id="task1" name="Log workflow variables and properties">
<extensionElements>
<activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
<activiti:field name="script">
<activiti:string>
var pdfFile = bpm_package.children[0];
logger.log("pdfFile:" + pdfFile.name);
// This causes the exception (shown above) so is comment out for the moment.
// execution.setVariable("pdfFile", pdfFile);
var reportCode = pdfFile.properties["cps:reportCode"];
logger.log("reportCode:" + reportCode);
var businessDate = pdfFile.properties["cps:businessDate"];
logger.log("businessDate:" + businessDate);
var productionDate = pdfFile.properties["cps:productionDate"];
logger.log("productionDate:" + productionDate);
var expiryDate = pdfFile.properties["cps:expiryDate"];
logger.log("expiryDate:" + expiryDate);
var generatedDateTime = pdfFile.properties["cps:generatedDateTime"];
logger.log("generatedDateTime:" + generatedDateTime);
var props = pdfFile.properties["cps:props"];
logger.log("props:" + props);
logger.log("bpm_workflowDescription:" + bpm_workflowDescription);
logger.log("bpm_workflowDueDate:" +bpm_workflowDueDate);
logger.log("bpm_workflowPriority:" +bpm_workflowPriority);
logger.log("bpm_package:" + bpm_package);
logger.log("bpm_package.children[0]:" + bpm_package.children[0]);
logger.log("bpm_context:" + bpm_context);
logger.log("initiator:" + initiator);
logger.log("initiatorhome:" + initiatorhome);
logger.log("companyhome:" + companyhome);</activiti:string>
</activiti:field>
</activiti:executionListener>
</extensionElements>
</userTask>
<scriptTask id="scripttask1" name="Get rules for reportCode" scriptFormat="javascript" activiti:autoStoreVariables="false">
<script>
var pdfFile = execution.getVariable("pdfFile");
System.out.println("can I get the pdfFile variable? = " + pdfFile);
</script>
</scriptTask>
06-24-2013 08:51 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.