How to implement move filter on Construction Heuristic (like local search) - scheduling

How can I create and import a move filter on construction heuristics?
Solution
optaplanner at configuration may show some errors when you try to add and on configuration. It is possible to need one more tag or something else, but for something was missing or was doing it totaly wrong.. I finaly managed to add my filter by creating customfilter class whis implements SelectionFilter and add to the annotation of the entity class. Find in the documentation the SelectionFilter class.##

<constructionHeuristic>
<constructionHeuristicType>FIRST_FIT_DECREASING</constructionHeuristicType>
<changeMoveSelector>
<filterClass>...</filterClass>
</changeMoveSelector>
</constructionHeuristic>

Related

Camunda custom candidate task property

I am new in Camunda.
Could you please tell me whether it is possible to add custom property 'camunda:candidateUsersReadOnly' something like:
<bpmn:userTask id="Task_1eqdx5t" name="task name" camunda:candidateUsers="IC754VBA08D5UC93XE,IC754VBA08D5UC93ZC" camunda:candidateUsersReadOnly="IC754VBA08D5UC93XE,IC754VBA08D5UC93ZC">
and then call getTaskService().getIdentityLinksForTask(taskId) to get ids defined in 'camunda:candidateUsersReadOnly' ?
Thanks!
Pretty sure you can't use a custom camunda: namespace attribute. But maybe you could achieve your goal by using extension elements.
You can add them on the "extension" tab of the properties panel in the modeler.
See Extension Elements for documentation and samples.

Example of how to do TODO Filtering in Webstorm

So I am trying to figure out how to filter my TODO list as when I look at it now it has 527 most of which are in my included libraries. I looked at this link but really felt I needed an example.
I would like to be able to put in my code something like this:
//TODO name
Then when I bring up the TODO tab be able to see just those one.
Found an example in the documentation.
basically I need to create a pattern:
\btodo name\b.*
Then create a filter and choose that pattern.

How to get the full name of a Sitecore DMS rule?

I'm using Sitecore. I want to get the full name/description of a DMS rule in programcode by Sitecore ID, for example: "Where the DayOfWeek has a value that is equal to Tuesday".
Who knows how to do this?
Thanks a lot.
Jordy
I don't know of a simple way, but the class responsible for rendering the rule text is Sitecore.Shell.Applications.Rules.RulesRenderer in Sitecore.Client.dll.
Its constructor accepts the XML from a rules field and you call the Render method, passing in a prepared HtmlTexteWriter. It also has a bunch of fairly self-explanatory private methods like RenderRule, RenderCondition etc.
I'm sure if you decompile that class you can pick out the bits you need.

Can a Custom DataProvider class expose Custom Templates?

I am currently in the process of writing a custom DataProvider. Using the Intergrate External Data documentation.
I've managed to show the external data in the Sitecore back end. However whenever I try to view the data in the items I created, I am getting an error
Null ids are not allowed. <br> Parameter name: displayName
There seems to be precious little on the subject on how to create a custom DataProvider on the Sitecore Developer Network.
The example on their website seems to only show how to import a SINGLE item into a static database. However I am simply trying to merge some items into the hierarchy and I can't find any useful documentation.
It seems that one of your methods that should return an ID doesn't. It might be GetChildIds and/or GetParentId.
Nick Wesselman wrote a good article about it gathering all the information including an example on the Marketplace. I think that is your best start. You can read it here.
Turns out I needed to include at the very least, the Fields->Section->Template in the GetParent method. To be on the safe side I included the Fields/Sections/Templates into my implementations of
GetChildIDs
GetItemDefinition
GetParentID
It wasn't obvious that this was the case, since I had in fact implemented the GetTemplates method correctly, and I had expected that should be enough.

How change "MediaLinkPrefix" Programmatically in sitecore?

I know "MediaLinkPrefix" can be changed in web.config. But is it possible to change "MediaLinkPrefix" Programmatically? Thanks!
To answer your specific question. No. You cannot programmatically change the value of that setting.
If you are trying to use Sitecore.Resources.Media.MediaManager.GetMediaUrl(mediaItem) to get the URL of a MediaItem then that is leveraging the Sitecore.Resources.Media.MediaProvider, which pulls the value of the MediaLinkPrefixfrom the Sitecore.Resources.Media.MediaConfig class. That property does not have a 'setter'. Furthermore, the value of that property actually comes from Sitecore.Configuration.Settings.Media.MediaLinkPrefix, which also doesn't have a setter and is pulled directly from the config file.
The MediaManager is a static class that I believe isn't able to be swapped out with a custom implementation. And, unlike the LinkManager, the MediaManager is hard coded to use the Sitecore.Resources.Media.MediaProvider so you can't write a custom provider either.
You can do this by creating your own implementation of Sitecore.Links.LinkProvider and set it up in your web.config under the <linkManager> section.
I don't know the exact implementation, but you can inherit a class from Sitecore.Links.LinkProvider and then override the GetItemUrl() method.
Then configure your class to be used as LinkManager.