Re: [rules-users] setting different value in consequence ( RHS part) based on a conditional check

2012-01-26 Thread Michael Anstis
I am afraid you can't do it using one of the UI components:
https://issues.jboss.org/browse/GUVNOR-1435

You should however be able to add a free-form DRL section and type the
consequence in.

On 26 January 2012 20:41, vadlam  wrote:

> I tried to use the function in a BRL editor in Guvnor.
>
> In the consequence part how do I correctly call the function?
>
> when I enter it as
>
> yn( $status)  in the text box for that field in the BRL editor, it takes it
> as a string and thus tries to read the whole as a string. when I click on
> view source for the BRL rule, it shows it as
>
> fact0.setField1(  "yn( $status)"  );
>
> instead of
>
> fact0.setField1(  yn( $status)  );
>
> How do I correctly specify the function in the BRL text editor for the
> field
> value ?
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/setting-different-value-in-consequence-RHS-part-based-on-a-conditional-check-tp3690826p3691544.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] setting different value in consequence ( RHS part) based on a conditional check

2012-01-26 Thread vadlam
I tried to use the function in a BRL editor in Guvnor. 

In the consequence part how do I correctly call the function?

when I enter it as 

yn( $status)  in the text box for that field in the BRL editor, it takes it
as a string and thus tries to read the whole as a string. when I click on
view source for the BRL rule, it shows it as 

fact0.setField1(  "yn( $status)"  ); 

instead of 

fact0.setField1(  yn( $status)  );

How do I correctly specify the function in the BRL text editor for the field 
value ?

--
View this message in context: 
http://drools.46999.n3.nabble.com/setting-different-value-in-consequence-RHS-part-based-on-a-conditional-check-tp3690826p3691544.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] bytecode representation of rules

2012-01-26 Thread Mainul Raju
 


Hello All:

I have been trying to get the byte code representation of rules (.drl files). I 
would appreciate it if anyone could kindly provide me any way to do that.
 
I have created a rule based application with 100 rules in 5 different .drl 
files. My intention is to analyze the application with some byte code analyzer 
(i.e. soot). For the purpose of hat static analysis, I need the byte-code 
representation of rules which I can't get from drools.

Thanks in advance.
//
Mainul
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] setting different value in consequence ( RHS part) based on a conditional check

2012-01-26 Thread Wolfgang Laun
Oh my, aren't we a wee bit too dogmatic? I've certainly been known as being
a stickler to style and best practice and what not, but in this particular
case I'd use a single rule and offload the earth-shaking decision between
'Y' and 'N' into a function:

rule x
when
   samplefact1( $status: status, state == "CA" )
then
   fact0.setField1(  yn( $status)  );
end

Cheers
-W


On 26 January 2012 18:25, Welsh, Armand  wrote:

