[jBPM] - Notify on completion of Escalation
by Franklin Antony
Franklin Antony [http://community.jboss.org/people/frankee787] created the discussion
"Notify on completion of Escalation"
To view the discussion, visit: http://community.jboss.org/message/610119#610119
--------------------------------------------------------------
I have a task which has a deadline defined as follows. The escalation and notification works fine as expected
log.info("ADDING ESCALTIONS for total of : "+domainTask.getEscalations().size());
List<Escalation> escalations = new ArrayList<Escalation>();
//Deadline
Deadline endDeadline = new Deadline();
endDeadline.setDate(domainTask.getDueDate());
endDeadline.setEscalated(false);
Escalation escalation = new Escalation();
escalation.setName("escalatedtask");
//Reassignments
List<Reassignment> reassignments = new ArrayList<Reassignment>();
List<OrganizationalEntity> reassignmentPotentialOwners = new ArrayList<OrganizationalEntity>();
//Notifications
List<Notification> notifications = new ArrayList<Notification>();
List<OrganizationalEntity> recipients = new ArrayList<OrganizationalEntity>();
com.my.User domainUser = (com.my.User) (taskAssignment.getAssigned());
reassignmentPotentialOwners.add(new User(Constants.jBPM_USER_ID_PREFIX+domainUser.getId().toString()));
recipients.add(new User(Constants.jBPM_USER_ID_PREFIX+domainUser.getId().toString()));
log.debug("Task is being RE-ASSIGNED to a USER with ID : "+Constants.jBPM_USER_ID_PREFIX+domainUser.getId().toString() +" and name: "+domainUser.getNameEn());
Reassignment reassignment = new Reassignment();
reassignment.setPotentialOwners(reassignmentPotentialOwners );
reassignments.add(reassignment);
escalation.setReassignments(reassignments);
EmailNotification emailNotification = new EmailNotification();
emailNotification.setRecipients(recipients);
//Email Header
Map<String,EmailNotificationHeader> emailHeaders = new HashMap<String, EmailNotificationHeader>();
EmailNotificationHeader emailHeader = new EmailNotificationHeader();
emailHeader.setLanguage("en-UK");
emailHeader.setFrom(" mailto:my@mydomain.com my(a)mydomain.com");
emailHeader.setSubject("TASK ID : "+domainTask.getId()+" : "+domainTask.getTitle());
emailHeader.setBody(domainTask.getDescription()+" \n reaches its deadline. \n Now it is your responsability!");
emailHeaders.put("en-UK", emailHeader);
emailNotification.setEmailHeaders(emailHeaders);
notifications.add(emailNotification );
escalation.setNotifications(notifications);
escalations.add(escalation);
endDeadline.setEscalations(escalations );
Deadlines deadlines= new Deadlines();
List<Deadline> endDeadlines = new ArrayList<Deadline>();
endDeadlines.add(endDeadline);
deadlines.setEndDeadlines(endDeadlines);
task.setDeadlines(deadlines);
This works fine as expected and that is good. PHEW!!
Now, I would like to update in my database when this escalation is fired. Rather , I would like to be notified when such an escalation event is fired.
Is there anyway to achieve this ?
Regards,
Franklin
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/610119#610119]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 5 months
[jBPM] - Re: Generate reports problem with jbpm-console
by Valery Maslau
Valery Maslau [http://community.jboss.org/people/mvnval] created the discussion
"Re: Generate reports problem with jbpm-console"
To view the discussion, visit: http://community.jboss.org/message/610105#610105
--------------------------------------------------------------
Hello,
I've met the same issue getting try http://localhost:8080/jbpm-console/ http://localhost:8080/jbpm-console/, below is the output of the error. I did all recomendations mentioned above, I mean manually download birt-runtime-2_3_2_2.zip, change build property accordingly and run "ant install.reporting.into.jboss". The result is negative. What else can be done for making JBoss working properly?
* URL: ' http://localhost:8080/gwt-console-server/rs/report/config http://localhost:8080/gwt-console-server/rs/report/config'
* Action: 'org.jboss.bpm.console.client.report.UpdateReportConfigAction'
* Exception: 'class com.google.gwt.http.client.RequestException'
HTTP 500:
h1. HTTP Status 500 -
----
*type* Exception report
*message*
*description* The server encountered an internal error () that prevented it from fulfilling this request.
*exception*
org.jboss.resteasy.spi.UnhandledException: java.lang.IllegalStateException: Report server not initialized. Please check the server logs for further details. org.jboss.resteasy.core.SynchronousDispatcher.handleApplicationException(SynchronousDispatcher.java:319) org.jboss.resteasy.core.SynchronousDispatcher.handleException(SynchronousDispatcher.java:230) org.jboss.resteasy.core.SynchronousDispatcher.handleInvokerException(SynchronousDispatcher.java:206) org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:360) org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173) org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93) org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
*root cause*
java.lang.IllegalStateException: Report server not initialized. Please check the server logs for further details. org.jboss.bpm.report.ReportFacade.assertBirtAvailability(ReportFacade.java:195) org.jboss.bpm.report.ReportFacade.getReportConfig(ReportFacade.java:328) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:117) org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:260) org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:232) org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:166) org.jboss.resteasy.core.DispatcherUtilities.getJaxrsResponse(DispatcherUtilities.java:142) org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:356) org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:173) org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:93) org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:68) javax.servlet.http.HttpServlet.service(HttpServlet.java:717) org.jboss.bpm.console.server.util.GWTJsonFilter.doFilter(GWTJsonFilter.java:59) org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/610105#610105]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 5 months
[EJB3] - EntityManager is null, i can´t injected
by esgoru
esgoru [http://community.jboss.org/people/esgoru] created the discussion
"EntityManager is null, i can´t injected"
To view the discussion, visit: http://community.jboss.org/message/610052#610052
--------------------------------------------------------------
i try using EntityManager, but i can´t instanced, i use tomcat v6.0 and mysql 4.1, i use hibernate and spring. my config archives is:
jeveris-light-persistence.xml in web/scr/main/resources
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="test" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jar-file>j-everis-ejb.jar</jar-file>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" />
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.connection.username" value="root"/>
<property name="hibernate.connection.password" value="jeveris"/>
<property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/bankeveris"/>
</properties>
</persistence-unit>
</persistence>
jeveris-ligth-persistence.xml in ejb/scr/main/resource/meta-inf
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"
version="1.0">
<persistence-unit name="test" transaction-type="RESOURCE_LOCAL">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" />
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.connection.username" value="root"/>
<property name="hibernate.connection.password" value="jeveris"/>
<property name="hibernate.connection.url" value="jdbc:mysql://localhost:3306/bankeveris"/>
</properties>
</persistence-unit>
</persistence>
persistence.xml in ejb/scr/main/resource/meta-inf
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd" version="1.0">
<persistence-unit name ="j-everis-2.0">
<!-- jboss' default data source -->
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<jta-data-source>java:/jdbc/jeveris</jta-data-source>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect" />
<property name="hibernate.connection.driver_class" value="com.mysql.jdbc.Driver" />
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="hibernate.show_sql" value="true"/>
<!-- Para evitar problemas con JBOSS -->
<property name="hibernate.query.factory_class" value="org.hibernate.hql.classic.ClassicQueryTranslatorFactory"/>
</properties>
</persistence-unit>
</persistence>
clienteDaoImpl.java
package com.bankeveris.dao;
import java.util.List;
import javax.ejb.Local;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.Persistence;
import org.springframework.stereotype.Service;
import com.bankeveris.model.Cliente;
@Stateless
@Local(ClienteDao.class)
@Service
public class ClienteDaoImpl implements ClienteDao {
/** Entity Manager */
@PersistenceContext
private EntityManager entityManager;
@SuppressWarnings("unchecked")
public List<Cliente> findAllCliente() {
System.out.println("Dao: Accediendo a BBDD....");
return (List<Cliente>)entityManager.createNamedQuery("findAllCliente").getResultList();
}
public Cliente findCliente(int noCli) {
Cliente cli= (Cliente)entityManager.createNamedQuery("findCliente").setParameter("nCli", noCli).getSingleResult();
System.out.println("Cliente name: " + cli.getNombre());
return cli;
}
}
when i do debugging, i have a one error, when i use entityManager in this line
| |
|
| Cliente cli= (Cliente)entityManager.createNamedQuery("findCliente").setParameter("nCli", noCli).getSingleResult(); |
it´s the error
02882 [http-8080-1] WARN com.jeveris.pl.navigation.executor.NavigationController - Spring-defined bean not found for action service: com.bankeveris.flujo1DemoBankeveris.Service2F1. Instantiating brand-new action service...
902913 [http-8080-1] INFO com.jeveris.pl.navigation.model.ActionService - Before executing ActionService: com.bankeveris.flujo1DemoBankeveris.Service2F1|flowInstanceId: 5317681774297516717|flowId: Flujo1DemoBankeveris|lastNodeId: BuscarCliente|requiredTransitionId: mandarDatos|nextNodeId: BuscarDatos|containerId: container_1
902913 [http-8080-1] DEBUG com.jeveris.pl.context.beans.FlowScope - view root: org.ajax4jsf.component.AjaxViewRoot@66bb78
902913 [http-8080-1] DEBUG com.jeveris.pl.context.beans.FlowScope - attributes: javax.faces.component.UIComponentBase$AttributesMap@b8a9dd16
java.lang.NullPointerException
at com.bankeveris.dao.ClienteDaoImpl.findCliente(ClienteDaoImpl.java:47)
at com.bankeveris.service.ServiceClienteImpl.cliente(ServiceClienteImpl.java:29)
at com.bankeveris.flujo1DemoBankeveris.Service2F1.execute(Service2F1.java:43)
at com.jeveris.pl.navigation.model.ActionService.service(ActionService.java:41)
at com.jeveris.pl.navigation.executor.NavigationController.processNavigation(NavigationController.java:149)
at com.jeveris.pl.navigation.jsfintegration.PLNavigationHandler.handleNavigation(PLNavigationHandler.java:108)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:130)
at javax.faces.component.UICommand.broadcast(UICommand.java:387)
at org.ajax4jsf.component.AjaxViewRoot.processEvents(AjaxViewRoot.java:321)
at org.ajax4jsf.component.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:296)
at org.ajax4jsf.component.AjaxViewRoot.processPhase(AjaxViewRoot.java:253)
at org.ajax4jsf.component.AjaxViewRoot.processApplication(AjaxViewRoot.java:466)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:100)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.ajax4jsf.webapp.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:177)
at org.ajax4jsf.webapp.BaseFilter.handleRequest(BaseFilter.java:267)
at org.ajax4jsf.webapp.BaseFilter.processUploadsAndHandleRequest(BaseFilter.java:380)
at org.ajax4jsf.webapp.BaseFilter.doFilter(BaseFilter.java:507)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:595)
906366 [http-8080-1] ERROR com.jeveris.pl.navigation.executor.NavigationController - Handle error for exception id=1308037940595: java.lang.NullPointerException
906382 [http-8080-1] ERROR com.jeveris.pl.navigation.executor.NavigationController - Flow information for exception id=1308037940595: flowInstanceId: 5317681774297516717|flowId: Flujo1DemoBankeveris|lastNodeId: BuscarCliente|requiredTransitionId: mandarDatos|nextNodeId: BuscarDatos|containerId: container_1
906382 [http-8080-1] ERROR com.jeveris.pl.navigation.executor.NavigationController - Go to error flow
906382 [http-8080-1] INFO com.jeveris.pl.navigation.executor.NavigationHelper - Access to node errorService in flow error for resource com.jeveris.pl.core.services.ErrorService is granted
906397 [http-8080-1] INFO com.jeveris.pl.navigation.executor.NavigationHelper - Flow started|flowInstanceId: 3810207644419029423|flowId: error|lastNodeId: null|requiredTransitionId: init|nextNodeId: errorService|containerId: container_1
906444 [http-8080-1] DEBUG com.jeveris.pl.navigation.executor.NavigationController - Searching for spring-defined bean errorService
906444 [http-8080-1] WARN com.jeveris.pl.businesslogic.control.BusinessLogicCaller - Service (spring bean) with id errorService was not found. Returning null reference
906460 [http-8080-1] WARN com.jeveris.pl.navigation.executor.NavigationController - Spring-defined bean not found for action service: com.jeveris.pl.core.services.ErrorService. Instantiating brand-new action service...
906460 [http-8080-1] INFO com.jeveris.pl.navigation.model.ActionService - Before executing ActionService: com.jeveris.pl.core.services.ErrorService|flowInstanceId: 3810207644419029423|flowId: error|lastNodeId: null|requiredTransitionId: init|nextNodeId: errorService|containerId: container_1
906476 [http-8080-1] INFO MONITOR - PLResource: com.jeveris.pl.core.services.ErrorService; Time: 0; Active Flow Info: flowInstanceId: 3810207644419029423|flowId: error|lastNodeId: null|requiredTransitionId: init|nextNodeId: errorService|containerId: container_1
906491 [http-8080-1] INFO com.jeveris.pl.navigation.model.ActionService - Transition received: jeveris:end from ActionService: com.jeveris.pl.core.services.ErrorService|flowInstanceId: 3810207644419029423|flowId: error|lastNodeId: null|requiredTransitionId: init|nextNodeId: errorService|containerId: container_1
I do conect hardcode with driverManager.getConection(), and It is good, i think this error is in configure archives.
Please i need held.
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/610052#610052]
Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 5 months
[EJB3] - Re: Upgrading from 4.2.3 to 5.1 fails with "Unable to inject jndi dependency"
by Alexander Hartner
Alexander Hartner [http://community.jboss.org/people/ejb3workshop] created the discussion
"Re: Upgrading from 4.2.3 to 5.1 fails with "Unable to inject jndi dependency""
To view the discussion, visit: http://community.jboss.org/message/610051#610051
--------------------------------------------------------------
The problem was that I also included a JMS Connection factory within my ear file. I was using the xml descriptor to declare the JMS connection factory used by some of my EJBs. By adding a dependency for each bean which uses the connection factory to the jboss.xml deployment descriptor I managed to work around this issue.
There are some things which made this more confusing that it has to be.
1.) The error mentions jms/ConnectionFactory rather than my custom connection factory. This is rather misleading. It could have been much simpler to determine the cause of the problem if it told me that my custom connection factory was not found
2.) The startup sequence / order has been changed from 4.2.3 to 5.1.
> <!-- Job Request Listener MDB -->
> <message-driven>
> <ejb-name>JobRequestListener</ejb-name>
> <destination-jndi-name>queue/abc/JobRequests</destination-jndi-name>
> <!--Inherited From AbstractManagedBean -->
> <resource-ref>
> <res-ref-name>jms/ConnectionFactory</res-ref-name>
> <res-type>javax.jms.ConnectionFactory</res-type>
> <jndi-name>ConnectionFactory</jndi-name>
> </resource-ref>
> ...
> <depends>jboss.jca:service=ConnectionFactoryBinding,name=jms/ABCJMSConnectionFactory</depends>
> <message-driven>
>
>
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/610051#610051]
Start a new discussion in EJB3 at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&cont...]
13 years, 5 months