Author: scabanovich
Date: 2010-04-15 10:58:30 -0400 (Thu, 15 Apr 2010)
New Revision: 21498
Added:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/BusinessRulesProcessor.java
Modified:
trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml
trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta
Log:
https://jira.jboss.org/jira/browse/JBIDE-6118
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2010-04-15 14:29:02 UTC (rev
21497)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/plugin.xml 2010-04-15 14:58:30 UTC (rev
21498)
@@ -40,6 +40,8 @@
class="org.jboss.tools.esb.core.model.impl.FTPMessageFilterImpl"/>
<xclass id="org.jboss.tools.esb.core.model.impl.ContentBasedRouter"
class="org.jboss.tools.esb.core.model.impl.ContentBasedRouter"/>
+ <xclass id="org.jboss.tools.esb.core.model.impl.BusinessRulesProcessor"
+ class="org.jboss.tools.esb.core.model.impl.BusinessRulesProcessor"/>
<xclass id="org.jboss.tools.esb.core.model.handlers.AddProviderSupport"
class="org.jboss.tools.esb.core.model.handlers.AddProviderSupport"/>
Modified: trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta
===================================================================
--- trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta 2010-04-15
14:29:02 UTC (rev 21497)
+++ trunk/esb/plugins/org.jboss.tools.esb.core/resources/meta/esb-actions.meta 2010-04-15
14:58:30 UTC (rev 21498)
@@ -244,7 +244,8 @@
</XActionItem>
<XDependencies/>
</XModelEntity>
- <XModelEntity ImplementingClass="%ESB%"
+ <XModelEntity
+
ImplementingClass="org.jboss.tools.esb.core.model.impl.BusinessRulesProcessor"
PROPERTIES="formFactory=%Default%;formLayout=org.jboss.tools.esb.ui.editor.form.ESBXMLFormLayoutData;children=%EntityOrdered%"
XMLSUBPATH="action"
name="ESBPreActionBusinessRulesProcessor101">
<XChildrenEntities>
@@ -272,7 +273,7 @@
name="rule set" xmlname="ruleSet">
<Constraint loader="Tree">
<value name="ESBResourceTree"/>
- <value name="extensions=drl"/>
+ <value name="extensions=drl,dslr"/>
<value name="linkAction=OpenRuleSet"/>
</Constraint>
<Editor name="TreeChooser"/>
@@ -280,6 +281,24 @@
<XModelAttribute PROPERTIES="category=general;pre=true"
name="rule language" xmlname="ruleLanguage"/>
<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)"/>
@@ -313,6 +332,16 @@
HandlerClassName="org.jboss.tools.esb.core.model.handlers.OpenESBResourceHandler"
ICON="action.empty" PROPERTIES="actionpath=Open;attribute=rule
set"
displayName="Open Rule Set" kind="action"
name="OpenRuleSet"/>
+ <XActionItem
+
HandlerClassName="org.jboss.tools.esb.core.model.handlers.OpenESBResourceHandler"
+ ICON="action.empty"
+ PROPERTIES="actionpath=Open;attribute=decision table"
+ displayName="Open Decision Table" kind="action"
name="OpenDecisionTable"/>
+ <XActionItem
+
HandlerClassName="org.jboss.tools.esb.core.model.handlers.OpenESBResourceHandler"
+ ICON="action.empty"
+ PROPERTIES="actionpath=Open;attribute=rule agent properties"
+ displayName="Open Rule Agent Properties" kind="action"
name="OpenRuleAgent"/>
<XActionItem kind="list" name="CreateActions">
<XActionItem HandlerClassName="%Create%" ICON="action.empty"
PROPERTIES="validator.add=true" WizardClassName="%Default%"
@@ -3428,7 +3457,8 @@
<EntityData EntityName="ESBPreActionBusinessRulesProcessor101">
<AttributeData AttributeName="name"/>
<AttributeData AttributeName="process" Mandatory="no"/>
- <AttributeData AttributeName="rule set"/>
+ <AttributeData AttributeName="rule set"
Mandatory="no"/>
+ <AttributeData AttributeName="rule agent properties"
Mandatory="no"/>
</EntityData>
</XActionItem>
</XActionItem>
Added:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/BusinessRulesProcessor.java
===================================================================
---
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/BusinessRulesProcessor.java
(rev 0)
+++
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/BusinessRulesProcessor.java 2010-04-15
14:58:30 UTC (rev 21498)
@@ -0,0 +1,40 @@
+package org.jboss.tools.esb.core.model.impl;
+
+import org.jboss.tools.esb.core.model.ESBCustomizedObjectImpl;
+
+public class BusinessRulesProcessor extends ESBCustomizedObjectImpl {
+ private static final long serialVersionUID = 1L;
+ public static String ATTR_RULE_AGENT_PROPERTIES = "rule agent properties";
+ public static String ATTR_DECISION_TABLE = "decision table";
+
+ 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;
+ }
+ 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;
+ }
+}
Property changes on:
trunk/esb/plugins/org.jboss.tools.esb.core/src/org/jboss/tools/esb/core/model/impl/BusinessRulesProcessor.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain