Author: scabanovich
Date: 2011-03-24 19:48:04 -0400 (Thu, 24 Mar 2011)
New Revision: 29997
Modified:
branches/jbosstools-3.2.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta
branches/jbosstools-3.2.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/BusinessRulesProcessor.java
branches/jbosstools-3.2.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/ContentBasedRouter.java
Log:
JBIDE-8466
https://issues.jboss.org/browse/JBIDE-8466
Modified:
branches/jbosstools-3.2.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta
===================================================================
---
branches/jbosstools-3.2.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta 2011-03-24
23:42:54 UTC (rev 29996)
+++
branches/jbosstools-3.2.x/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta 2011-03-24
23:48:04 UTC (rev 29997)
@@ -11,7 +11,9 @@
<PAIR name="org.jboss.soa.esb.actions.Aggregator"
value="ESBPreActionAggregator"/>
<PAIR name="org.jboss.soa.esb.actions.BusinessRulesProcessor"
value="ESBPreActionBusinessRulesProcessor"/>
<PAIR name="org.jboss.soa.esb.actions.ContentBasedRouter"
value="ESBPreActionContentBasedRouter"/>
+ <PAIR name="org.jboss.soa.esb.actions.ContentBasedWiretap"
value="ESBPreActionContentBasedRouter"/>
<PAIR name="org.jboss.soa.esb.actions.EJBProcessor"
value="ESBPreActionEJBProcessor"/>
+ <PAIR name="org.jboss.soa.esb.actions.MessageFilter"
value="ESBPreActionContentBasedRouter"/>
<PAIR name="org.jboss.soa.esb.actions.MessagePersister"
value="ESBPreActionMessagePersister"/>
<PAIR name="org.jboss.soa.esb.actions.Notifier"
value="ESBPreActionNotifier"/>
<PAIR name="org.jboss.soa.esb.actions.StaticRouter"
value="ESBPreActionStaticRouter"/>
@@ -710,7 +712,12 @@
name="name" xmlname="name"/>
<XModelAttribute PROPERTIES="category=general;save=always"
default="org.jboss.soa.esb.actions.ContentBasedRouter"
name="class" xmlname="class">
- <Editor name="Uneditable"/>
+ <Constraint loader="List">
+ <value name="org.jboss.soa.esb.actions.ContentBasedRouter"/>
+ <value name="org.jboss.soa.esb.actions.ContentBasedWiretap"/>
+ <value name="org.jboss.soa.esb.actions.MessageFilter"/>
+ </Constraint>
+ <Editor name="List"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="pre=true;category=general"
name="cbr alias" xmlname="cbrAlias">
@@ -741,6 +748,24 @@
<Editor name="TreeChooser"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="pre=true;category=general"
+ name="rule agent properties" xmlname="ruleAgentProperties">
+ <Constraint loader="Tree">
+ <value name="ESBResourceTree"/>
+ <value name="extensions=properties"/>
+ <value name="linkAction=OpenRuleAgent"/>
+ </Constraint>
+ <Editor name="TreeChooser"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="pre=true;category=general"
+ name="decision table" xmlname="decisionTable">
+ <Constraint loader="Tree">
+ <value name="ESBResourceTree"/>
+ <value name="extensions=xls"/>
+ <value name="linkAction=OpenDecisionTable"/>
+ </Constraint>
+ <Editor name="TreeChooser"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="pre=true;category=general"
default="Default(false)" name="rule reload"
xmlname="ruleReload">
<Constraint loader="ListString">
<value name="Default(false)"/>
@@ -750,14 +775,76 @@
<Editor name="ListString"/>
</XModelAttribute>
<XModelAttribute PROPERTIES="pre=true;category=general"
- name="rule agent properties" xmlname="ruleAgentProperties">
+ default="Default(false)" name="stateful"
xmlname="stateful">
+ <Constraint loader="ListString">
+ <value name="Default(false)"/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="pre=true;category=advanced"
+ name="rule audit type" xmlname="ruleAuditType">
+ <Constraint loader="List">
+ <value/>
+ <value name="CONSOLE"/>
+ <value name="FILE"/>
+ <value name="THREADED_FILE"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="pre=true;category=advanced"
+ name="rule audit file" xmlname="ruleAuditFile">
<Constraint loader="Tree">
<value name="ESBResourceTree"/>
- <value name="extensions=properties"/>
- <value name="linkAction=OpenRuleAgent"/>
+ <value name="linkAction=OpenAuditFile"/>
</Constraint>
<Editor name="TreeChooser"/>
</XModelAttribute>
+ <XModelAttribute PROPERTIES="pre=true;category=advanced"
+ name="rule audit interval" xmlname="ruleAuditInterval"/>
+ <XModelAttribute PROPERTIES="pre=true;category=advanced"
+ default="Default(REALTIME)" name="rule clock type"
xmlname="ruleClockType">
+ <Constraint loader="List">
+ <value name="Default(REALTIME)"/>
+ <value name="REALTIME"/>
+ <value name="PSEUDO"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="pre=true;category=advanced"
+ default="Default(CLOUD)" name="rule event processing type"
xmlname="ruleEventProcessingType">
+ <Constraint loader="List">
+ <value name="Default(CLOUD)"/>
+ <value name="CLOUD"/>
+ <value name="STREAM"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="pre=true;category=advanced"
+ default="Default(FIRE_ALL_RULES)" name="rule fire method"
xmlname="ruleFireMethod">
+ <Constraint loader="List">
+ <value name="Default(FIRE_ALL_RULES)"/>
+ <value name="FIRE_ALL_RULES"/>
+ <value name="FIRE_UNTIL_HALT"/>
+ </Constraint>
+ <Editor name="ListString"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="pre=true;category=advanced"
+ default="Default(false)" name="rule multithread evaluation"
xmlname="ruleMultithreadEvaluation">
+ <Constraint loader="ListString">
+ <value name="Default(false)"/>
+ <value name="true"/>
+ <value name="false"/>
+ </Constraint>
+ <Editor name="List"/>
+ </XModelAttribute>
+ <XModelAttribute PROPERTIES="pre=true;category=advanced"
+ name="rule max threads" xmlname="ruleMaxThreads">
+ <Constraint loader="Int">
+ <value name="minimum=1"/>
+ </Constraint>
+ </XModelAttribute>
<XModelAttribute PROPERTIES="category=general" name="process"
xmlname="process">
<Constraint loader="ListString">
<value name="process"/>
Modified:
branches/jbosstools-3.2.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/BusinessRulesProcessor.java
===================================================================
---
branches/jbosstools-3.2.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/BusinessRulesProcessor.java 2011-03-24
23:42:54 UTC (rev 29996)
+++
branches/jbosstools-3.2.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/BusinessRulesProcessor.java 2011-03-24
23:48:04 UTC (rev 29997)
@@ -1,49 +1,16 @@
package org.jboss.tools.esb.core.model.impl;
-import org.jboss.tools.esb.core.model.ESBCustomizedObjectImpl;
+/**
+ * It seems that all ESB action classes extending ContentBasedRouter use the same set of
attributes.
+ * It means that we may not need specific implementations for the inherited actions.
+ *
+ * @author slava
+ *
+ */
-public class BusinessRulesProcessor extends ESBCustomizedObjectImpl {
+public class BusinessRulesProcessor extends ContentBasedRouter {
private static final long serialVersionUID = 1L;
- public static String ATTR_RULE_AGENT_PROPERTIES = "rule agent properties";
- public static String ATTR_DECISION_TABLE = "decision table";
- public static String ATTR_RULE_MAX_THREADS = "rule max threads";
- public static String ATTR_RULE_MULTITHREAD_EVALUATION = "rule multithread
evaluation";
- static int RULE_SET_BASED = 0;
- static int RULE_AGENT_BASED = 1;
- static int DECISION_TABLE_BASED = 2;
-
public BusinessRulesProcessor() {}
- @Override
- public boolean isAttributeEditable(String name) {
- if(ContentBasedRouter.ATTR_RULE_SET.equals(name)) {
- int kind = getKind();
- return kind < 0 || kind == RULE_SET_BASED;
- } else if(ATTR_RULE_AGENT_PROPERTIES.equals(name)) {
- int kind = getKind();
- return kind < 0 || kind == RULE_AGENT_BASED;
- } else if(ATTR_DECISION_TABLE.equals(name)) {
- int kind = getKind();
- return kind < 0 || kind == DECISION_TABLE_BASED;
- }
- if(ATTR_RULE_MAX_THREADS.equals(name)) {
- String a = getAttributeValue(ATTR_RULE_MULTITHREAD_EVALUATION);
- if("true".equals(a)) return true;
- String b = getAttributeValue(ATTR_RULE_MAX_THREADS);
- return b != null && b.length() > 0;
-
- }
- return super.isAttributeEditable(name);
- }
-
- int getKind() {
- String ruleSet = getAttributeValue(ContentBasedRouter.ATTR_RULE_SET);
- if(ruleSet != null && ruleSet.length() > 0) return RULE_SET_BASED;
- String ruleAgent = getAttributeValue(ATTR_RULE_AGENT_PROPERTIES);
- if(ruleAgent != null && ruleAgent.length() > 0) return RULE_AGENT_BASED;
- String decisionTable = getAttributeValue(ATTR_DECISION_TABLE);
- if(decisionTable != null && decisionTable.length() > 0) return
DECISION_TABLE_BASED;
- return -1;
- }
}
Modified:
branches/jbosstools-3.2.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/ContentBasedRouter.java
===================================================================
---
branches/jbosstools-3.2.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/ContentBasedRouter.java 2011-03-24
23:42:54 UTC (rev 29996)
+++
branches/jbosstools-3.2.x/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/ContentBasedRouter.java 2011-03-24
23:48:04 UTC (rev 29997)
@@ -23,6 +23,15 @@
public static String ATTR_RULE_SET = "rule set";
public static String ATTR_RULE_RELOAD = "rule reload";
+ public static String ATTR_RULE_AGENT_PROPERTIES = "rule agent properties";
+ public static String ATTR_DECISION_TABLE = "decision table";
+ public static String ATTR_RULE_MAX_THREADS = "rule max threads";
+ public static String ATTR_RULE_MULTITHREAD_EVALUATION = "rule multithread
evaluation";
+
+ static int RULE_SET_BASED = 0;
+ static int RULE_AGENT_BASED = 1;
+ static int DECISION_TABLE_BASED = 2;
+
public ContentBasedRouter() {}
@Override
@@ -38,6 +47,25 @@
return false;
}
}
+
+ if(ContentBasedRouter.ATTR_RULE_SET.equals(name)) {
+ int kind = getKind();
+ return kind < 0 || kind == RULE_SET_BASED;
+ } else if(ATTR_RULE_AGENT_PROPERTIES.equals(name)) {
+ int kind = getKind();
+ return kind < 0 || kind == RULE_AGENT_BASED;
+ } else if(ATTR_DECISION_TABLE.equals(name)) {
+ int kind = getKind();
+ return kind < 0 || kind == DECISION_TABLE_BASED;
+ }
+ if(ATTR_RULE_MAX_THREADS.equals(name)) {
+ String a = getAttributeValue(ATTR_RULE_MULTITHREAD_EVALUATION);
+ if("true".equals(a)) return true;
+ String b = getAttributeValue(ATTR_RULE_MAX_THREADS);
+ return b != null && b.length() > 0;
+
+ }
+
return super.isAttributeEditable(name);
}
@@ -59,5 +87,14 @@
}
}
+ int getKind() {
+ String ruleSet = getAttributeValue(ContentBasedRouter.ATTR_RULE_SET);
+ if(ruleSet != null && ruleSet.length() > 0) return RULE_SET_BASED;
+ String ruleAgent = getAttributeValue(ATTR_RULE_AGENT_PROPERTIES);
+ if(ruleAgent != null && ruleAgent.length() > 0) return RULE_AGENT_BASED;
+ String decisionTable = getAttributeValue(ATTR_DECISION_TABLE);
+ if(decisionTable != null && decisionTable.length() > 0) return
DECISION_TABLE_BASED;
+ return -1;
+ }
}