[JBoss jBPM] - Re: Re-routing Tokens
by dleerob
Thanks Ronald for the quick reply.
Okay I have done the following, and it seems to reroute to the new node okay.
//remove current incomplete task instances---------------------------------------------------
| log.info("Removing task instances found at token with ID '"+tokenId+"'");
| List deleteTaskInstanceList = new ArrayList();
| //create a seperate list of those task instances to delete. If deleting them
| //straight from iterator, a ConcurrentModificationException will occur when calling it.next();
| for(Iterator it = processInstance.getTaskMgmtInstance().getTaskInstances().iterator();it.hasNext();) {
| TaskInstance taskInstance = (TaskInstance)it.next();
| if(tokenId.equals(taskInstance.getToken().getId()+"")) {
| if (taskInstance.getEnd() == null) { //not complete task
| deleteTaskInstanceList.add(taskInstance);
| }
| }
| }
| for (int x = 0; x < deleteTaskInstanceList.size(); x++) {
| TaskInstance taskInstance = (TaskInstance)deleteTaskInstanceList.get(x);
| log.info("Removing task instance with ID '"+taskInstance.getId()+"'");
| processInstance.getTaskMgmtInstance().removeTaskInstance(taskInstance);
| }
| //----------------------------------------------------------------------------------------------
|
| //enter new node
| Node newNode = processInstance.getProcessDefinition().getNode(nodeName);
| newNode.enter(new ExecutionContext(token));
It seems to have the desired effect. You obviously have to keep in mind that you may break something, depending on what your actions etc do, but if you understand how your flow works, you can use this method appropriatly. Can anyone see anything that may cause problems here?
The only thing that isn't working at the moment is the code
processInstance.getTaskMgmtInstance().removeTaskInstance(taskInstance);
The task instance doesn't actually get deleted. Any ideas why?
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4114659#4114659
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114659
18 years, 4 months
[JBoss Seam] - Re: implementing SMPC questions
by pete.muir@jboss.org
"asookazian" wrote : 1) I'm still getting "@In attribute requires non-null value: securityAuditAction.em" when I run my test case even after adding the create=true element setting in the @In attribute. How can I fix that?
What does your components.xml look like?
anonymous wrote : 2) The previous code was as follows:
|
| @PersistenceContext(unitName="boIcomsSecurityAudit", type=PersistenceContextType.EXTENDED)
| | private EntityManager em;
|
| Note that I have multiple persistence units in my persistence.xml as well as multiple datasources in my *-ds.xml. How will the SMPC know which datasource or persistence unit to use? The optional elements for @In are required, create, scope, value.
By the wiring in your components.xml
anonymous wrote : 4) is the SMPC similar to JPA EXTENDED persistence context type in that the JPA entities are not released (unmanaged) from the PC?
It's like an Extended PC that is scoped to a conversation rather than a SFSB. It has significantly simpler propagation rules
anonymous wrote : must you use SMPC or can you use JPA Extended PersistenceContext as follows?
You can use either, but you must use Hibernate atm.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4114652#4114652
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114652
18 years, 4 months
[Beginners Corner] - JBoss + Xerces + Xalan ... lots of problems
by viniciuscarvalho
Hello there! I'm living a nightmare with xml-apis....
I have a transformation that works fine in my eclipse test cases:
| <message>
| <header>
| <id>1234</id>
| </header>
| <payload>
| <customer>
| <id/>
| </customer>
| </payload>
| </message>
|
| What I need is to copy the id from header to customer. Well hereÅ the xsl:
|
| <?xml version="1.0" encoding="ISO-8859-1"?>
| <xsl:stylesheet version="1.0"
| xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
| <xsl:template match="//customer/id">
| <xsl:variable name="idc" select="//payload/customer/id"/>
| <id><xsl:value-of select="$idc"/><id>
| </xsl:template>
|
| <xsl:template match="*">
| <xsl:copy>
| <xsl:apply-templates select="@*"/>
| <xsl:apply-templates select="node()"/>
| </xsl:copy>
| </xsl:template>
| </xsl:stylesheet>
|
|
Well, when deployed on jboss it does not work .
So I've ran my tests using the endorsed libs from jboss, well it really does not work with those xerces/xalan versions:(
Trying to start without the endorsed overriding mechanism from jboss, throws exceptions about xerces classes (hum, aren't they loaded by the bootstrap classloader from the JVM???).
It's really hard to figure which version o xalan do I need to get it working. I've already ask this at their list, and I'm stuck with this for over 2 days now. I've tried JDK 6.0, which really works, but since I'm using jbossws, I'm having issues with jaxb :(
anyone could point me a solution?
Best regards
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4114651#4114651
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114651
18 years, 4 months