SonarQube Plugin create new rules after server start - plugins

I want to create a SonarQube plugin which provides the functionality of rule creation. The rules are ought to be provided by an importer which parses a however-looking (custom) definition file and creates (custom) rules from that definition file. This importer is started by user action.
I did not found a possibility to create new rules after server start. Do you know a way of doing this?

The only way to do this is through rule templates. Otherwise, all rules must be registered at server startup.

Related

Eclipse WST server "Automatically publish when resources change" doesn't publish on file change

I have a WST server implementation where I have defined already a ServerDelegate, ServerBehaviourDelegate & ProjectModuleFactoryDelegate for my specific server type. Being short, basic functionality works fine. However I want to implement the "Automatically publish when resources change" option located on the server editor. When I select this, I don't see the publish method being called when a file of a Module added to the server has changed, I did some research and overrided the getListenerPaths from the ProjectModuleFactoryDelegate child class, but besides this I'm not sure what can I be missing.

Netlify.toml vs netlify.yaml

I am a little confused by the new configuration file netlify.yaml.
I imagined it would be a drop-in replacement for netlify.toml, but without the toml file I get the following error:
No netlify.toml found. This is needed to configure the function settings. For more info: https://github.com/netlify/netlify-lambda#installation
When both of them are present I have
failed during stage 'Reading and parsing configuration files': Multiple potential Netlify configuration files in "/opt/build/repo": netlify.toml, netlify.yaml
I would like to access the “plugins” functionality and I am not certain if it exists on the toml version of the configuration as this doesn’t seem to trigger anything:
[[plugins]]
type = "./.netlify/plugins/xxx"
What would you recommend as the best course of action?
Here is the response I have received on the community forum (https://community.netlify.com/t/netlify-toml-vs-netlify-yaml/6482/2):
We haven’t quite finished implementing the json and yml support, but these are the docs: https://docs.netlify.com/configure-builds/file-based-configuration/#json-and-yaml-configuration-files .
It is definitely not implemented in the private beta for build plugins yet, so you’ll need to stick with toml as the docs advise.

Debugging Drools inside an EJB in eclipse

I am currently debugging a web application which uses a drools ruleset inside an EJB to process business rules. It's deployed inside a JBoss server. I've configured eclipse to run the server so I could use Debug on Server functionality of eclipse.
When I reach the class that fires the drools ruleset, the server loses focus and returns after all the rules are fired. Is there a way where I could trace what rules are being fired? Right now, what I do is put logs inside the *.drl files so I know where the application is inside the rules engine.
you can get the generated java source code of any rule when you add a file with name drools.packagebuilder.conf to your %USERHOME% directory.
The file must contain the following instruction:
drools.dump.dir = d:/myDroolsJavaSourceCode
The directory d:/myDroolsJavaSourceCode - Directory (or any other given name) must exist otherwise the Drools Packagebuild will stop execution.
Then you can add this directory to your Eclipse Environment as new project (probably you have to remove the flag 'Default Location' to choose the 'myDroolJavaSourceCode').
Then you can open the file in Eclipse and set break points in the editor.
May be you must attach the directory also during debugging execution twice.
Best regards!
Christof
As far as I know you can't debug drl file. What we did was to encapsulate the logic of when and then in a method, so that you can at least debug that.
Maddy
What I did is I downloaded the sources for drools-engine and compiled the drl files to their java sources. When you run the app, you'll have an option to attach sources when the break point reaches the engine. It's still hard to trace the rules that are fired (multiple rules from different drls can be fired) but it's better than just sysout logging.

How can I use activiti:formProperty in alfresco activiti?

I want to design and deploy an activiti workflow to alfresco.
To prepare form for this workflow one way is to define a form and use its formKey.
But by this way I should change share-workflow-form-config.xml and restart the tomcat, and deploy model and bpmn file.
I need a way which has one deployment without restarting tomcat.
I found a way in activiti using activit:formProperty, but it seems does not work in alfresco.
Am I correct? This is not in alfresco?
If alfresco has it how can I use it?
In other words, as I deployed one of activiti-explorer examples in alfresco workflow console, there was not any of those fields displayed in deployed workflow start event form.
After clicking on "Start Workflow" an error displayed
org.alfresco.service.cmr.workflow.WorkflowException: 03110260 Failed to start workflow activiti$vacationRequest:1:2352.
You can do it via workflow console.
Check out this
http://wiki.alfresco.com/wiki/Workflow_Console
Hi to my knowledge it's not possible to do this with the current setup. Because what you're missing is that you're running the workflow within Alfresco Share. And every screen is rendered by Alfresco's own form engine.
To achieve what you want can be done by running Activi seperately and using Activit's own UI.
Coming back to your post, I quote: "But by this way I should change share-workflow-form-config.xml and restart the tomcat, and deploy model and bpmn file."
You can speed things up:
Define your model first and once it's finished and tested, restart Alfresco
Changes made to share-workflow-form-config.xml or any other form XML can be done during runtime. You just need to reload the share webscripts & form --> alfresco/service/index?reset=on or reset=all through a post method (get might work, haven't tried it). I'm using Will Abson's build ANT script which does that. Check-out one of the google project add-ons and you will find it there
You don't need to restart Alfresco when deploying workflows! There is an activiti-workflowconsole you can upload in runtime your new bpmn20.xml file or create a *.bar package and upload that one
The advantage of using an Alfresco-Model is that you can re-use workflow screens by using the same model & form config in multiple steps. E.g. I use the review and approve task & form config a lot, because it's a general task.

java.lang.NoSuchFieldError returns when trying to create a stateless session to the Rules Execution Server

I am using Ilog JRules Studio 7.1.1 for the rules development. I am using JUnit test cases to test the developed rules.
When i am trying to create a stateless session to the RES, it's returning with the below error.
IlrStatelessSession session = factory.createStatelessSession();
Anyone is having any idea?
java.lang.NoSuchFieldError: ilog/rules/res/decisionservice/plugin/IlrWsdlGenerationInteractionSpec.FUNCTION_NAME_BACKPORT_GENERATE_WSDL
at ilog.rules.res.decisionservice.plugin.IlrWsdlGeneratorInteractionExtension.getSupportedFunctionNames(IlrWsdlGeneratorInteractionExtension.java:418)
at ilog.rules.res.xu.plugin.impl.IlrPluginManager.createPlugins(IlrPluginManager.java:222)
at ilog.rules.res.xu.plugin.impl.IlrPluginManager.changePlugins(IlrPluginManager.java:173)
at ilog.rules.res.xu.plugin.impl.IlrPluginManager.start(IlrPluginManager.java:135)
at ilog.rules.res.xu.spi.IlrManagedXUConnectionFactory.createConnectionFactory(IlrManagedXUConnectionFactory.java:648)
at ilog.rules.res.xu.spi.IlrManagedXUConnectionFactory.createConnectionFactory(IlrManagedXUConnectionFactory.java:668)
at ilog.rules.res.session.util.IlrJ2SEConnectionFactoryFinder.findConnectionFactory(IlrJ2SEConnectionFactoryFinder.java:23)
at ilog.rules.res.session.IlrJ2SESessionFactory.createClientFactory(IlrJ2SESessionFactory.java:93)
at ilog.rules.res.session.IlrJ2SESessionFactory.getClientFactory(IlrJ2SESessionFactory.java:129)
at ilog.rules.res.session.IlrJ2SESessionFactory.createStatelessSession(IlrJ2SESessionFactory.java:62)
Regards,
Hari
Nothing to do with the session.
JRules is crashing because it is not able to generate the WSDL, meaning there is something wrong with your project at first.
Try to run it locally first.
The thing is a web service is automatically provided if the XOM is based on XSD
There is an error somewhere in your project. If you use XSD (which I guess) then have a look to your rule project.
If you use JAVA XOM then there is an error in your web service server (which I doubt) because I cannot see why JRules would complain for your own code.
Verify your in/output parameters
Make it simple first then complicate the process.If simple then redeploy...
Hope it helps