03-19-2012 03:16 AM
<!– Send email Task starts –>
<serviceTask id="sendMail" activiti:type="mail">
<extensionElements>
<activiti:field name="from" stringValue="order-shipping@thecompany.com" />
<activiti:field name="to" expression="mcasanket70@gmail.com" />
<activiti:field name="subject" expression="Your order has been shipped" />
<activiti:field name="html">
<activiti:expression>
<![CDATA[
<html><body> This is an auto generated email. </body></html>
]]>
</activiti:expression>
</activiti:field>
</extensionElements>
</serviceTask>
<!– Send email Task ends –>
04-09-2012 12:06 PM
06-08-2012 02:13 PM
<!– Using a Script task –>
<scriptTask id="scripttask1" name="Send Email" scriptFormat="javascript">
<extensionElements>
<activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener">
<activiti:field name="script">
<activiti:string>
var mail = actions.create("mail");
mail.parameters.to = "a@gmail.com";
mail.parameters.subject = "send a workflow's email. second test! " + bpm_workflowDescription;
mail.parameters.from = "b@gmail.com";
mail.parameters.text = "2nd Test message! ";
mail.execute(bpm_package);
</activiti:string>
</activiti:field>
</activiti:executionListener>
</extensionElements>
<script><![CDATA[]]></script>
</scriptTask>
When the boundary timer runs, I got an exception:Exception in thread "pool-1-thread-4" org.activiti.engine.ActivitiException: org.alfresco.repo.workflow.activiti.tasklistener.ScriptTaskListener doesn't implement interface org.activiti.engine.delegate.ExecutionListener nor interface org.activiti.engine.delegate.JavaDelegate
at org.activiti.engine.impl.bpmn.helper.ClassDelegate.getExecutionListenerInstance(ClassDelegate.java:80)
at org.activiti.engine.impl.bpmn.helper.ClassDelegate.notify(ClassDelegate.java:66)
at org.activiti.engine.impl.pvm.runtime.AbstractEventAtomicOperation.execute(AbstractEventAtomicOperation.java:38)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76)
at org.activiti.engine.impl.persistence.entity.ExecutionEntity.performOperation(ExecutionEntity.java:481)
I did a second try using this: Exception in thread "pool-1-thread-1" java.lang.NullPointerException
at javax.script.ScriptEngineManager.getEngineByName(ScriptEngineManager.java:199)
at org.activiti.engine.impl.scripting.ScriptingEngines.evaluate(ScriptingEngines.java:63)
at org.activiti.engine.impl.bpmn.behavior.ScriptTaskActivityBehavior.execute(ScriptTaskActivityBehavior.java:43)
at org.activiti.engine.impl.pvm.runtime.AtomicOperationActivityExecute.execute(AtomicOperationActivityExecute.java:40)
at org.activiti.engine.impl.interceptor.CommandContext.performOperation(CommandContext.java:76)
Does anybody could help me with a "tip" or a way to solve this ?06-08-2012 02:34 PM
06-08-2012 03:37 PM
<scriptTask id="scripttask1" name="Send Email" scriptFormat="javascript">
<extensionElements>
<activiti:executionListener event="start" class="org.alfresco.repo.workflow.activiti.listener.ScriptExecutionListener">
<activiti:field name="script">
<activiti:string>
var mail = actions.create("mail");
mail.parameters.to = "a@gmail.com";
mail.parameters.subject = "send a workflow's email. second test! " + bpm_workflowDescription;
mail.parameters.from = "b@gmail.com";
mail.parameters.text = "2nd Test message! ";
mail.execute(bpm_package);
</activiti:string>
</activiti:field>
</activiti:executionListener>
</extensionElements>
<script><![CDATA[]]></script>
</scriptTask>
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.