[JBoss JIRA] Created: (JBPM-1016) ProcessState 'leave' method always returns default transition
by Randy Gullett (JIRA)
ProcessState 'leave' method always returns default transition
--------------------------------------------------------------
Key: JBPM-1016
URL: http://jira.jboss.com/jira/browse/JBPM-1016
Project: JBoss jBPM
Issue Type: Patch
Components: Core Engine
Affects Versions: jBPM jPDL 3.2
Reporter: Randy Gullett
Assigned To: Tom Baeyens
The leave method for ProcessStates currently automatically takes the default transition despite taking a transition as a parameter. Can it be modified so that it leaves by the transition passed in (if it isn't null) like you'd expect it to? I want to be able to short-circuit my subprocesses in certain scenarios. See the method as it's currently coded below.
public void leave(ExecutionContext executionContext, Transition transition) {
ProcessInstance subProcessInstance = executionContext.getSubProcessInstance();
Token superProcessToken = subProcessInstance.getSuperProcessToken();
// feed the readable variableInstances
if ((variableAccesses != null) && (!variableAccesses.isEmpty())) {
ContextInstance superContextInstance = executionContext.getContextInstance();
ContextInstance subContextInstance = subProcessInstance.getContextInstance();
// loop over all the variable accesses
Iterator iter = variableAccesses.iterator();
while (iter.hasNext()) {
VariableAccess variableAccess = (VariableAccess) iter.next();
// if this variable access is writable
if (variableAccess.isWritable()) {
// the variable is copied from the sub process mapped name
// to the super process variable name
String mappedName = variableAccess.getMappedName();
Object value = subContextInstance.getVariable(mappedName);
String variableName = variableAccess.getVariableName();
log.debug("copying sub process var '"+mappedName+"' to super process var '"+variableName+"': "+value);
if (value!=null) {
superContextInstance.setVariable(variableName, value, superProcessToken);
}
}
}
}
// fire the subprocess ended event
fireEvent(Event.EVENTTYPE_SUBPROCESS_END, executionContext);
// remove the subprocess reference
superProcessToken.setSubProcessInstance(null);
// We replaced the normal log generation of super.leave() by creating the log here
// and overriding the addNodeLog method with an empty version
superProcessToken.addLog(new ProcessStateLog(this, superProcessToken.getNodeEnter(), new Date(), subProcessInstance));
// call the subProcessEndAction
[b]super.leave(executionContext, getDefaultLeavingTransition());[/b] }
The bold line could be replaced by something like:
if(transition != null) {
super.leave(executionContext, transition);
} else {
super.leave(executionContext, getDefaultLeavingTransition());
--
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
16 years, 8 months
[JBoss JIRA] Updated: (JBPM-457) Parent process deployment does not link process-state with subprocess definition
by Tom Baeyens (JIRA)
[ http://jira.jboss.com/jira/browse/JBPM-457?page=all ]
Tom Baeyens updated JBPM-457:
-----------------------------
Fix Version/s: jBPM jPDL 3.2.2
Priority: Critical (was: Major)
> Parent process deployment does not link process-state with subprocess definition
> --------------------------------------------------------------------------------
>
> Key: JBPM-457
> URL: http://jira.jboss.com/jira/browse/JBPM-457
> Project: JBoss jBPM
> Issue Type: Bug
> Components: Core Engine
> Reporter: Eduardo Jimenez
> Assigned To: Tom Baeyens
> Priority: Critical
> Fix For: jBPM jPDL 3.2.2
>
>
> From the ProcessState code:
> Code:
> if (jbpmSession != null) {
>
> // now, we must be able to find the sub-process
> if (subProcessName != null) {
>
> // if the name and the version are specified
> if (subProcessVersion != null) {
>
> try {
> int version = Integer.parseInt(subProcessVersion);
> // select that exact process definition as the subprocess definition
> subProcessDefinition = jbpmSession.getGraphSession().findProcessDefinition(subProcessNam
> e, version);
> } catch (NumberFormatException e) {
> jpdlReader.addWarning("version in process-state was not a number: " + processStateElement.asXML());
> }
>
> } else { // if only the name is specified
> // select the latest version of that process as the subprocess
> // definition
> subProcessDefinition = jbpmSession.getGraphSession().findLatestProcessDefinition(subProces
> sName);
> }
> } else {
> jpdlReader.addWarning("no sub-process name specified in process-state " + processStateElement.asXML());
> }
> }
>
> if there is no session open, it simply won't look for the parent process.
> Now, from the ProcessArchiveDeployer:
> Code:
> public static void deployZipInputStream(ZipInputStream zipInputStream, JbpmSessionFactory jbpmSessio
> nFactory) {
> ProcessDefinition processDefinition = ProcessDefinition.parseParZipInputStream(zipInputStream);
> deployProcessDefinition(processDefinition, jbpmSessionFactory);
> }
>
> It reads the process definition first, then calls deploy, which opens the first jbpmSession!!!. The session must be open first before attempting to deploy!.
> Now, you might say, use the ant task, but the bug is still there:
> Code:
> private void deploy(File file, JbpmSessionFactory jbpmSessionFactory) throws IOException, FileNotFou
> ndException {
> ZipInputStream zipInputStream = new ZipInputStream(new FileInputStream(file));
> ProcessArchiveDeployer.deployZipInputStream(zipInputStream,jbpmSessionFactory);
> }
>
> See, the ant task doens't open a jbpmSession either, so its up to ProcessArchiveDeployer.deployZipInputStream() to do it, which is the same method I'm having an issue with.
> Examining ProcessArchiveDeployer, every way of deploying a process would have the same problem.
--
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
16 years, 8 months
[JBoss JIRA] Created: (HIBERNATE-71) ".." in relative path to orm.xml not properly recognized
by Ronald Fischer (JIRA)
".." in relative path to orm.xml not properly recognized
--------------------------------------------------------
Key: HIBERNATE-71
URL: http://jira.jboss.com/jira/browse/HIBERNATE-71
Project: Hibernate
Issue Type: Bug
Environment: Windows XP
Reporter: Ronald Fischer
Assigned To: Steve Ebersole
I have the following files:
\thome\tmp\MyApplication.class
\thome\tmp\META-INF\persistence.xml
\thome\etc\orm.xml
The file persistence.xml contains the line
<mapping-file>../etc/orm.xml</mapping-file>
The directory \thome\tmp is in my classpath.
MyApplication.class throws exception
[java] log4j:WARN Please initialize the log4j system properly.
[java] Exception in thread "main" javax.persistence.PersistenceException: [
PersistenceUnit: TFW_InsertMasterData_SCM] Unable to find XML mapping file in cl
asspath: /../etc/orm.xml
[java] at org.hibernate.ejb.Ejb3Configuration.addClassesToSessionFactor
y(Ejb3Configuration.java:914)
[java] at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configurati
on.java:772)
[java] at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configurati
on.java:183)
[java] at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configurati
on.java:240)
[java] at org.hibernate.ejb.HibernatePersistence.createEntityManagerFac
tory(HibernatePersistence.java:120)
[java] at javax.persistence.Persistence.createEntityManagerFactory(Pers
istence.java:51)
[java] at javax.persistence.Persistence.createEntityManagerFactory(Pers
istence.java:33)
[java] at InsertMasterData.main(InsertMasterData.java:27)
When I copy orm.xml into my META-INF directory and change my persistence.xml
to
<mapping-file>/META-INF/orm.xml</mapping-file>
everything works fine.
>From this I conclude that Hibernate can not follow a path starting with .. to find the
mapping file.
--
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
16 years, 8 months
[JBoss JIRA] Closed: (JBPM-72) required variable declaration
by Tom Baeyens (JIRA)
[ http://jira.jboss.com/jira/browse/JBPM-72?page=all ]
Tom Baeyens closed JBPM-72.
---------------------------
Resolution: Won't Fix
won't fix till jbpm 4. there we have the opportunity to fix it right. i don't want to introduce an intermediate solution
> required variable declaration
> -----------------------------
>
> Key: JBPM-72
> URL: http://jira.jboss.com/jira/browse/JBPM-72
> Project: JBoss jBPM
> Issue Type: Feature Request
> Components: Core Engine
> Reporter: Tom Baeyens
> Assigned To: Tom Baeyens
> Priority: Optional
>
> we could add support for a configuration that requires all variables to be declared (including the type) before they are used. this creates a bit of 'type safety', although it is only checkable at runtime...
> this should be done on the level of the task. maybe tasks should be able to extract data from the process and completion of the task should update the variables in the context.
--
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
16 years, 8 months
[JBoss JIRA] Commented: (JBPM-613) Improve variable support
by Tom Baeyens (JIRA)
[ http://jira.jboss.com/jira/browse/JBPM-613?page=comments#action_12374995 ]
Tom Baeyens commented on JBPM-613:
----------------------------------
i meant: intermediate
> Improve variable support
> ------------------------
>
> Key: JBPM-613
> URL: http://jira.jboss.com/jira/browse/JBPM-613
> Project: JBoss jBPM
> Issue Type: Feature Request
> Components: Core Engine
> Reporter: J.Enrique Ruiz
> Assigned To: Tom Baeyens
> Priority: Minor
>
> Hi,
> The JPDL variable element can be used to share info with a new process instance created in a process-state. Sometimes, it is interesting to set the value of a variable in the JPDL, for example:
> <process-state name="cms">
> ...
> <variable name="documentType" access="read" value="RTF" />
> ...
> </process-state>
> Currently, we have a ActionHandler that has been defined in the node-enter event. This ActionHandler puts the values in the variable map of the parent process instance, but the new feature can simplify it.
> Best regards.
--
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
16 years, 8 months