continuous integration of rule assets via jenkins to guvnor?
by Cedric Hurst
I'd like to get a quick sanity check on best practices...
I'm working on a project where, by policy, all assets (including drl's, bpmn
files, etc) must be built, tested and packaged by a Jenkins server. Rule
assets are structured within a project that also includes non-rule assets.
As is quite common, the primary system of record for these assets is an SCM
like svn or git, and that's what our Jenkins box talks to.
However, for the rule stuff specifically, we're also using Guvnor's
drools-repository to package the assets into a knowledge base, which is
referenced jBPM's process engine in the runtime. The plan is to have
several Guvnor environments running with parity to development, QA, UAT and
production setups. However, we're having a very hard time figuring out how
best to sync our rule assets to these various repositories as part of an
automated release.
To the best of my understanding, rule assets are deployed to a Guvnor
instance file-by-file via WebDAV. One can also upload JARs for POJOs, but
DRLs, BPMN, DSL files need to be synced individually. Is this the case?
And, if so, how do other groups handle continuous integration and deployment
of assets coming from external SCMs?
Btw, I came across aware of a Maven plugin which seems to do this sort of
piece-by-piece deployment:
https://github.com/awaterma/drools-guvnor-plugin
So we could certainly port this sort of functionality to our own build
toolchain, but it seems like a lot of work so I'm hoping for a better way.
--
View this message in context: http://drools.46999.n3.nabble.com/continuous-integration-of-rule-assets-v...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 1 month
Drools Clips
by Grant Rettke
Hi,
Anyone using or have used Drools Clips before? If so, what is your
opinion of it? If not, why not?
I'm pretty curious about it and wanted to start here before pinging
the dev list on who is maintaining it (nor not).
Best wishes,
--
Grant Rettke | ACM, AMA, COG, IEEE
grettke(a)acm.org | http://www.wisdomandwonder.com/
Wisdom begins in wonder.
((λ (x) (x x)) (λ (x) (x x)))
13 years, 1 month
Is it posibble to keep two date formats in drools like 'dd-MMM-yyyy' and 'dd-MMM-yyyy HH:mm'
by richie
Hi,
The default date format in drools is 'dd-MMM-yyyy', but in the definition of
rule attribute date-effective, it says it contain a date and time
definition, so if I set date-effective to "30-Jan-2013 08:00", then the time
set in date-effective will be ignored, so I changed the date format to
'dd-MMM-yyyy HH:mm', now the effective date works correctly, but then we got
problem here, if user input a date like "30-Jan-2013" the drools will failed
to execute, so must force user to input a date like this "30-Jan-2013
00:00", this is not user friendly and the string "00:00" is meaningless.
What I want to know is, if it's possible to keep this two formats both?
Thanks.
--
View this message in context: http://drools.46999.n3.nabble.com/Is-it-posibble-to-keep-two-date-formats...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 1 month
Non short circuit ANDing
by mp
Hi,
I need to use non-short circuit ANDing (&) for my rules.
However, for a rules like (conditionA & conditionB) I get the following
error:
"Predicate 'conditionA & conditionB' must be a Boolean expression"
(conditionA && conditionB) works fine. But it short circuits the conditions.
Any ideas as to what I could be doing wrong or how I can ensure that
condition2 is evaluated irrespective of whether condition1 is true or false?
Thanks.
--
View this message in context: http://drools.46999.n3.nabble.com/Non-short-circuit-ANDing-tp4021928.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 1 month
ClassCastException and "from collect" keyword issue?
by Tan, Kevin
Hi rules users,
I am having a problem with Drools 5.1.1 recently. The exception we had is:
java.lang.ClassCastException:
d2.rules.state.EvaluateRule cannot be cast to d2.autorating.data.model.Account
org.drools.runtime.rule.ConsequenceException: rule: DERIVE_COLLAT_MECHANISM_PLEDGE
Our rules are listed as below:
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
rule "DERIVE_COLLAT_MECHANISM_PLEDGE"
no-loop true
salience 19991
when
$RatingData : RatingRuleFact()
$contract : Contract()
$csaDoc : Document(documentId == $contract.csaId && status == "Final/Signed")
(EvaluateRule(ruleName == "INSCOPE))
then
RuleProcessingOutput ruleOutput = $RatingData.getRuleOutput();
RuleResult result = new RuleResult(drools.getRule().getName(), $contract.getContractId(), $RatingData.getPrincipalPartyCountry());
ruleOutput.addRuleResult(result);
$contract.setCollateralMechanism(result.getRuleOutputText());
insertLogical(new EvaluateRule(drools.getRule().getName()));
end
rule "EXC_COLLAT_HOLDING_ARRANGEMENT"
no-loop true
salience 19985
when
$RatingData : RatingRuleFact()
$contract : Contract()
$noHoldingAgreementAccts : ArrayList()
from collect ( Account(collatNetId == $contract.contractId,
businessUnit not in ("COMM", "FID", "FX", "IED", "SECLENDING", "SWAPS")) from $contract.collatAccounts
)
EvaluateRule(ruleName == "INSCOPE")
then
RuleProcessingOutput ruleOutput = $RatingData.getRuleOutput();
for (Object obj : $noHoldingAgreementAccts) {
Account acct = (Account) obj;
if (acct.getDp2Account() != null) {
RuleResult result = new RuleResult(drools.getRule().getName(), $contract.getContractId(), $RatingData.getPrincipalPartyCountry());
result.setAccountId(acct.getDp2Account().getAccountId());
result.setRuleOutputText("BU has no Data");
ruleOutput.addRuleResult(result);
}
}
if ($noHoldingAgreementAccts.size() > 0) {
insertLogical(new EvaluateRule(drools.getRule().getName()));
}
end
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
* In object Account(), we did not have any EvaluateRule() object in it.
* We also noticed after the "from collect" key word there are EvaluateRule() object defined after it(but the purpose is just to determine if this object exist or not in the Working Memory), in the LHS of each rule file.
* In the variable $noHoldingAgreementAccts, we are not supposed to see the object - EvaluateRule (BUT the exception is showing it is trying to cast EvaluateRule into Account)
My question is are there any known problems/issues with the following
- Drools rule compilers
- Key word from collect
- Rules production memory
- Version 5.1.1
that can make this happen? Any ideas will be appreciated. Thanks.
Kevin Tan
Morgan Stanley | Enterprise Data & Services
700 Rue Wellington | Floor 04
Montreal, QC H3C 3S4
Phone: +1 514 876-5756
Kevin.Tan(a)morganstanley.com<mailto:Thanh.Dang@morganstanley.com>
________________________________
NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers If you cannot access these links, please notify us by reply message and we will send the contents to you. By messaging with Morgan Stanley you consent to the foregoing.
13 years, 1 month
User specific packages for Guvnor
by riri
Hello everyone,
I am interested in working with Guvnor and would like to know if rule
packages can be user specific. For example I would need to have each user be
able to have his own rules to work on and have only these ones available the
next time he logs in. I think that would be the same as having a separate
knowledge base per user but I am not exactly sure what settings should be
configured so that the user only has access to his knowledge base.
Afterwards I need to recover the user specific packages separately using the
knowledge agent.
Has anyone ever used Guvnor in a similar manner? I am just starting with it
and would appreciate some input from more experienced users.
Best regards
--
View this message in context: http://drools.46999.n3.nabble.com/User-specific-packages-for-Guvnor-tp402...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 1 month
Evaluator 'matches' does not support type 'ValueType = 'Object'
by CAK
Hello forum,
we currently encounter the following problem on Drools 5.1.1:
Evaluator 'matches' does not support type 'ValueType = 'Object' for the
following rule:
rule "Create_License"
when
StringCapability(name=="service", value=="service_v1")
StringCapability(name=="data.modelCode", value matches "^5G1.*")
then
License license = new License();
license.setDuration("30 years");
license.setName("30Years");
license.setState(State.NOTACTIVATED);
license.setType(Type.IMPLICIT);
license.setWarn(false);
insert(license);
end
StringCapability derives from a generic class and is defined as follows:
public class StringCapability extends Capability <String>
{
public StringCapability(String name, String value)
{
super(name, value);
}
}
whereas the superclass looks like this
public abstract class Capability<T>
{
private final String name;
private final T value;
protected Capability(String name, T value)
{
this.name = name;
this.value = value;
}
@Override
public boolean equals(Object object)
{
if (this == object)
{
return true;
}
if (object == null)
{
return false;
}
if (getClass() != object.getClass())
{
return false;
}
Capability <?> other = (Capability <?>) object;
if (name == null)
{
if (other.name != null)
{
return false;
}
}
else if (!name.equals(other.name))
{
return false;
}
if (value == null)
{
if (other.value != null)
{
return false;
}
}
else if (!value.equals(other.value))
{
return false;
}
return true;
}
public String getName()
{
return name;
}
public T getValue()
{
return value;
}
@Override
public int hashCode()
{
final int prime = 31;
int result = 1;
result = prime * result + getClass().hashCode();
result = prime * result + ((name == null) ? 0 : name.hashCode());
result = prime * result + ((value == null) ? 0 : value.hashCode());
return result;
}
@Override
public String toString()
{
return new StringBuilder(getClass().getSimpleName()).append(" -
name:").append(name).append(", value:")
.append(String.valueOf(value)).toString();
}
The problem occurs when the rule is supposed to be compiled on
initialization of the knowledge base. So from my point of view, the value
returned by class StringCapability is of type String. Why do I get this
error? How can I workaround this problem without any code change (I just can
provide another rule file)
Any help appreciated!
Thank you,
CAK
--
View this message in context: http://drools.46999.n3.nabble.com/Evaluator-matches-does-not-support-type...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 1 month
XStreamAlias
by André Fróes
What is this @XStreamAlias(...) that i see in mostly of example pojos? I
did my pojos without it and worked the same way. Is it for performance?
13 years, 1 month
Confusion with using predicates in spreadsheets
by starfish15
Hello,
In Drools 5.2, Web Guided DTs, i have worked with calculation types as
*Predicate*. How can the same be used in a spreadsheet DT.
Just to give an idea, i need to compare values in 2 facts. So in the DT,
Condition was written as factA.attrib1 == factB.attrib1, Bt i am stuck as to
what should be written in the value for this condition.
In Web Guided DTs, this cud be done using predicates, where neither the
field nor the operator was required. Simply when penning down this condition
in the table we wrote the value as, factA.attrib1 == factB.attrib1
And that solved the condition thing, however am not sure how this should be
written in spread sheets
Kindly help with usual spread sheets how can this be handled.
Regards,
starfish
--
View this message in context: http://drools.46999.n3.nabble.com/Confusion-with-using-predicates-in-spre...
Sent from the Drools: User forum mailing list archive at Nabble.com.
13 years, 1 month
Drools rule [Planner]
by André Fróes
Is there a way to debug my project monitoring if it passes by my rule?
In my console i don't see the score of hard constraint of this rule:
----
rule "requiredWorktimeToFinish"
when
$engineer : Engineer($worktime : worktime)
$requiredWorktimeTotal : Number(intValue < $worktime) from accumulate(
WorkOrder (
engineer == $engineer,
$requiredWorktime : requiredWorktime),
sum($requiredWorktime)
)
then
insertLogical(new IntConstraintOccurrence("requiredWorktimeToFinish",
ConstraintType.NEGATIVE_HARD,
$requiredWorktimeTotal.intValue() - $worktime,
$engineer));
end
rule "hardConstraintsBroken"
salience -1
when
$hardTotal : Number() from accumulate(
IntConstraintOccurrence(constraintType ==
ConstraintType.NEGATIVE_HARD, $weight : weight),
sum($weight)
)
then
scoreHolder.setHardConstraintsBroken($hardTotal.intValue());
end
----
in my console it points no score
----
17:02:49.009 [main] INFO o.d.p.core.solver.DefaultSolver - Solving
started: time spend (127), score (null), new best score (null), random seed
(0).
17:02:49.041 [main] DEBUG o.d.p.c.c.g.DefaultGreedyFitSolverPhase -
Step index (0), time spend (164), score (0hard/0soft), initialized planning
entity ([WorkOrder-7]).
17:02:49.042 [main] DEBUG o.d.p.c.c.g.DefaultGreedyFitSolverPhase -
Step index (1), time spend (165), score (0hard/0soft), initialized planning
entity ([WorkOrder-9]).
17:02:49.043 [main] DEBUG o.d.p.c.c.g.DefaultGreedyFitSolverPhase -
Step index (2), time spend (166), score (0hard/0soft), initialized planning
entity ([WorkOrder-8]).
17:02:49.045 [main] DEBUG o.d.p.c.c.g.DefaultGreedyFitSolverPhase -
Step index (3), time spend (168), score (0hard/0soft), initialized planning
entity ([WorkOrder-6]).
17:02:49.045 [main] INFO o.d.p.c.c.g.DefaultGreedyFitSolverPhase - Phase
constructionHeuristic ended: step total (4), time spend (168), best score
(0hard/0soft).
17:02:49.274 [main] DEBUG o.d.p.c.l.DefaultLocalSearchSolverPhase -
Step index (0), time spend (397), score (0hard/0soft), best score
(0hard/0soft), accepted/selected move count (1000/1000) for picked step
([WorkOrder-7] => [Engineer-5]).
17:02:49.592 [main] DEBUG o.d.p.c.l.DefaultLocalSearchSolverPhase -
Step index (1), time spend (715), score (0hard/0soft), best score
(0hard/0soft), accepted/selected move count (1000/1926) for picked step
([WorkOrder-8] => [Engineer-3]).
17:02:50.045 [main] DEBUG o.d.p.c.l.DefaultLocalSearchSolverPhase -
Step index (2), time spend (1168), score (0hard/0soft), best score
(0hard/0soft), accepted/selected move count (1000/3686) for picked step
([WorkOrder-6] => [Engineer-2]).
17:02:50.464 [main] DEBUG o.d.p.c.l.DefaultLocalSearchSolverPhase -
Step index (3), time spend (1587), score (0hard/0soft), best score
(0hard/0soft), accepted/selected move count (1000/7516) for picked step
([WorkOrder-9] => [Engineer-2]).
17:02:53.877 [main] DEBUG o.d.p.c.l.DefaultLocalSearchSolverPhase -
Step index (4), time spend (5000), score (0hard/0soft), best score
(0hard/0soft), accepted/selected move count (0/350227) for picked step
([WorkOrder-7] => [Engineer-4]).
17:02:53.877 [main] INFO o.d.p.c.l.DefaultLocalSearchSolverPhase - Phase
localSearch ended: step total (5), time spend (5000), best score
(0hard/0soft).
17:02:53.878 [main] INFO o.d.p.core.solver.DefaultSolver - Solving ended:
time spend (5000), best score (0hard/0soft), average calculate count per
second (72872).
13 years, 1 month