How to ignore NDepend issue? - ndepend

What is the recommended approach to ignore a NDepend issue or rule violation? Modify the query in the NDepend config file, or is there a better approach?
Just wondering that starting to add ORs in the CQLinq query isn't maybe the nicest thing to do?

In 2018 we plan to support SuppressWarning attribute.
For now you can either modify the rule as you wrote, or also use the JustMyCode/notmycode approach to avoid issues on particular code elements.

Related

Optaplanner starting from existing result

My team has a plan to apply optaplanner to existing system.
Existing system has its own rule-sets.
it tries own rule-sets one by one and pick the one as best result.
We want to start from its result as heuristics
and start to solve the problem as meta-heuristics.
We have reviewed optaplanner manual especially in repeated planning section.
but we can't find the way.
Is there a way to accept existing system's result?
your cooperation would be highly appreciated
Best regards.
For OptaPlanner, it makes no difference where the input solution comes from. Consider the following code:
MyPlanningSolution solution = readSolution();
Solver<MyPlanningSolution> solver = SolverFactory.create(...)
.buildSolver();
solver.solve(solution);
Notice how solution comes from a custom method, readSolution(). Whether that method generates the initial solution randomly, reads it from a file, from a database etc., that does not matter to the solver. It also does not matter if it is initialized or not - construction heuristic, if configured, will just skip the initialized entities.
That means you have absolute freedom in how you create your initial solution and, to the solver, they all look the same.

enabling / disabling of rules

I am trying to come up with a mechanism in ODM to enable or disable a rule based on some input parameters like sales-zone, type of product and 6 or 7 other parameters. I don't want to put all these 7 parameters into the condition within the rule since that would reduce the reusability of the rules.
Are there any features available in ODM that can be used for this? Are there any techniques widely used in the BRMS community for such problems?
You can probably make use of rule selection using IRL at rule task level. Write a function which will determine whether the rule is effective or not for this input param. We are using this strategy. See the below screenshot.
I hope this may help you out. Happy Rule Development. :)
You could extend the extension meta data model and add a property that can be set on the rule to indicate the sales zone associated with the rule. Then on the rule task on the rule flow, use a dynamic select to include or exclude rules that have the property set.
However be aware that with lots of rules, dynamic selects can cause performance issues potentially.

Using RegeX in Adobe CQ query builder

Is there any way to use Regular expressions in Query builder.
Is JCR supports this?
Any pointers on this would be helpful for us.
Thanks in advance.
San
If this QueryBuilder API documentation where to believed as being definitive, then no I would not say there is regex support. However there does seem to be some wildcard support that may be useful. What I would do in this case is try to craft a query around all the properties that you know of about your nodes that can identify them. For example using the debug tool at http://x.x.x.x:4502/libs/cq/search/content/querydebug.html a query like may give you some ideas
type=cq:Page
path=/content/myapp
nodename=*s
1_relativedaterange.property=jcr:content/cq:lastModified
1_relativedaterange.lowerBound=-48h
Where I'm looking for pages in my app content, that end is 's', that have been modified in the last 48 hours. You can even filter by resourceType, template, and any other property that can help you find those nodes. You may even consider adding your own just for this query.
Maybe you can have a sling job, where in Java you could iterate the node names (or whatever) and you do have regex, and tag nodes with a meaningful property that you can then use to query using the query builder.

How to set duplicates at EList

I have been trying to set duplicates,Strings,at EList.
The issue that the following method bans to add duplicates:
elist.set(index, value);
I have been searching on a way that fixes that and I have found that I need to disable Uniqueness but this would may affect the rest of framework.
Any ideas would be appreciated.
Thanks.
Disable the uniqueness setting has been how I have handled this. What are the effects to the rest of the framework?

Odata orderby x-y

I'm pretty sure this isn't possible with Odata but, thought I'd ask if anyone has any ideas on how to achieve this before I go off and write a service operation.
Basically, I want to add an $orderby onto the end of an odata qry, a bit like this:
$orderby=SomeIntField-SomeOtherIntField
easy to do in SQL, not sure on how to do this with OData and WCF data services?
Edit - although I initially thought you couldn't do this, it turns out you can. See section 2.2.3.6.1.1 Common Expression Syntax of the MS-ODATA specification for syntax examples. You would need $orderby=SomeIntField sub SomeOtherIntField.