[JBoss JIRA] Created: (JBPM-1147) iCalendar Wrapper for jBPM tasks
by Adrian Apthorp (JIRA)
iCalendar Wrapper for jBPM tasks
--------------------------------
Key: JBPM-1147
URL: http://jira.jboss.com/jira/browse/JBPM-1147
Project: JBoss jBPM
Issue Type: Feature Request
Reporter: Adrian Apthorp
Assigned To: Tom Baeyens
Provide iCalendar Wrapper for jBPM tasks for HTTP and Mail channels.
The following code sample is an example servlet for retrieving tasks in iCalendar format to demonstrate mapping of Taskinstance to iCalendar VTODO.
[code]
package org.jbpm.examples.simple.web;
import java.io.IOException;
import java.net.URI;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Iterator;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
// Use iCal4j package
import net.fortuna.ical4j.model.DateTime;
import net.fortuna.ical4j.model.Property;
import net.fortuna.ical4j.model.TimeZoneRegistry;
import net.fortuna.ical4j.model.TimeZoneRegistryFactory;
import net.fortuna.ical4j.model.component.VEvent;
import net.fortuna.ical4j.model.component.VToDo;
import net.fortuna.ical4j.model.component.VTimeZone;
import net.fortuna.ical4j.model.property.Attach;
import net.fortuna.ical4j.model.property.Attendee;
import net.fortuna.ical4j.model.property.CalScale;
import net.fortuna.ical4j.model.property.Comment;
import net.fortuna.ical4j.model.property.Completed;
import net.fortuna.ical4j.model.property.Contact;
import net.fortuna.ical4j.model.property.Created;
import net.fortuna.ical4j.model.property.Description;
import net.fortuna.ical4j.model.property.Location;
import net.fortuna.ical4j.model.property.Method;
import net.fortuna.ical4j.model.property.Organizer;
import net.fortuna.ical4j.model.property.Priority;
import net.fortuna.ical4j.model.property.ProdId;
import net.fortuna.ical4j.model.property.Version;
import net.fortuna.ical4j.util.UidGenerator;
import org.jbpm.JbpmConfiguration;
import org.jbpm.JbpmContext;
import org.jbpm.mail.AddressResolver;
import org.jbpm.taskmgmt.exe.TaskInstance;
import org.jbpm.context.exe.ContextInstance;
import org.jbpm.graph.exe.*;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
/**
* Servlet implementation class for Servlet: ICalServlet
*
*/
public class ICalServlet extends javax.servlet.http.HttpServlet implements
javax.servlet.Servlet {
static final long serialVersionUID = 1L;
private static Log log = LogFactory.getLog(ICalServlet.class);
private String localMachine;
private String PORT = "8080";
private static final String TASK_URI = "/jbpm-console/sa/task.jsf?id=";
public ICalServlet() {
super();
try {
localMachine = java.net.InetAddress.getLocalHost().getHostName();
log.info("Hostname of local machine: " + localMachine);
} catch (java.net.UnknownHostException uhe) {
log.info("Can't Retrieve Hostname");
localMachine = "localhost";
}
}
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
String pathInfo = null;
log.debug("Request Path:" + request.getPathInfo());
if (request.getPathInfo() != null) {
pathInfo = request.getPathInfo().toLowerCase();
}
boolean isTaskList = pathInfo != null && pathInfo.endsWith("tasklist.ics");
boolean isFreeBusy = pathInfo != null && pathInfo.endsWith("freebusy.ifb");
if (isTaskList) {
doTaskList(request, response);
} else if (isFreeBusy) {
/*
* doGetFreeBusy(request, response);
*/
}
}
/**
*
* http://localhost:8080/calendar/reply?actor=user
*
*/
public final void doTaskList(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
String actorName = req.getParameter("actor");
log.info("Actor:" + actorName);
JbpmConfiguration jbpmConfiguration = JbpmConfiguration.getInstance();
JbpmContext jbpmContext = jbpmConfiguration.createJbpmContext();
resp.setContentType("text/calendar");
try {
java.util.List toDoList = jbpmContext.getTaskMgmtSession()
.findTaskInstances(actorName);
/*
* jbpmContext.getTaskMgmtSession().findPooledTaskInstances(actorName)
*/
if (toDoList == null) {
resp.sendError(HttpServletResponse.SC_NOT_FOUND,
"No Tasks Found For User");
return;
}
net.fortuna.ical4j.model.Calendar calendar = new net.fortuna.ical4j.model.Calendar();
calendar.getProperties().add(
new ProdId("-//aapthorp//jBPM iCal wrapper//EN"));
calendar.getProperties().add(Version.VERSION_2_0);
calendar.getProperties().add(CalScale.GREGORIAN);
calendar.getProperties().add(Method.REQUEST);
for (Iterator iter = toDoList.iterator(); iter.hasNext();) {
TaskInstance task = (TaskInstance) iter.next();
ProcessInstance processInstance = task.getProcessInstance();
ContextInstance contextInstance = processInstance.getContextInstance();
TimeZoneRegistry registry = TimeZoneRegistryFactory.getInstance()
.createRegistry();
String taskId = String.valueOf(task.getId());
String actorId = task.getActorId();
String taskName = task.getName();
// Due Date - This property defines the date and time that a to do is
// expected to be completed.
net.fortuna.ical4j.model.DateTime dueDate = new net.fortuna.ical4j.model.DateTime(
task.getDueDate());
// Start Date - This property specifies when the calendar component
// begins. There is no direct jBPM equivalent so we use a task variable.
java.util.Calendar beginDate = new GregorianCalendar();
net.fortuna.ical4j.model.TimeZone timezone = registry
.getTimeZone(beginDate.getTimeZone().getID());
net.fortuna.ical4j.model.DateTime startDate = null;
if (contextInstance.hasVariable("start")) {
beginDate.setTime((java.util.Date) contextInstance.getVariable(
"start", task.getToken()));
startDate = new net.fortuna.ical4j.model.DateTime(beginDate.getTime());
startDate.setTimeZone(timezone);
}
dueDate.setTimeZone(timezone);
/*
* Create the VTODO
*
* For testing purposes with user agents that can't handle VTODO's we
* can creat a Vevent VEvent toDo = new VEvent(null,dueDate,taskName+" -
* "+taskId);
*
*/
log.info("Create VTODO: task - " + taskId + " start - " + startDate
+ " due - " + dueDate);
VToDo toDo = new VToDo(startDate, dueDate, taskName + " - " + taskId);
// Creation Date
toDo.getProperties()
.add(
new Created(new net.fortuna.ical4j.model.DateTime(task
.getCreate())));
// End Date a.k.a. Completed Date. This property defines the date and
// time that a to-do was actually completed.
if (task.getEnd() != null) {
toDo.getProperties().add(
new Completed(
new net.fortuna.ical4j.model.DateTime(task.getEnd())));
}
// Generate a UID for the toDo
toDo.getProperties().add((new UidGenerator(taskId)).generateUid());
// Attach URL to Task
toDo.getProperties().add(
new Attach(new URI("http://" + localMachine + ":" + PORT + TASK_URI
+ taskId.toString())));
// Set Contact - We set a task variable for this.
if (contextInstance.hasVariable("Name")) {
toDo.getProperties().add(
new Contact((String) contextInstance.getVariable("Name", task
.getToken())));
}
// Set Location - We set a task variable for this.
if (contextInstance.hasVariable("Address")) {
toDo.getProperties().add(
new Location((String) contextInstance.getVariable("Address", task
.getToken())));
}
// Set Priority
toDo.getProperties().add(new Priority(task.getPriority()));
if (task.getDescription() != null) {
toDo.getProperties().add(new Description(task.getDescription()));
}
java.util.List commentList = task.getComments();
if (commentList != null) {
for (Iterator commentIter = commentList.iterator(); commentIter
.hasNext();) {
org.jbpm.graph.exe.Comment myComment = (org.jbpm.graph.exe.Comment) commentIter
.next();
toDo.getProperties().add(
new net.fortuna.ical4j.model.property.Comment(myComment.getId()
+ ":" + myComment.getTime() + ":" + myComment.getActorId()
+ ":" + myComment.getMessage()));
}
}
// Set Attendee
net.fortuna.ical4j.model.ParameterList attendeePL = new net.fortuna.ical4j.model.ParameterList();
attendeePL.add(new net.fortuna.ical4j.model.parameter.Cn(actorId));
attendeePL.add(new net.fortuna.ical4j.model.parameter.Role(
"REQ-PARTICIPANT"));
attendeePL.add(new net.fortuna.ical4j.model.parameter.PartStat(
"NEEDS-ACTION"));
attendeePL.add(new net.fortuna.ical4j.model.parameter.Rsvp("TRUE"));
AddressResolver addressResolver = (AddressResolver) JbpmConfiguration.Configs
.getObject("jbpm.mail.address.resolver");
URI attendeeURI = new URI("MAILTO", (String) addressResolver
.resolveAddress(actorId), null);
toDo.getProperties().add(new Attendee(attendeePL, attendeeURI));
// Set Organizer
String orgAddress = getFromAddress();
if (orgAddress != null) {
URI mailToURI = new URI("MAILTO", orgAddress, null);
toDo.getProperties().add(new Organizer(mailToURI));
}
calendar.getComponents().add(toDo);
}
resp.getOutputStream().write(calendar.toString().getBytes());
} catch (Exception e) {
e.printStackTrace();
resp.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,
"Caught exception: " + e);
} finally {
jbpmContext.close();
}
}
public String getFromAddress() {
if (JbpmConfiguration.Configs.hasObject("jbpm.mail.from.address")) {
return JbpmConfiguration.Configs.getString("jbpm.mail.from.address");
}
return "jbpm@noreply";
}
}
[/code]
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 7 months
[JBoss JIRA] Created: (JBPM-2384) jopr integration
by Tom Baeyens (JIRA)
jopr integration
----------------
Key: JBPM-2384
URL: https://jira.jboss.org/jira/browse/JBPM-2384
Project: JBoss jBPM
Issue Type: Task
Security Level: Public (Everyone can see)
Reporter: Tom Baeyens
Assignee: Jim Ma
Fix For: jBPM 4.x
Following metrics are on our wishlist:
* manage dead jobs (already available in api)
* number of transactions committed (todo in engine with extra interceptor)
* number of transactions rolledback (todo in engine with extra interceptor)
* average duration of transactions (todo in engine with extra interceptor)
* time spent in jbpm (todo in engine with extra interceptor)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 7 months
[JBoss JIRA] Created: (JBPM-2645) Problem to instanciate ProcessEngine in 4.2
by Alexandre Navarro (JIRA)
Problem to instanciate ProcessEngine in 4.2
-------------------------------------------
Key: JBPM-2645
URL: https://jira.jboss.org/jira/browse/JBPM-2645
Project: jBPM
Issue Type: Bug
Security Level: Public (Everyone can see)
Affects Versions: jBPM 4.2
Reporter: Alexandre Navarro
Fix For: jBPM 4.x
When I want to instanciate my project engine, I have an exception. It was working in 4.0 and 4.1 but not in 4.2.
I think it is because a field must be setted in jbpm but I don't which.
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'processEngine' defined in class path resource [ged/rtma/alice/workflow/core/process/applicationContext-core-process.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.jbpm.api.ProcessEngine org.jbpm.pvm.internal.cfg.SpringConfiguration.buildProcessEngine()] threw exception; nested exception is org.jbpm.pvm.internal.wire.WireException: couldn't initialize object 'org.jbpm.pvm.internal.jobexecutor.JobExecutor': couldn't invoke method start: couldn't invoke 'start' with null on org.jbpm.pvm.internal.jobexecutor.JobExecutor@14ba9a2: no command executor available in job executor
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:444)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:903)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:817)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:440)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
at java.security.AccessController.doPrivileged(Native Method)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at ged.rtma.alice.workflow.core.component.DeploymentDemo.main(DeploymentDemo.java:40)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.jbpm.api.ProcessEngine org.jbpm.pvm.internal.cfg.SpringConfiguration.buildProcessEngine()] threw exception; nested exception is org.jbpm.pvm.internal.wire.WireException: couldn't initialize object 'org.jbpm.pvm.internal.jobexecutor.JobExecutor': couldn't invoke method start: couldn't invoke 'start' with null on org.jbpm.pvm.internal.jobexecutor.JobExecutor@14ba9a2: no command executor available in job executor
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:127)
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:435)
... 17 more
Caused by: org.jbpm.pvm.internal.wire.WireException: couldn't initialize object 'org.jbpm.pvm.internal.jobexecutor.JobExecutor': couldn't invoke method start: couldn't invoke 'start' with null on org.jbpm.pvm.internal.jobexecutor.JobExecutor@14ba9a2: no command executor available in job executor
at org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor.initialize(ObjectDescriptor.java:238)
at org.jbpm.pvm.internal.wire.WireContext.performInitialization(WireContext.java:533)
at org.jbpm.pvm.internal.wire.WireContext.processPendingInitializations(WireContext.java:564)
at org.jbpm.pvm.internal.wire.WireContext.create(WireContext.java:450)
at org.jbpm.pvm.internal.wire.WireContext.create(WireContext.java:437)
at org.jbpm.pvm.internal.wire.WireContext.get(WireContext.java:417)
at org.jbpm.pvm.internal.wire.WireContext.initializeEagerObjects(WireContext.java:283)
at org.jbpm.pvm.internal.wire.WireContext.create(WireContext.java:268)
at org.jbpm.pvm.internal.cfg.ProcessEngineImpl.buildProcessEngine(ProcessEngineImpl.java:157)
at org.jbpm.pvm.internal.cfg.SpringConfiguration.buildProcessEngine(SpringConfiguration.java:81)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:115)
... 18 more
Caused by: org.jbpm.pvm.internal.wire.WireException: couldn't invoke method start: couldn't invoke 'start' with null on org.jbpm.pvm.internal.jobexecutor.JobExecutor@14ba9a2: no command executor available in job executor
at org.jbpm.pvm.internal.wire.operation.InvokeOperation.apply(InvokeOperation.java:43)
at org.jbpm.pvm.internal.wire.descriptor.ObjectDescriptor.initialize(ObjectDescriptor.java:234)
... 32 more
Caused by: org.jbpm.api.JbpmException: couldn't invoke 'start' with null on org.jbpm.pvm.internal.jobexecutor.JobExecutor@14ba9a2: no command executor available in job executor
at org.jbpm.pvm.internal.util.ReflectUtil.invoke(ReflectUtil.java:163)
at org.jbpm.pvm.internal.wire.operation.InvokeOperation.apply(InvokeOperation.java:39)
... 33 more
Caused by: org.jbpm.api.JbpmException: no command executor available in job executor
at org.jbpm.pvm.internal.jobexecutor.JobExecutor.start(JobExecutor.java:78)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.jbpm.pvm.internal.util.ReflectUtil.invoke(ReflectUtil.java:160)
... 34 more
My SpringContext
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">
<bean id="jbpmConfiguration" class="org.jbpm.pvm.internal.cfg.SpringConfiguration">
<constructor-arg value="/ged/rtma/alice/workflow/core/process/jbpm.cfg.xml" />
</bean>
<bean id="processEngine" factory-bean="jbpmConfiguration" factory-method="buildProcessEngine" />
<bean id="repositoryService" factory-bean="processEngine" factory-method="getRepositoryService" />
<bean id="executionService" factory-bean="processEngine" factory-method="getExecutionService" />
<bean id="taskService" factory-bean="processEngine" factory-method="getTaskService" />
<bean id="historyService" factory-bean="processEngine" factory-method="getHistoryService" />
<bean id="managementService" factory-bean="processEngine" factory-method="getManagementService" />
</beans>
My jbpm.cfg.xml
<?xml version="1.0" encoding="UTF-8"?>
<jbpm-configuration >
<import resource="jbpm.jpdl.cfg.xml" />
<import resource="jbpm.identity.cfg.xml" />
<!--import resource="jbpm.jobexecutor.cfg.xml" /-->
<process-engine-context>
<repository-service />
<repository-cache />
<execution-service >
<command-service></command-service>
</execution-service>
<history-service />
<management-service />
<identity-service />
<task-service />
<!-- Here we needed to change the transaction interceptor -->
<command-service>
<retry-interceptor />
<environment-interceptor />
<spring-transaction-interceptor />
</command-service>
<!-- Added spring as read-context -->
<script-manager default-expression-language="juel"
default-script-language="juel"
read-contexts="execution, environment, process-engine, spring"
write-context="">
<script-language name="juel"
factory="org.jbpm.pvm.internal.script.JuelScriptEngineFactory" />
</script-manager>
<!--authentication /-->
<id-generator />
<types resource="jbpm.variable.types.xml" />
<address-resolver />
<job-executor threads="10" idle="5000" idle-max="10000"/>
</process-engine-context>
<transaction-context>
<repository-session />
<db-session />
<message-session />
<timer-session />
<history-session />
<mail-session>
<mail-server>
<session-properties resource="jbpm.mail.properties" />
</mail-server>
</mail-session>
<!-- Need to set explicitly that we don't want jbpm to create sessions -->
<hibernate-session current="true" />
</transaction-context>
</jbpm-configuration>
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 7 months
[JBoss JIRA] Created: (JBPM-1423) idenitfy supported deployments
by Tom Baeyens (JIRA)
idenitfy supported deployments
------------------------------
Key: JBPM-1423
URL: https://jira.jboss.org/jira/browse/JBPM-1423
Project: JBoss jBPM
Issue Type: Task
Security Level: Public (Everyone can see)
Components: PVM
Reporter: Tom Baeyens
Priority: Critical
Identify the supported deployment environments and the corresponding configurations.
This basically will come down to transaction configurations in pvm, hibernate, spring, ejb and the likes.
Configurations:
* pvm
* hibernate
* ejb
Controlling transactions:
* Hibernate transaction programmatic
* Direct JDBC connection programmatic
* JTA UserTransaction programmatic (== BMT?)
* CMT through EJB deployment descriptors
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 7 months
[JBoss JIRA] Created: (JBPM-2478) jBPM4/Spring: unintended wiring PropertiesFactoryBean to RepositoryCacheImpl.deployments field
by Michael Feichtegger (JIRA)
jBPM4/Spring: unintended wiring PropertiesFactoryBean to RepositoryCacheImpl.deployments field
----------------------------------------------------------------------------------------------
Key: JBPM-2478
URL: https://jira.jboss.org/jira/browse/JBPM-2478
Project: jBPM
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Runtime Engine
Affects Versions: jBPM 4.0
Environment: Windows XP Service Pack 3, JDK 1.6.0_13, Eclipse Galileo JavaEE, jBPM4
Reporter: Michael Feichtegger
If you define a spring bean (<bean name="configProperties" class="org.springframework.beans.factory.config.PropertiesFactoryBean" ) this bean will be an instance of java.util.Hashtable (java.util.Properties) at runtime.
During jBPM initialization various ObjectDescriptiors create instances they describe. So do the descriptor of org.jbpm.pvm.internal.repository.RepositoryCacheImpl.
After creation the auto-wire mechanism tries to set-up the fields. In case of RepositoryCacheImpl there is just one field: Map<String, Object> deployments.
The "configProperties" bean will be found in the SpringContext since java.util.Hashtable implements java.util.Map and the field "RepositoryCacheImpl.deployments" will be set because there is just one object of the requested type (java.util.Map). The isAutoWireEnabled attribute is set to "true" (hardcoded) at RepositoryCacheBinding.
This behavior causes a NullPointerException when deleting a deployment
RepositoryCacheImpl.java line 45
deployments.put(deploymentId, null);
That statement works on java.util.HashMap (created when instantiate RepositoryCacheImpl) but not on java.util.Hashtable.
That behaviour might influence several other components.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 7 months
[JBoss JIRA] Created: (JBPM-2677) Migration of process instances fails when there are no process instances
by Edgar Vonk (JIRA)
Migration of process instances fails when there are no process instances
------------------------------------------------------------------------
Key: JBPM-2677
URL: https://jira.jboss.org/jira/browse/JBPM-2677
Project: jBPM
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Runtime Engine
Affects Versions: jBPM 4.2
Reporter: Edgar Vonk
When the process definition includes a 'migrate-instances' entry like:
{code}
<migrate-instances versions="*"/>
{code}
The migration of process instances fails when there are no process instances in the jBPM database:
{quote}
EXCEPTION ###########################################
16:15:36,793 INF | [DefaultCommandService] exception while executing command org.jbpm.pvm.internal.cmd.DeployCmd@1a550
f9
java.lang.IndexOutOfBoundsException: fromIndex = -1
at java.util.SubList.<init>(AbstractList.java:600)
at java.util.RandomAccessSubList.<init>(AbstractList.java:758)
at java.util.AbstractList.subList(AbstractList.java:468)
at org.jbpm.pvm.internal.migration.InstanceMigrator.getProcessesToMigrate(InstanceMigrator.java:104)
at org.jbpm.pvm.internal.migration.InstanceMigrator.getProcessInstancesToMigrate(InstanceMigrator.java:84)
[..]
{quote}
This issue is caused by the following code in the InstanceMigrator class:
{code}
private static List<ProcessDefinition> getProcessesToMigrate(String processDefinitionName, MigrationDescriptor migrationDescriptor) {
RepositorySession repositorySession = EnvironmentImpl.getFromCurrent(RepositorySession.class);
List<ProcessDefinition> processDefinitions = repositorySession
.createProcessDefinitionQuery()
.processDefinitionName(processDefinitionName)
.orderAsc(ProcessDefinitionQuery.PROPERTY_VERSION)
.list();
int startIndex = calculateStartIndex(processDefinitions.size() - 1, migrationDescriptor);
int endIndex = calculateEndIndex(processDefinitions.size() - 1, migrationDescriptor);
if (startIndex > endIndex) startIndex = endIndex;
return processDefinitions.subList(startIndex, endIndex);
}
{code}
No check is done to see if the list of processes (processDefinitions) is not empty.
This issue causes our unit tests to fail since our unit tests start with an empty jBPM database.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 7 months
[JBoss JIRA] Created: (JBPM-2537) A triggered timer does not end the task which is left
by Alexis Seigneurin (JIRA)
A triggered timer does not end the task which is left
-----------------------------------------------------
Key: JBPM-2537
URL: https://jira.jboss.org/jira/browse/JBPM-2537
Project: jBPM
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Runtime Engine
Affects Versions: jBPM 4.0, jBPM 4.1
Reporter: Alexis Seigneurin
In my process definition, "task1" has a transition with a due date. When this timer is triggered by the job executor, the transition takes the process to "task2" but "task1" still looks active. For instance, when I run a "task query", instead of only finding "task2", both "task1" and "task2" are found.
Here is my process definition:
<?xml version="1.0" encoding="UTF-8"?>
<process name="test1" xmlns="http://jbpm.org/4.0/jpdl">
<start g="-9,192,48,48" name="start1">
<transition g="-44,-18" name="to task3" to="task3" />
</start>
<end g="490,192,48,48" name="end1" />
<task g="272,189,92,52" name="task1">
<transition g="-42,-18" name="to end1" to="end1" />
<transition g="-45,-18" name="to java1" to="reminder">
<timer duedate="10 seconds" />
</transition>
</task>
<java class="fr.idm.SimpleReminder" g="272,316,92,52" method="remind" name="reminder">
<transition to="task2" />
</java>
<end g="626,319,48,48" name="end2" />
<task g="454,316,92,52" name="task2">
<transition g="-42,-18" name="to end2" to="end2" />
</task>
<task g="113,189,92,52" name="task3">
<transition g="-44,-18" to="task1" name="to end1" />
</task>
</process>
For testing purpose, I introduced "task3" before "task1". It is not listed by the task query, which makes me think that, once "task1" is left, it should no longer be active.
This looks like https://jira.jboss.org/jira/browse/JBPM-967 but the suggested solution does not seem applicable to JBPM 4.x.
I will attached the whole source code.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 7 months