Issue
I'm working with Collibra java APIs in eclipse (which leverages the flowable workflow engine). There are pre-instantiated classes in the engine, which eclipse (obviously) does not know about.
Is it possible to configure eclipse to automatically instantiate classes in order to provide autocomplete support?
i.e. to configure eclipse to perform the following code automatically?
import com.company.module.package.MyClass
MyClass myClass = new MyClass()
This way, the myClass
variable would always be available for autocomplete without having to declare it every single time.
Edit: Even better, is there any way to configure eclipse to include variables loaded into the execution environment of flowable? For example we would load one variable in one file, would the eclipse autocomplete be able to have access to that variable in another file? In flowable, the syntax is:
execution.setVariable("myVariable", myVariable)
Solution
Thanks to emilles for putting me on the right track. Here's the solution. This works when the Groovy developer tools plugin is installed.
- open a new groovy script and type the name of the variable you want to add to content assist
- press ctrl + 1 to bring the quick assist menu and press "Add inferencing suggestion"
- Fill the information as described below
This will create an entry in a file located under your project root as .groovy/suggestions.xdsl
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <projectSuggestions> <declaringtype type="groovy.lang.Script"> <property isActive="true" isStatic="false" name="execution" type="org.flowable.engine.impl.persistence.entity.ExecutionEntityImpl"> <doc/> </property> </declaringtype> </projectSuggestions>
From then on, the "execution" variable will be automatically recognized by eclipse as an instance of org.flowable.engine.impl.persistence.entity.ExecutionEntityImpl
Answered By - Arthur Burkhardt
Answer Checked By - Cary Denson (JavaFixing Admin)