> You cannot, under normal circumstances, place conditional login in the
> RHS.  This is by design.  Any conditional logic belongs in the LHS.  If you
> need to perform conditional logic in the RHS, this is usually an indicator
> that they rule is not written correctly.
>
> Now, with that said, there are times when you specifically want to put a
> decision component in the RHS.  I would do this using a function.
>
> In your case, it really would make sense to use two rules, to represent
> your one case, like this:
>
>
> Rule 1
> when
>samplefact1( status == "active", state == "CA" )
>
> then
>Response fact0= new Response();
>fact0.setField1( "Y" );
>fact0.setName( "something " );
>
>insert(fact0 );
> end
>
> Rule 2
> when
>samplefact1( status != "active", state == "CA" )
>
> then
>Response fact0= new Response();
>fact0.setField1( "N" );
>fact0.setName( "something " );
>
>insert(fact0 );
> end
>
>
> These two rules are mutually exclusive, only one will fire, and you get
> the result you want.  It's really about changing the way you think about
> decision factors.  You can also achieve the same result like this:
>
>
> Rule 1
> when
>samplefact1(state == "CA" )
>
> then
>Response fact0= new Response();
> fact0.setName( "something " );
>
>insert(fact0 );
> end
>
>
> Rule 2a
> when
>samplefact1( status == "active", state == "CA" )
>$resp : Response ( field1 != "Y")
>
> Then
>modify( $resp ) { setField1( "Y" )  };end
>
> Rule 2b
> when
>samplefact1( status != "active", state == "CA" )
>$resp : Response ( field1 == "Y")
> then
>modify( $resp ) { setField1( "N" )  };
> end
>
> In this scenario, you are changing from hard data mapping to an event
> oriented rule.  Rule1 creates the basic Response fact, and Rules 2a&2b
> enrich the response fact based on conditions that may arise throughout the
> processing of the rules, independent of the initial creation step.  Just
> whenever you have a response fact that is not Y, set it to Y, and of course
> the inverse rule...  This requires more processing for the rules, but in a
> large rules based system this may be more in-line with what  you really
> want.
>
> Armand
>
> -Original Message-
> From: rules-users-boun...@lists.jboss.org [mailto:
> rules-users-boun...@lists.jboss.org] On Behalf Of vadlam
> Sent: Thursday, January 26, 2012 8:11 AM
> To: rules-users@lists.jboss.org
> Subject: [rules-users] setting different value in consequence ( RHS part)
> based on a conditional check
>
> Hi,
>
> we have an existing BRL rule in Guvnor whereby we set the value of some
> fields in RHS based on some value checks in the condition part. we have
> created several of these rules already in a previous release.
>
> In the next release, we have new requirements to set the value of an
> existing field  in consequence to be of 2 different values based on a
> specific conditional evaluation. the rest of the rule remains the same.
>
> to clarify,
>
> when
>samplefact1( status== "active" , state=="CA" )
>
>then
>
>Response fact0= new Response();
>fact0.setField1( "Y" );
>fact0.setName( "something " );
>
>insert(fact0 );
>end
>
> we now have to change this to set Field1 value to Y or N based on some
> updated condition for status field.
>
>  lets say if status=="active" , Field1 has to be Y, but when status=closed,
> then Field1 has to be N
>
> Please keep in mind that the rest of the rule remains the same.
>
> is there a way to set the value of Field1 to be Y or N within the
> consequence part of same rule without having to create another rule .
>
> will the use of functions or variables be of any help in this case?
>
>
>
>
>
>
>
> --
> View this message in context:
> http://drools.46999.n3.nabble.com/setting-different-value-in-consequence-RHS-part-based-on-a-conditional-check-tp3690826p3690826.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users
>
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/li

Re: [rules-users] Drools and DOSGi

2012-01-26 Thread jjmartinez
This is the trace when I launch Apache Felix with Drools bundles
dependencies, my Drools application bundle and DOSGi bundles:

