[JBoss JIRA] Created: (JBPM-1776) org.jbpm.calendar.BusinessCalendar.add(Date, Duration) delivers unexpected results when business amounts are subtracted
by JÃÂürgen Lampe (JIRA)
org.jbpm.calendar.BusinessCalendar.add(Date, Duration) delivers unexpected results when business amounts are subtracted
-----------------------------------------------------------------------------------------------------------------------
Key: JBPM-1776
URL: https://jira.jboss.org/jira/browse/JBPM-1776
Project: JBoss jBPM
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: API
Affects Versions: jBPM 3.2.3
Environment: java.version 1.5.0_13
java.vm.version 1.5.0_13-b05
os.name Windows XP
os.version 5.1
Manifest-Version: 1.0
Ant-Version: Apache Ant 1.7.0
Created-By: 1.7.0-b21 (Sun Microsystems Inc.)
Implementation-Title: jBPM Core Library
Implementation-Version: 3.2.3 (date:18-Jun-2008 00:51)
Implementation-URL: http://www.jboss.org/
Implementation-Vendor: JBoss Inc.
Implementation-Vendor-Id: http://www.jboss.org/
Reporter: JÃÂürgen Lampe
When subtracting business time amounts from a date, the result is after the date and not - as one would expect - before this date.
Examples:
Sat Nov 01 00:00:00 CET 2008 + 2 business days -> Tue Nov 04 17:00:00 CET 2008 - OK
Sat Nov 01 00:00:00 CET 2008 - 2 business days -> Sun Nov 02 18:00:00 CET 2008 - unexpected
Sat Nov 01 00:00:00 CET 2008 + 2 business hours -> Mon Nov 03 11:00:00 CET 2008 - OK
Sat Nov 01 00:00:00 CET 2008 -2 business hours -> Mon Nov 03 07:00:00 CET 2008 - unexpected
Data was created by use of small test program:
Date date=new SimpleDateFormat("dd.MM.yyyy").parse("01.11.2008");
String[] durStrs= {"+ 2 business days", "- 2 business days", "+ 2 business hours", "-2 business hours"};
BusinessCalendar calendar= new BusinessCalendar();
for (String durStr: durStrs) {
Duration duration= new Duration(durStr);
Date d= calendar.add(date, duration);
System.out.println(" "+date+" "+durStr+" -> "+d);
}
--
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, 2 months
[JBoss JIRA] Created: (JBPM-2422) investigate if logging abstraction should be removed
by Tom Baeyens (JIRA)
investigate if logging abstraction should be removed
----------------------------------------------------
Key: JBPM-2422
URL: https://jira.jboss.org/jira/browse/JBPM-2422
Project: JBoss jBPM
Issue Type: Task
Security Level: Public (Everyone can see)
Reporter: Tom Baeyens
Priority: Minor
Fix For: jBPM 4.x
the current approach is to have a minimal log framework pluggability:
----------------------------------------------------------------------------------------------
1) jdk logging because we want it to be possible to run pvm without external library dependencies
2) log4j as jboss doesn't include a jdklogging-to-log4j bridge.
general links
------------------
http://www.jboss.org/community/wiki/Logging
select between these options:
-----------------------------------------
1) always require a jbpm.logging.properties on the classpath. that configures the jdk logging. eithers completely, or with a delegation to log4j in that case our jbpm code can always use the jdk logging.
2) keep it as it is
3) similar solution to seam for facelets:
===http://markmail.org/message/ywamc5yc7hejrlls====================================================================
Subject: Facelets JDK Logging -> JBoss Log4j bridge Actions...
From: Pete Muir (pmu...(a)bleepbleep.org.uk)
Date: Feb 19, 2008 7:27:50 am
List: net.java.dev.facelets.dev
As has been discussed many times on the seam forum and facelets mailing list, JBoss AS doesn't have a jdk logger -> log4j generic bridge (I don't know why, and I don't really want to find out) so what Stan did for JSF RI was write a JDK logging filter that would bridge JUL to log4j.
I have done the same for Facelets (included as part of jboss-seam-ui.jar, I can factor out the relevant code if anyone wants it) but hit a sight problem. Most logs in facelets are declared protected static final (so I can get at them using reflection) but in DefaultFacelet, CompositionHandler and DecorateHandler they are protected final (so I can't get at them easily as they aren't static).
Any chance they could become static? Let me know and I'll file a bug.
Code is here
http://fisheye.jboss.org/browse/Seam/trunk/ui/src/main/java/org/jboss/sea...
Thanks,
Pete
-- Pete Muir http://in.relation.to/Bloggers/Pete http://www.seamframework.org
============================================================================================================
--
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, 2 months
[JBoss JIRA] Created: (JBPM-2907) Candidate-Groups
by Sandro Röder (JIRA)
Candidate-Groups
----------------
Key: JBPM-2907
URL: https://jira.jboss.org/browse/JBPM-2907
Project: jBPM
Issue Type: Bug
Security Level: Public (Everyone can see)
Components: Runtime Engine
Affects Versions: jBPM 4.3
Reporter: Sandro Röder
@see: https://jira.jboss.org/browse/JBPM-2648
Hi everybody,
if you solve the problem like this "hql.append ( "select distinct task");" in the version 4.4 the code will not work anymore with Oracle because of the clob description field.
I test the source code from the cvs:
this is the resulting sql:
select distinct (task.id) from org.jbpm.pvm.internal.task.TaskImpl as task , org.jbpm.pvm.internal.task.ParticipationImpl as participant where participant.task = task and participant.type = 'candidate' and ((participant.userId = :candidateUserId) or (participant.groupId in (:candidateGroupIds))) and task.assignee is null
and in the result set is the following:
[1260352, 1260356]
just the task ids.
here is my working change 8on version (4.3) with a subselect to get the tasks directly:
/**
*
*/
package com.ctlmb.vip.jbpm.impl;
import java.util.ArrayList;
import java.util.List;
import org.apache.log4j.Logger;
import org.jbpm.api.identity.Group;
import org.jbpm.pvm.internal.env.EnvironmentImpl;
import org.jbpm.pvm.internal.identity.spi.IdentitySession;
import org.jbpm.pvm.internal.model.ExecutionImpl;
import org.jbpm.pvm.internal.query.TaskQueryImpl;
import org.jbpm.pvm.internal.task.ParticipationImpl;
import org.jbpm.pvm.internal.task.TaskImpl;
/**
* TODO comment me
* @author roeder
*
*/
public class TaskQueryWorkaround extends TaskQueryImpl{
private static final Logger log = Logger.getLogger(TaskQueryWorkaround.class);
/* (non-Javadoc)
* @see org.jbpm.pvm.internal.query.TaskQueryImpl#hql()
*/
@Override
public String hql() {
StringBuilder hql = new StringBuilder();
hql.append("select ");
if (count) {
hql.append("count(task) ");
} else {
hql.append("task ");
}
hql.append("from ");
hql.append(TaskImpl.class.getName());
hql.append(" as task ");
// participations
if (candidate!=null) {
//################# orginal
// hql.append(", ");
// hql.append(ParticipationImpl.class.getName());
// hql.append(" as participant ");
//
// appendWhereClause("participant.task = task ", hql);
// appendWhereClause("participant.type = 'candidate' ", hql);
//
// IdentitySession identitySession = EnvironmentImpl.getFromCurrent(IdentitySession.class);
// List<Group> groups = identitySession.findGroupsByUser(candidate);
// if (groups.isEmpty()) {
// groupIds = null;
// appendWhereClause("participant.userId = :candidateUserId ", hql);
//
// } else {
// groupIds = new ArrayList<String>();
// for (Group group: groups) {
// groupIds.add(group.getId());
// }
// appendWhereClause("((participant.userId = :candidateUserId) or (participant.groupId in (:candidateGroupIds)))", hql);
// }
//################# end orginal
//################# my change
appendWhereClause("task in ( ", hql);
StringBuilder innerSelect = new StringBuilder();
innerSelect.append("select participant.task ");
innerSelect.append("from ");
innerSelect.append(ParticipationImpl.class.getName());
innerSelect.append(" as participant ");
innerSelect.append("where ");
innerSelect.append("participant.type = 'candidate' ");
IdentitySession identitySession = EnvironmentImpl.getFromCurrent(IdentitySession.class);
List<Group> groups = identitySession.findGroupsByUser(candidate);
innerSelect.append("and ");
if (groups.isEmpty()) {
groupIds = null;
innerSelect.append("participant.userId = :candidateUserId ");
} else {
groupIds = new ArrayList<String>();
for (Group group: groups) {
groupIds.add(group.getId());
}
innerSelect.append("((participant.userId = :candidateUserId) or (participant.groupId in (:candidateGroupIds)))");
}
hql.append(innerSelect);
hql.append(") ");
}
//################# end my change
if (suspended!=null) {
if (suspended) {
appendWhereClause("task.state = '"+ExecutionImpl.STATE_SUSPENDED+"' ", hql);
} else {
appendWhereClause("task.state != '"+ExecutionImpl.STATE_SUSPENDED+"' ", hql);
}
}
if (processInstanceId!=null) {
appendWhereClause("task.processInstance.id = '"+processInstanceId+"' ", hql);
}
if (activityName!=null) {
appendWhereClause("task.execution.activityName = '"+activityName+"' ", hql);
}
if (processDefinitionId!=null) {
appendWhereClause("task.processInstance.processDefinitionId = '"+processDefinitionId+"' ", hql);
}
if (assignee!=null) {
appendWhereClause("task.assignee = :assignee ", hql);
} else if (unassigned) {
appendWhereClause("task.assignee is null ", hql);
}
appendOrderByClause(hql);
String hqlQuery = hql.toString();
log.debug(hqlQuery);
return hqlQuery;
}
/* (non-Javadoc)
* @see org.jbpm.pvm.internal.query.AbstractQuery#count()
*/
@Override
public long count() {
count = true;
return -9999;
}
}
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
14 years, 2 months