SearchProcessingService with PipeletConfiguration [message #631941] |
Sun, 10 October 2010 18:12  |
UNI-HI Stud Messages: 6 Registered: August 2010 Location: Germany |
Junior Member |
|
|
Hello, i am actually integrating Drools via some Declarative Services and SearchProcessingServices in SMILA.
But now i have some problems where i don't know how to solve them :/
1) I need an invocation-specific and non global configuration for my SearchProcessingService.
2) While (search-)processing i need to know which pipeline is used.
I need these things because i have a couple of RuleBases which had to be set as a default RuleBase for an Index or a Pipeline/Process. Furthermore it should be possible to define that my Service should not use the default RuleBase (invocation-specific).
Here some examples of what i want to do:
The "default" Mapping (conceptional):
<PipeletConfiguration [...]>
<Property name="Pipeline1DefaultRuleBase">
<Value>rulebase1</Value>
</Property>
<Property name="Pipeline2DefaultRuleBase">
<Value>rulebase2</Value>
</Property>
</PipeletConfiguration>
BPEL-Search-Pipeline (Pipeline1):
<!-- Use default RuleBase: rulebase1 -->
<extensionActivity name="invokeServiceDroolsFireRules">
<proc:invokeService>
<proc:service name="droolsFireRulesService" />
<proc:variables input="request" output="request" />
</proc:invokeService>
</extensionActivity>
<!-- Use invocation-specific RuleBase: rulebase3 -->
<extensionActivity name="invokeServiceDroolsFireRules">
<proc:invokeService>
<proc:service name="droolsFireRulesService" />
<proc:variables input="request" output="request" />
<proc:PipeletConfiguration>
<proc:Property name="USE_THIS_RULEBASE">
<proc:Value>rulebase3</proc:Value>
</proc:Property>
</proc:PipeletConfiguration>
</proc:invokeService>
</extensionActivity>
<!-- Use default RuleBase: rulebase1 -->
<extensionActivity name="invokeServiceDroolsFireRules">
<proc:invokeService>
<proc:service name="droolsFireRulesService" />
<proc:variables input="request" output="request" />
</proc:invokeService>
</extensionActivity>
Use of the "default" and "invocation-specific" Mappings (conceptional):
if(pipeletConfiguration.getPropertityFirstValue("USE_THIS_RULEBASE") != null){
useRuleBase(pipeletConfiguration.getPropertyFirstValue("USE_THIS_RULEBASE"));
} else {
useRuleBase(mappingConfiguration.getPropertyFirstValue(actualPipeline+"DefaultRuleBase"));
}
kind regards,
UNI-HI Stud
--> Please excuse my poor English
[Updated on: Sun, 10 October 2010 18:16] Report message to a moderator
|
|
|
| Re: SearchProcessingService with PipeletConfiguration [message #632445 is a reply to message #631941] |
Tue, 12 October 2010 20:34   |
UNI-HI Stud Messages: 6 Registered: August 2010 Location: Germany |
Junior Member |
|
|
While some further work i have decided to switch from SearchProcessingServices to Pipelets, because with this approach the user can make invocation- and process-specific Configuration. The Pipelets are using in turn the DeclarativeServices (before SearchProcessingServices) to get some global instances and configurations. But for some reasons I still want to use SearchProcessingServices for some kinds of work. After looking up the functionality of the blackboard service I have stumbled about the GlobalNotes. I think the GlobalNotes would solve some communication-problems between the Pipelets and SearchProcessingServices.
But nevertheless I don't understand why ProcessingServices can't be configured like it's possible with Pipelets. I don't mean Configuration which has to be set at instantiation time, I mean Configurations while processing → A simple attribute/value configuration option.
One example of what I mean:
example.bpel:
<extensionActivity name="invokeLuceneSearchService">
<proc:invokeService>
<proc:service name="LuceneSearchService" />
<proc:variables input="request" output="request" />
<proc:setProperties>
<prop: n="actual_pipeline">testPipeline</prop:prop>
<prop: n="in_which_line_was_i_invoked">100</prop:prop>
</proc:setProperties>
</proc:invokeService>
</extensionActivity>
(Search)ProcessingService:
public SearchMessage process(Blackboard blackboard, SearchMessage message, Properties configprops) throws ProcessingException {
configprops.getProperty("actual_pipeline");
configprops.getProperty("in_which_line_was_i_invoked");
return null;
}
UNI-HI Stud
[Updated on: Tue, 12 October 2010 20:38] Report message to a moderator
|
|
|
|
| Re: SearchProcessingService with PipeletConfiguration [message #632974 is a reply to message #631941] |
Thu, 14 October 2010 16:54   |
UNI-HI Stud Messages: 6 Registered: August 2010 Location: Germany |
Junior Member |
|
|
Hmm, after reading up my posts i would say that i have described that what i mean a little bit wrong. Nevertheless you are absolutly right and i have found one problem of the way i was thinking. --> Thanks for that and your reply at all!
But: Setting Annotations is a little bit "complicated" (umständlich) when i just want to make generell configurations (for the Proc.Service) which has nothing to do with the Records.
| Quote: | I don't mean Configuration which has to be set at instantiation time, I mean Configurations while processing → A simple attribute/value configuration option.
|
"processing" was wrong discribed, i'm sorry :/ I mean somethin like that:
I have -lets say- 10 RuleBases who are instantiated when my Proc.Service/DeclarativeService is activated. My Problem is now: i don't know which RuleBase the consumer wants to use in the actual processing Pipeline. Yes, i could globaly configure my DeclarativeService so that he always has to use RuleBase1 when Pipeline1 is processing, but thats not what i want! I will, that in one Pipeline more than one RuleBase can be used.
I just need a "static" Properties-instance which is allways send to the process-Method when the Proc.Service is invoked.
| Quote: | public SearchMessage process(Blackboard blackboard, SearchMessage message, Properties configprops) throws ProcessingException {
configprops.getProperty("actual_pipeline");
configprops.getProperty("in_which_line_was_i_invoked");
return null;
}
|
Actually it's allready possible by using Pipelets which set GlobalNotes:
1.1) invokePipelet (ConfigPropertie: _useRulebase = "now use RuleBase1")
1.2) set GlobalNote in processing Method of the Pipelet:
blackbaord.setGlobalNote("rulebase",_useRulebase)
2.1) invokeService
2.2) get GlobalNote in processing Method of the Proc.Service:
String use_rb = blackbaord.getGlobalNote("rulebase")
if(use_rb == "now use RuleBase1"){
useRuleBase(1);
} else if (use_rb == "now use RuleBase2"){
useRuleBase(2);
} else ....
3.1) invokePipelet (ConfigPropertie: _useRulebase = "now use RuleBase96")
3.2) set GlobalNote in processing Method of the Pipelet:
blackbaord.setGlobalNote("rulebase",_useRulebase)
4.1) invokeService
4.2) get GlobalNote in processing Method of the Proc.Service:
String use_rb = blackbaord.getGlobalNote("rulebase")
if(use_rb == "now use RuleBase1"){
useRuleBase(1);
} else if (use_rb == "now use RuleBase2"){
useRuleBase(2);
} else ....
So from my point of view, this ping pong game between senseless Pipelet invocations and Proc.Service invocations can't be the only possibility for my Problem! And adding to each record an annotation is also senseless for this (my opinion).
---> Actually i simply let the DelarativeServices running in Background (outside of SMILA) and the Pipelets include the logic and reffer to memory-intensive instances (e.g. a KnowledgeBase/RuleBase)
Prost,
UNI-HI Stud
[Updated on: Thu, 14 October 2010 17:01] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.01747 seconds