org.apache.cxf.dosgi.dsw.handlers.PojoConfigurationTypeHandler@103c29b
26-ene-2012 18:48:52
org.apache.cxf.dosgi.dsw.handlers.PojoConfigurationTypeHandler createServer
INFO: Creating a org.apache.cxf.dosgi.samples.greeter.GreeterService
endpoint from CXF PublishHook, address is http://localhost:9090/greeter
26-ene-2012 18:48:52 org.apache.cxf.dosgi.dsw.OsgiUtils readIntentMap
INFO: Could not find intent map file /OSGI-INF/cxf/intents/intent-map.xml
26-ene-2012 18:48:52 org.apache.cxf.dosgi.dsw.qos.IntentMap setIntents
INFO: Injected intents: {}
Loading Intent map from [classpath:/OSGI-INF/cxf/intents/intent-map.xml]
26-ene-2012 18:48:53 org.apache.cxf.dosgi.dsw.qos.IntentMap setIntents
INFO: Injected intents:
{addressing=org.apache.cxf.ws.policy.WSPolicyFeature@6ef
7ba, logging=org.apache.cxf.feature.LoggingFeature@149f041,
SOAP=org.apache.cxf.
binding.soap.SoapBindingConfiguration@13c53a8,
SOAP.1_1=org.apache.cxf.binding.soap.SoapBindingConfiguration@13c53a8,
SOAP.1_2=org.apache.cxf.binding.soap.SoapB
indingConfiguration@1984a9d, HTTP=PROVIDED}
application context:
org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext@29d294:
display name
[OsgiBundleXmlApplicationContext(bundle=cxf-dosgi-ri-singlebundle-distribution,
config=classpath:/OSGI-INF/cxf/intents/intent-map.xml)]; startup date [Thu
Jan 26 18:48:52 CET 2012]; root of context hierarchy
retrieved intent map: IntentMap:
{addressing=org.apache.cxf.ws.policy.WSPolicyFeature@6ef7ba,
logging=org.apache.cxf.feature.LoggingFeature@149f041,
SOAP=org.apache.cxf.binding.soap.SoapBindingConfiguration@13c53a8,
SOAP.1_1=org.apache.cxf.
binding.soap.SoapBindingConfiguration@13c53a8,
SOAP.1_2=org.apache.cxf.binding.soap.SoapBindingConfiguration@1984a9d,
HTTP=PROVIDED}
26-ene-2012 18:48:53
org.apache.cxf.dosgi.dsw.handlers.AbstractPojoConfiguration
TypeHandler processIntent
INFO: Applying intent: SOAP via binding config:
org.apache.cxf.binding.soap.Soap
BindingConfiguration@13c53a8
26-ene-2012 18:48:53 org.apache.cxf.bus.spring.SpringBusFactory
createApplicationContext
ADVERTENCIA: Initial attempt to create application context was
unsuccessful.org.springframework.beans.factory.BeanDefinitionStoreException:
Unexpected exception parsing XML document from class path resource
[META-INF/cxf/cxf.xml]; nested exception is
java.lang.IncompatibleClassChangeError: Class com.ctc.wstx.sax.Ws
txSAXParser does not implement the requested interface
org.xml.sax.Attributes
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:420)
at
org.apache.cxf.bus.spring.ControlledValidationXmlBeanDefinitionReader.doLoadBeanDefinitions(ControlledValidationXmlBeanDefinitionReader.java:109)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:342)
at
org.apache.cxf.bus.spring.ControlledValidationXmlBeanDefinitionReader.loadBeanDefinitions(ControlledValidationXmlBeanDefinitionReader.java:131)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:310)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at
org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:109)
at
org.apache.cxf.bus.spring.BusApplicationContext.loadBeanDefinitions(BusApplicationContext.java:262)
at
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:123)
at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:422)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at
org.apache.cxf.bus.spring.BusApplicationContext.(BusApplicationContext.java:91)
at
org.apache.cxf.bus.spring.SpringBusFactory.createApplicationContext(SpringBusFactory.java:102)
at
org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:93)
at
org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:86)
at
org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:64)
at
org.apache.cxf.bus.spring.SpringBusFactory.createBus(SpringBusFactory.java:53)
at org.apache.cxf.BusFactory.getDefaultBus(BusFactory.java:69)
at
org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:106)
at org.apache.cxf.BusFactory.getThreadDefaultBus(BusFactory.java:97)
at
org.apache.cxf.endpoint.AbstractEndpointFactory.getBus(AbstractEndpointFactory.java:82)
at
org.apache.cxf.frontend.Abstr

Re: [rules-users] Drools and DOSGi

2012-01-26 Thread jjmartinez
This is the correct trace, sorry 

/g! 23-ene-2012 18:23:36
org.apache.cxf.dosgi.topologymanager.TopologyManager$2 run INFO:
TopologyManager: exporting service ... 23-ene-2012 18:23:36
org.apache.cxf.dosgi.topologymanager.TopologyManager$2 run INFO:
TopologyManager: handling remoteServiceAdmin
org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance@600ee8
23-ene-2012 18:23:36 org.apache.cxf.dosgi.topologymanager.TopologyManager$2
run INFO: TopologyManager: exporting ... 23-ene-2012 18:23:36
org.apache.cxf.dosgi.dsw.OsgiUtils readIntentMap ADVERTENCIA: Intent map
load failed: org.springframework.beans.factory.BeanDefinitionStoreException:
Unexpected exception parsing XML document from OSGi
resource[classpath:/OSGI-INF/cxf/intents/intent-map.xml|bnd.id=131|bnd.sym=cxf-dosgi-ri-singlebundle-distribution];
nested exception is javax.xml.parsers.FactoryConfigurationError: Provider
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
at
org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:164)
at
org.springframework.osgi.context.support.OsgiBundleXmlApplicationContext.loadBeanDefinitions(OsgiBundleXmlApplicationContext.java:136)
at
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
at org.springframework.context.support.AbstractApplicationContext.obtain
FreshBeanFactory(AbstractApplicationContext.java:467) at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.access$301(AbstractDelegatedExecutionApplicationContext.java:69
) at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$1.run(AbstractDelegatedExecutionApplicationContext.java:186)
at
org.springframework.osgi.util.internal.PrivilegedUtils.executeWithCustomTCCL(PrivilegedUtils.java:85)
at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.normalRefresh(AbstractDelegatedExecutionApplicationContext.java
:182) at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext$NoDependenciesWaitRefreshExecutor.refresh(AbstractDelegatedExec
utionApplicationContext.java:89) at
org.springframework.osgi.context.support.AbstractDelegatedExecutionApplicationContext.refresh(AbstractDelegatedExecutionApplicationContext.java:175)
at org.apache.cxf.dosgi.dsw.OsgiUtils.readIntentMap(OsgiUtils.java:406) at
org.apache.cxf.dosgi.dsw.OsgiUtils.getIntentMap(OsgiUtils.java:376) at
org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminCore.exportService(RemoteServiceAdminCore.java:137)
at
org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance$1.run(RemoteServiceAdminInstance.java:72)
at
org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance$1.run(RemoteServiceAdminInstance.java:66)
at java.security.AccessController.doPrivileged(Native Method) at
org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance.exportService(RemoteServiceAdminInstance.java:66)
at
org.apache.cxf.dosgi.dsw.service.RemoteServiceAdminInstance.exportService(RemoteServiceAdminInstance.java:38)
at
org.apache.cxf.dosgi.topologymanager.TopologyManager$2.run(TopologyManager.java:267)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at
java.lang.Thread.run(Unknown Source) Caused by:
javax.xml.parsers.FactoryConfigurationError: Provider
org.apache.xerces.jaxp.DocumentBuilderFactoryImpl not found at
javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source) at
org.springframework.beans.factory.xml.DefaultDocumentLoader.createDocumentBuilderFactory(DefaultDocumentLoader.java:89)
at
org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:70)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
... 28 more/

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-and-DOSGi-tp3690930p3691140.html
Sent from the Drools: User forum ma

Re: [rules-users] Debug rule functions ?

