[JBoss jBPM] - Re: A question to the DecisionNode
by Olivier_Debels
Well,
The reason why it doesn't work is because when you don't add the condition part in your second transition, you end up with a decision node which only contains a single DecisionCondition.
When you look into the code of the decision node (the execute method), you will see it loops over all DecisionConditions (in your case only 1!), and checks if it can find one which is true:
Iterator iter = decisionConditions.iterator();
| while (iter.hasNext() && (transition==null)) {
| DecisionCondition decisionCondition = (DecisionCondition) iter.next();
| Object result = JbpmExpressionEvaluator.evaluate(decisionCondition.getExpression(), executionContext);
| if (Boolean.TRUE.equals(result)) {
| if (transition!=null) {
| transition.removeConditionEnforcement();
| }
| String transitionName = decisionCondition.getTransitionName();
| transition = getLeavingTransition(transitionName);
| }
| }
|
Since this condition fails, it will take the default leaving transition (the first transition.
if (transition==null) {
| transition = getDefaultLeavingTransition();
| log.debug("decision didn't select transition, taking default "+transition);
| }
|
What you can do to go around this behaviour:
- Make a condition for your second one which is always true (like you did before but you can also use dummy expression's like 1==1).
- Move your second condition first, and make sure it always fails (by placing and EMPTY conditiion f.e. ), when all other condition's fail, the default leaving transition will be choosen, and guess this will be the first one, the one with the empty condition element.
I would choose the second option.
Cheers,
Olivier.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4156928#4156928
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4156928
17 years, 10 months
[EJB/JBoss] - Dependency EJB -> RAR not working
by perryl
I have an MDB that uses the IBM MQ resource adapter. In the server logs, I can see that my MDB is loaded before the RAR for MQ. If I deploy my app after JBoss and the RAR are running, all is well. If I start JBoss with my app already deployed, I get an exception:
jboss.j2ee:ear=otisEAR.ear,jar=otisEJB.jar,name=IncomingMessageBean,service=EJB3 -> javax.management.InstanceNotFoundException: jboss.jca:service=RARDeployment,name='wmq.jmsra.rar' is not registered.
I believe I have set the dependencies up correctly:
<?xml version="1.0" encoding="UTF-8"?>
| <connection-factories>
|
| <tx-connection-factory>
| <jndi-name>OtisInCF</jndi-name>
| <xa-transaction />
| <rar-name>wmq.jmsra.rar</rar-name>
| <connection-definition>javax.jms.ConnectionFactory</connection-definition>
| <config-property name="channel" type="java.lang.String">SYSTEM.DEF.SVRCONN</config-property>
| <config-property name="hostName" type="java.lang.String">127.0.0.1</config-property>
| <config-property name="port" type="java.lang.String">1414</config-property>
| <config-property name="queueManager" type="java.lang.String">QM_stg352670</config-property>
| <config-property name="transportType" type="java.lang.String">CLIENT</config-property>
| <security-domain-and-application>JmsXARealm</security-domain-and-application>
| </tx-connection-factory>
|
| <mbean code="org.jboss.resource.deployment.AdminObject"
| name="jca.wmq:name=otisinqueue">
| <attribute name="JNDIName">wsmq/OtisInQueue</attribute>
| <depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='wmq.jmsra.rar'</depends>
| <attribute name="Type">javax.jms.Queue</attribute>
| <attribute name="Properties">
| baseQueueManagerName=QM_stg352670
| baseQueueName=LPTestQ
| </attribute>
| </mbean>
|
| </connection-factories>
|
JBoss 5 beta 4 doesn't seem to heed the dependency instructions in my mbean, excerpted here:
<depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='wmq.jmsra.rar'</depends>
Is this a known issue, or am I doing something wrong here?
TIA.
Perry
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4156920#4156920
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4156920
17 years, 10 months
left-join read-ahead not working
by Tamara Cattivelli
Hello everybody,
I have two cmp-ejbs A and B, that have a one-to-many CMR-relation.
Starting from an instance of A i want to pre-load the related B-objects.
I try to optimize this by adding <left-join> tags to jbosscmp-jdbc.xml.
I am using Oracle 9i and jboss-4.0.4.GA.
The left-join query is submitted on the JBOSS console but after that all
data is loaded as if I had not defined an eager-load-group-tag with
left-join for my finder.
Can anybody please help?
Tamara
17 years, 10 months
[EJB 3.0] - throws javax.ejb.RemoveException, javax.ejb.EJBException, cau
by mallikarjun_nbsg
Hi,
I am getting the following error when trying to use composite primary key for deletion of a record.
2008-06-10 12:29:36,176 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.RCVlanLoopDetectedTableHome] Executing SQL: SELECT rcVlanLoopDetectedVlanId, rcVlanLoopDetectedPortIndex, rcVlanLoopDetectedValue FROM rcVlanLoopDetectedTable WHERE ()
2008-06-10 12:29:36,176 ERROR [org.jboss.ejb.plugins.LogInterceptor] EJBException in method: public abstract void javax.ejb.EJBLocalObject.remove() throws javax.ejb.RemoveException,javax.ejb.EJBException, causedBy:
java.sql.SQLException: Syntax error or access violation, message from server: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1"
The code that I have written is:
primary key class
| public class RCVlanMacTablePK implements Serializable {
|
| Long rcVlanMacVlanId;
| String rcVlanMacAddr;
|
| public RCVlanMacTablePK() {
|
| this.rcVlanMacVlanId = null;
| this.rcVlanMacAddr = null;
|
| }
|
| public RCVlanMacTablePK(HashMap<String, Object> values) {
|
| this.rcVlanMacVlanId = Long.parseLong(values.get("rcVlanMacVlanId")
| .toString());
| this.rcVlanMacAddr = values.get("rcVlanMacAddr").toString();
|
| }
| }
In the session facade calling delete method for deleting the record in a table:
| public String delete(HashMap<String, Object> values) {
|
| try {
| RCVlanMacTablePK pk = pkLoader(values);
| home.remove(pk);
| } catch (RemoveException e) {
| log.info("RCVlan: Exception in deleted method " + e);
| } catch (EJBException e) {
| log.info("RCVlan: Exception in deleted method " + e);
| } catch (NumberFormatException e) {
| log.info("RCVlan: Exception in deleted method " + e);
| }
| return str;
| }
|
|
above pkLoader(values) is the method to load the primark key class and passing that primary key class variable to the remove method and calling remove(Object primarykey) method of EJBLocalHome Interface. ie home.remove(pk);
In the ejb-jar.xml:
| <entity>
| <ejb-name>RCVlanMacTableHome</ejb-name>
| <local-home>com.sasken.sasems.server.beens.RCVlanMacTableHome</local-home>
| <local>com.sasken.sasems.server.beens.RCVlanMacTableRemote</local>
| <ejb-class>com.sasken.sasems.server.beens.RCVlanMacTableBean</ejb-class>
| <persistence-type>Container</persistence-type>
| <cmp-version>2.x</cmp-version>
| <abstract-schema-name>rcVlanMacTable</abstract-schema-name>
| <prim-key-class>com.sasken.sasems.server.beens.RCVlanMacTablePK</prim-key-class>
| <reentrant>False</reentrant>
| <cmp-field>
| <field-name>rcVlanMacVlanId</field-name>
| </cmp-field>
| <cmp-field>
| <field-name>rcVlanMacAddr</field-name>
| </cmp-field>
| <cmp-field>
| <field-name>rcVlanMacRowStatus</field-name>
| </cmp-field>
| </entity>
|
I am getting the above error when executing the same. Please let me what needs to be done for a composite primary key. I am using EJB2.0
Thank you,
Mallikarjun.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4156911#4156911
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4156911
17 years, 10 months
[EJB/JBoss] - throws javax.ejb.RemoveException, javax.ejb.EJBException, cau
by mallikarjun_nbsg
Hi,
I am getting the following error when trying to use composite primary key for deletion of a record.
2008-06-10 12:29:36,176 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.RCVlanLoopDetectedTableHome] Executing SQL: SELECT rcVlanLoopDetectedVlanId, rcVlanLoopDetectedPortIndex, rcVlanLoopDetectedValue FROM rcVlanLoopDetectedTable WHERE ()
2008-06-10 12:29:36,176 ERROR [org.jboss.ejb.plugins.LogInterceptor] EJBException in method: public abstract void javax.ejb.EJBLocalObject.remove() throws javax.ejb.RemoveException,javax.ejb.EJBException, causedBy:
java.sql.SQLException: Syntax error or access violation, message from server: "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1"
The code that I have written is:
primary key class
| public class RCVlanMacTablePK implements Serializable {
|
| Long rcVlanMacVlanId;
| String rcVlanMacAddr;
|
| public RCVlanMacTablePK() {
|
| this.rcVlanMacVlanId = null;
| this.rcVlanMacAddr = null;
|
| }
|
| public RCVlanMacTablePK(HashMap<String, Object> values) {
|
| this.rcVlanMacVlanId = Long.parseLong(values.get("rcVlanMacVlanId")
| .toString());
| this.rcVlanMacAddr = values.get("rcVlanMacAddr").toString();
|
| }
| }
In the session facade calling delete method for deleting the record in a table:
| public String delete(HashMap<String, Object> values) {
|
| try {
| RCVlanMacTablePK pk = pkLoader(values);
| home.remove(pk);
| } catch (RemoveException e) {
| log.info("RCVlan: Exception in deleted method " + e);
| } catch (EJBException e) {
| log.info("RCVlan: Exception in deleted method " + e);
| } catch (NumberFormatException e) {
| log.info("RCVlan: Exception in deleted method " + e);
| }
| return str;
| }
|
|
above pkLoader(values) is the method to load the primark key class and passing that primary key class variable to the remove method and calling remove(Object primarykey) method of EJBLocalHome Interface. ie home.remove(pk);
In the ejb-jar.xml:
| <entity>
| <ejb-name>RCVlanMacTableHome</ejb-name>
| <local-home>com.sasken.sasems.server.beens.RCVlanMacTableHome</local-home>
| <local>com.sasken.sasems.server.beens.RCVlanMacTableRemote</local>
| <ejb-class>com.sasken.sasems.server.beens.RCVlanMacTableBean</ejb-class>
| <persistence-type>Container</persistence-type>
| <cmp-version>2.x</cmp-version>
| <abstract-schema-name>rcVlanMacTable</abstract-schema-name>
| <prim-key-class>com.sasken.sasems.server.beens.RCVlanMacTablePK</prim-key-class>
| <reentrant>False</reentrant>
| <cmp-field>
| <field-name>rcVlanMacVlanId</field-name>
| </cmp-field>
| <cmp-field>
| <field-name>rcVlanMacAddr</field-name>
| </cmp-field>
| <cmp-field>
| <field-name>rcVlanMacRowStatus</field-name>
| </cmp-field>
| </entity>
|
I am getting the above error when executing the same. Please let me what needs to be done for a composite primary key.
Thank you,
Mallikarjun.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4156909#4156909
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4156909
17 years, 10 months