How to write own java function in Visual rules BRM? - rule-engine

We are using Visual rules BRM powered by actico to manage Business rules.There are many builtin function provided by visual rules library. Now I want to add a custom function to my project. How can I do this. I'm new in this. Thanks In advance. I'm using 6.4 version visual rules run-time.

Just make a Java class and define a required method in class then go on function package and right click and follow steps below:-
->New Element, -> function, ->Check (import from java method) ->Next, -> (browse your java class and method -> finish)

Create a method in java class then Right click on project>>new element>>function>>import from java method>>choose the package>>select method and finish.

Related

Javassist how to debug modified java method

use Javassist to add some code statically at the beginning of a method right after the class is compiled. For example,
public String getFoo() {
// add some code here
return "foo";
}
From Eclipse debug, I can not see the added code. Is there a way for Eclipse to show de-compiled code instead of original source?
How to debug it?
Once you've created the CtClass, you can call CtClass.writeFile to save the bytecode of the resulting java class. Then you can use a java decompiler to view the source. The generated source is not perfect ( it would probably not compile ) but it gives you a good idea of what's going on. I use the decompiler built into IntelliJ ( community edition ) but some googling will find you a few other options.

Eclipse: What is a better way to find the implementation of a virtual function?

Eclipse: What is a better way to find the implementation of a virtual function?
I am now using "Search" to look at every places that have the virtual function name. Apparently it is a very ineffective way.
[Update 1]: Specifically I am reading the code of the liveMedia of live555. I import it as C++ code in Eclipse.
I assume you mean abstract functions.
Right-click on the function and select 'Declarations'.
select function or method and press F3 you will reach at method creation.....
You can see this on the Type hierarchy which can be opened by:
double click on method name
Ctrl + T
or by right clicking on the method name and navigating in the menu.
This opens a class tree showing only classes that implement the method, and if you click on a class it jumps to the implementation for that class.
You have to be in the .hpp file annoyingly to open the Type hierarchy, if you are on the .cpp you have to first jump to the .hpp with Ctrl + Click on the method name.
Related question: Eclipse shortcut to find all children class that override a method
Tested in Eclipse 2020-03 (4.15.0) with this test project.

Eclipse Javascript development with VJET

Using Eclipse Juno with VJet
Can you create typelib from javascripts yourself?
I know you can download jquery and a few others from: http://www.ebayopensource.org/p2/vjet/typelib/
But obviously you will need others.
Regards
Chris
Yes type libraries are just JavaScript files which use VJETDoc and VJOJS to define types for
object literals using vjo.otype
functions which do not change Function definition vjo.otype
functions which have additional properties using vjo.ftype
methods of a class using vjo.ctype
globals which can be define using a .globals section.
and more...
Many type libraries are located under this github address
https://github.com/ebayopensource/vjet-typelib
More info about VJETDoc[1] and VJOJS[2] and type library tutorial[3]
[1]http://www.ebayopensource.org/wiki/display/VJET/VJETDoc+Quick+Reference
[2]http://www.ebayopensource.org/wiki/display/VJET/Semantic+Comparison+-+Java+and+VJET+VJO
[3]http://www.ebayopensource.org/wiki/display/VJET/VJET+Type+lib+Tutorial+-+part+1

Why eclipse is generating argument names as arg0,arg1,arg2.... for methods?

When I try to access some class's method; eclipse gets that method but arguments inside that method are replaced by arg0, arg1, arg2...
Example:-
Suppose I have this method in some class named ReadFile.java
#Override
public int readXXX(int start, int end, String xxx) throws IOException {
return 0;
}
When I try to access that method from an instance of class it shows me as follows:
readFile.readXXX(arg0, arg1, arg2);
It becomes hard to identify what I should pass in argument. The same thing also happens for java methods. i.e. when I implement interface all method under that will be generated but arguments in that methods are arg0, arg1.....
Is there any setting I can do prevent this?
I'm using Eclipse Galelio.
Eclipse can't work out the arguments because it can't find the source or javadoc attachments.
Make sure your source is attached.
To check, click on the method call readXXX and press F3 which should open the method declaration. If the source is not attached, Eclipse will say "Source not found" and will allow you to "Attach Source...".
Anyone having the same issue, try performing a Project > Clean, this will delete the old class files, and Eclipse will recompile them in debug mode this time. Worked for me in Indigo 3.7.2
The problem is that your class files lacks debug information embedded in them. JDT doesn't reparse the source files or the javadoc for dependencies, when building the AST for your project, so it doesn't have idea what the name of the parameter is, even when you are able to open the class and clearly see what are the method names.
In order to correct this, you need to recompile your class files with debug information enabled, which makes the class file considerably larger, but unless you are developing for memory-constraint devices, you should be fine.
for those like me who tried to apply one of our colleagues suggestions and unfortunately hasn't worked, please, give a try to check the option "Add variable attributes to generated class files (used by the debugger)" within Window -> Preferences -> Java + Compiler.
Once you've done that, try to build the project again.
Cheers.
I solved this by going to preferences
Java / Content Assist
On this page under "Sorting and Filtering" I unchecked "Hide proposals not visible in the invocation context" now instead of seeing (arg0, arg1, arg2) etc in autocomplete I see (catalog, schemaPattern, tableNamePattern...)
I am using Spring Tools Suite 3.7.2 which runs on the Eclipse Mars 4.5.1 platform.
This link helped me to solve this problem.
1) Right click on your android.jar and select Properties.
2) Select Java Source Attachment. Enter the source directory location (you can also use External Folder… to browse to the directory) and click on “Apply“.
The code names match the following version numbers, along with API levels and NDK releases provided for convenience:

How to have several templates for Java files in Eclipse?

I'd like to have several different templates for new java files in Eclipse. Is this possible?
Basically when I am creating a new Java class file in Package Explorer I'd like to use a template X as a base for new file, when I am creating a new unit test class I'd like to use template Y, when I am creating a Wicket component class I'd like to use template Z, etc.
Also is it possible to configure Eclipse so that when I create a new Java class, Eclipse will generate corresponding new unit test class automatically?
I am not sure if this is what you want, but you can add new wizards to Eclipse using the org.eclipse.ui.newWizards extension point.
Here is the corresponding documentation in Eclipse help.
Another (less elegant) way of doing this is to add your own templates (e.g. DAO) under the Java editor (Window->Preferences->Java->Editor->Templates) so when you type DAO and Ctrl + Enter it, it expands to the full template you want. This way creating a new empty file, typing DAO and autocompleting would transform into a full file snippet.
Hope it helps!