2012-01-26 Thread Welsh, Armand
Personally, I never use DRL functions.  I create my functions in a java class 
module, and I import functions into drools.  I have noticed that in earlier 
versions of Drools (I don't know about recent versions), that using drl 
functions put a larger load on system than using imported external functions.  
Plus you gain the added benefit of being able to use your IDE's built-in 
debugger to step through the function logic.

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of ipeshev
Sent: Wednesday, January 25, 2012 10:17 PM
To: rules-users@lists.jboss.org
Subject: [rules-users] Debug rule functions ?

Hello,

could some give me some tips for debugging *functions* in .drl ?
by now I'm not able to debug *inside the functions* which are called by the
rule sequence.
I follow the 
http://docs.jboss.org/tools/3.0.0.GA/en/drools_tools_ref_guide/html_single/index.html#debugging_rules
JBoss Drools Tools Reference Guide  but what is show there is how to debug a
very simple *rule sequence*. I have no problem with that - following the
guide everything is ok.

BUT
There is nothing shown about a more complex case when there are functions
(java-like) in the .drl file and the rule calls one or more of these
functions. And one function calls another etc. (just like in normal
programming)
When a put a breakpoint inside functions I cannot debug them.
I can only debug the *rule* ("then" section)

Any help would be appreciated?
Or any official info if this supported at all.
versions etc.

Best Regards
Ivan



--
View this message in context: 
http://drools.46999.n3.nabble.com/Debug-rule-functions-tp3689774p3689774.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] setting different value in consequence ( RHS part) based on a conditional check

2012-01-26 Thread Welsh, Armand
You cannot, under normal circumstances, place conditional login in the RHS.  
This is by design.  Any conditional logic belongs in the LHS.  If you need to 
perform conditional logic in the RHS, this is usually an indicator that they 
rule is not written correctly. 

Now, with that said, there are times when you specifically want to put a 
decision component in the RHS.  I would do this using a function.

In your case, it really would make sense to use two rules, to represent your 
one case, like this:


Rule 1
when
samplefact1( status == "active", state == "CA" )

then
Response fact0= new Response();
fact0.setField1( "Y" );
fact0.setName( "something " );
   
insert(fact0 );
end

Rule 2
when
samplefact1( status != "active", state == "CA" )

then
Response fact0= new Response();
fact0.setField1( "N" );
fact0.setName( "something " );
   
insert(fact0 );
end


These two rules are mutually exclusive, only one will fire, and you get the 
result you want.  It's really about changing the way you think about decision 
factors.  You can also achieve the same result like this:


Rule 1
when
samplefact1(state == "CA" )

then
Response fact0= new Response();
fact0.setName( "something " );
   
insert(fact0 );
end


Rule 2a
when
samplefact1( status == "active", state == "CA" )
$resp : Response ( field1 != "Y")  

Then
modify( $resp ) { setField1( "Y" )  };end

Rule 2b
when
samplefact1( status != "active", state == "CA" )
$resp : Response ( field1 == "Y")  
then
modify( $resp ) { setField1( "N" )  };
end

In this scenario, you are changing from hard data mapping to an event oriented 
rule.  Rule1 creates the basic Response fact, and Rules 2a&2b enrich the 
response fact based on conditions that may arise throughout the processing of 
the rules, independent of the initial creation step.  Just whenever you have a 
response fact that is not Y, set it to Y, and of course the inverse rule...  
This requires more processing for the rules, but in a large rules based system 
this may be more in-line with what  you really want.

Armand

-Original Message-
From: rules-users-boun...@lists.jboss.org 
[mailto:rules-users-boun...@lists.jboss.org] On Behalf Of vadlam
Sent: Thursday, January 26, 2012 8:11 AM
To: rules-users@lists.jboss.org
Subject: [rules-users] setting different value in consequence ( RHS part) based 
on a conditional check

Hi,

we have an existing BRL rule in Guvnor whereby we set the value of some
fields in RHS based on some value checks in the condition part. we have
created several of these rules already in a previous release.

In the next release, we have new requirements to set the value of an
existing field  in consequence to be of 2 different values based on a
specific conditional evaluation. the rest of the rule remains the same.

to clarify,

when
samplefact1( status== "active" , state=="CA" )

then

Response fact0= new Response();
fact0.setField1( "Y" );
fact0.setName( "something " );
   
insert(fact0 );
end

we now have to change this to set Field1 value to Y or N based on some
updated condition for status field.

 lets say if status=="active" , Field1 has to be Y, but when status=closed,
then Field1 has to be N

Please keep in mind that the rest of the rule remains the same.

is there a way to set the value of Field1 to be Y or N within the
consequence part of same rule without having to create another rule . 

will the use of functions or variables be of any help in this case?







--
View this message in context: 
http://drools.46999.n3.nabble.com/setting-different-value-in-consequence-RHS-part-based-on-a-conditional-check-tp3690826p3690826.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools and DOSGi

2012-01-26 Thread Mauricio Salatino
I'm not seeing any error there.. so you must find in your container
what the error is..
Look at the Apache Felix container to see what is failing.
Cheers

On Thu, Jan 26, 2012 at 2:19 PM, jjmartinez  wrote:
> When I test a bundle with a service in Apache Felix and try to export this
> service with DOSGi, all run ok and I can get the wsdl file from a navigator.
> But when I start my Drools Bundle with a simple service, DOSGi show some
> errors (refers to XML) and I don't achieve the wsdl file.
>
> The traces emitted when my bundle starts are these:
>
> /g! start 739
> Start bundle!!
> Export Service from Activator Class
> Run OK!
> 25-ene-2012 14:41:26
> org.apache.cxf.dosgi.topologymanager.ServiceListenerImpl serviceChanged
> INFO: calling TopologyManager -> registered service
> 25-ene-2012 14:41:26 org.apache.cxf.dosgi.topologymanager.TopologyManager
> export Service
> INFO: TopologyManager: adding service to exportedServices list to export it
> --- from bundle:  MyServiceImpl
> 25-ene-2012 14:41:26 org.apache.cxf.dosgi.topologymanager.TopologyManager$2
> run
> INFO: TopologyManager: exporting  serice ...
> 25-ene-2012 14:41:26
> org.apache.cxf.dosgi.topologymanager.ServiceListenerImpl serviceChanged
> INFO: calling TopologyManager -> registered service
> 25-ene-2012 14:41:26 org.apache.cxf.dosgi.topologymanager.TopologyManager
> export Service
> INFO: TopologyManager: adding service to exportedServices list to export it
> --- from bundle:  MyServiceImpl
> 25-ene-2012 14:41:26 org.apache.cxf.dosgi.topologymanager.TopologyManager$2
> run
> INFO: TopologyManager: exporting  serice ...
> g!/
>
> And DOSGi not publish my service :(
>
> --
> View this message in context: 
> http://drools.46999.n3.nabble.com/Drools-and-DOSGi-tp3690930p3691030.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users



-- 
 - CTO @ http://www.plugtree.com
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

 - Salatino "Salaboy" Mauricio -

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools and DOSGi

2012-01-26 Thread jjmartinez
When I test a bundle with a service in Apache Felix and try to export this
service with DOSGi, all run ok and I can get the wsdl file from a navigator.
But when I start my Drools Bundle with a simple service, DOSGi show some
errors (refers to XML) and I don't achieve the wsdl file.

The traces emitted when my bundle starts are these:

/g! start 739
Start bundle!!
Export Service from Activator Class
Run OK!
25-ene-2012 14:41:26
org.apache.cxf.dosgi.topologymanager.ServiceListenerImpl serviceChanged
INFO: calling TopologyManager -> registered service
25-ene-2012 14:41:26 org.apache.cxf.dosgi.topologymanager.TopologyManager
export Service
INFO: TopologyManager: adding service to exportedServices list to export it
--- from bundle:  MyServiceImpl
25-ene-2012 14:41:26 org.apache.cxf.dosgi.topologymanager.TopologyManager$2
run
INFO: TopologyManager: exporting  serice ...
25-ene-2012 14:41:26
org.apache.cxf.dosgi.topologymanager.ServiceListenerImpl serviceChanged
INFO: calling TopologyManager -> registered service
25-ene-2012 14:41:26 org.apache.cxf.dosgi.topologymanager.TopologyManager
export Service
INFO: TopologyManager: adding service to exportedServices list to export it
--- from bundle:  MyServiceImpl
25-ene-2012 14:41:26 org.apache.cxf.dosgi.topologymanager.TopologyManager$2
run
INFO: TopologyManager: exporting  serice ...
g!/

And DOSGi not publish my service :(

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-and-DOSGi-tp3690930p3691030.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Drools and DOSGi

2012-01-26 Thread Salaboy
What do you mean with incompatible?
Are you getting any error? 

- CTO @ http://www.plugtree.com
- MyJourney @ http://salaboy.wordpress.com
- Co-Founder @ http://www.jbug.com.ar
- Mauricio "Salaboy" Salatino -

On 26/01/2012, at 13:50, jjmartinez  wrote:

> Hello all
> 
> Anyone know if Drools bundles libraries are incompatibles with Apache CXF
> Distributed OSGi?
> 
> Thanks in advance, Jesus
> 
> --
> View this message in context: 
> http://drools.46999.n3.nabble.com/Drools-and-DOSGi-tp3690930p3690930.html
> Sent from the Drools: User forum mailing list archive at Nabble.com.
> ___
> rules-users mailing list
> rules-users@lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/rules-users

___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Drools and DOSGi

2012-01-26 Thread jjmartinez
Hello all

Anyone know if Drools bundles libraries are incompatibles with Apache CXF
Distributed OSGi?

Thanks in advance, Jesus

--
View this message in context: 
http://drools.46999.n3.nabble.com/Drools-and-DOSGi-tp3690930p3690930.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] setting different value in consequence ( RHS part) based on a conditional check

2012-01-26 Thread vadlam
Hi,

we have an existing BRL rule in Guvnor whereby we set the value of some
fields in RHS based on some value checks in the condition part. we have
created several of these rules already in a previous release.

In the next release, we have new requirements to set the value of an
existing field  in consequence to be of 2 different values based on a
specific conditional evaluation. the rest of the rule remains the same.

to clarify,

when
samplefact1( status== "active" , state=="CA" )

then

Response fact0= new Response();
fact0.setField1( "Y" );
fact0.setName( "something " );
   
insert(fact0 );
end

we now have to change this to set Field1 value to Y or N based on some
updated condition for status field.

 lets say if status=="active" , Field1 has to be Y, but when status=closed,
then Field1 has to be N

Please keep in mind that the rest of the rule remains the same.

is there a way to set the value of Field1 to be Y or N within the
consequence part of same rule without having to create another rule . 

will the use of functions or variables be of any help in this case?







--
View this message in context: 
http://drools.46999.n3.nabble.com/setting-different-value-in-consequence-RHS-part-based-on-a-conditional-check-tp3690826p3690826.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users