Please point me a way to handle and save data in step ServiceTask bpmn.

190 views
Skip to first unread message

TryToUseCamunda

unread,
Oct 10, 2014, 2:45:03 PM10/10/14
to camunda-...@googlegroups.com
Hi,

I want to save my data in delegate class which is poited from ServiceTask bpmn.
I use DAO class to save data which has marked @EJB in delegate class but the value of DAO class alway null.
It also this DAO which has marked @EJB in a class which is handle for submitting of form of UserTask then This value work well.
I tried with a both @EJB, @inject but it's not successful yet.
EX:
@named
@service
Class ProcessRequestDelegate implements serialize,JavaDelegate {

@EJB
private EmployeeDAO empDAO;//i have debug and this value alway null.

public void execute(DelegateExecution execution) throws Exception {
System.out.println("Value: " + empDAO); //it's null
}
}

Can you please explain this issue and poit me a way to save data in this case?

Thanks,

Christian Lipphardt

unread,
Oct 10, 2014, 2:47:48 PM10/10/14
to camunda-...@googlegroups.com
Hi,

Do you correctly reference the ProcessRequestDelegate as an DelegateExpression?
Is the process application an EJB or Servlet PA?

Cheers,
Christian


--
You received this message because you are subscribed to the Google Groups "camunda BPM users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to camunda-bpm-us...@googlegroups.com.
To post to this group, send email to camunda-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/camunda-bpm-users/ff67f8f0-5bd8-4a7b-baae-02eec17b20f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

Camunda user

unread,
Oct 11, 2014, 3:30:53 AM10/11/14
to camunda-...@googlegroups.com
Hi,
I reference delegate class in the class property field of servicetask.
The process application extends ServletProcessApplication.
I config process application follow this guides:
http://docs.camunda.org/latest/guides/getting-started-guides/developing-process-applications/

Christian Lipphardt

unread,
Oct 13, 2014, 5:45:31 AM10/13/14
to camunda-...@googlegroups.com, nktr...@gmail.com
Hi,

Make sure you use following way to configure your delegate inside your bpmn.xml:

<serviceTask id="beanService"
             
name="My Bean Service Task"
             
camunda:delegateExpression="${processRequestDelegate}" />

Do you use JBoss or Glassfish as ApplicationServer? EJB etc wont work on Tomcat.
Make sure you include the camunda CDI dependency in your Process Application.

See the Java EE getting started guide [1]. It explains how to do everything you mentioned.


Cheers,
Christian

Camunda user

unread,
Oct 13, 2014, 11:54:24 AM10/13/14
to camunda-...@googlegroups.com
Hi,

i like your answers. I'll try it.

Thanks,

Camunda user

unread,
Oct 14, 2014, 8:00:31 AM10/14/14
to camunda-...@googlegroups.com
Hi,

I'm getting exception:
JBWEB000065: HTTP Status 500 - org.camunda.bpm.engine.ProcessEngineException: Error while evaluating expression: ${processRequestDelegate}. Cause: resolver must not be null

What should i do to fix it?

Christian Lipphardt

unread,
Oct 14, 2014, 9:19:49 AM10/14/14
to camunda-...@googlegroups.com, nktr...@gmail.com
Hi,

What camunda bpm distribution do you use? JBoss/Wildfly/Glassfish or Tomcat?

Do you have included the camunda-engine-cdi jar as compile time dependency in your maven pom so it is put into your WAR? Otherwise the engine is unable to lookup the named beans specified by the expressions.

Maybe you could share your source code (pom.xml, processes.xml, kind of process application (embedded, servlet, ejb or spring), so I can have a look at it.

Cheers,
Christian

Camunda user

unread,
Oct 15, 2014, 5:29:45 AM10/15/14
to camunda-...@googlegroups.com
Hi,

I using JBoss, i have checked maven dependency and camunda-engine-cdi already exits.
PA extends SevletProcessApplication.
This is the process.xml:

<?xml version="1.0" encoding="UTF-8"?>
<process-application
xmlns="http://www.camunda.org/schema/1.0/ProcessApplication"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<process-archive>
<process-engine>default</process-engine>
<properties>
<property name="isDeleteUponUndeploy">false</property>
<property name="isScanForProcessDefinitions">true</property>
</properties>
</process-archive>

</process-application>

thorben....@camunda.com

unread,
Oct 15, 2014, 8:22:06 AM10/15/14
to camunda-...@googlegroups.com, trung....@vn.devinition.com
Hi,

It could be you are seeing the bug in link [1].
If this is the case, you have the camunda-spring module on your process application's classpath, however, your process application is no SpringProcessApplication (or a subclass thereof). To work around this bug, you should remove the camunda-spring module from your process application's classpath.

Cheers,
Thorben

[1] https://app.camunda.com/jira/browse/CAM-2644

nktr...@gmail.com

unread,
Oct 16, 2014, 10:36:26 AM10/16/14
to camunda-...@googlegroups.com
Hi,

Thanks for help me to find root cause of issue.
After i remove camunda-spring then i can work in service task well.

nktr...@gmail.com

unread,
Oct 16, 2014, 10:36:39 AM10/16/14
to camunda-...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages