I'm trying to reference a module property from tibco business works 6.
Do you guys have an example about the getModuleProperty("")?
What kind of input should I use?
Should I use the entire path or just the name of the property?
You need to first add a process property to your process (it's under properties if you click outside of the main process area). In there you can reference a module property. You can then use the process property in XPath.
First off, you need to include a few dependencies in your project. (Documented here)
Then write some code access the properties
#ModuleProperties
public void loadProperties(HashMap<String, String> moduleProperties){
this.myClassProperty = moduleProperties.get("/DB/Property"); // Case Sensitive Path
System.out.println("Completed loading module properties.");
}
You have to use the entire path of the property. you can get it from the META-INF/default.substvar file.
Related
In the gradle doc: https://docs.gradle.org/current/userguide/custom_plugins.html#sec:custom_plugins_standalone_project
The code block is:
gradlePlugin {
plugins {
create("simplePlugin") {
id = "org.example.greeting"
implementationClass = "org.example.GreetingPlugin"
}
}
}
I noticed it calls create method. And I looked the source code. It says:
Creates a new item with the given name, adding it to this container,
then configuring it with the given action.
What does it mean? Is it actually used anywhere? Or it can be any name does not really matter?
gradlePlugin.plugins is a NamedDomainObjectContainer - which are used by Gradle to hold multiple objects, each with a name.
The documentation on plugin development goes into more detail on the usage of NamedDomainObjectContainers.
Sometimes you might want to expose a way for users to define multiple, named data objects of the same type.
[...]
It’s very common for a plugin to post-process the captured values within the plugin implementation e.g. to configure tasks.
Since the elements of a NamedDomainObjectContainer can be any type, there's no specific usage for one. Generally they are used to configure the Gradle project, for example creating specific tasks, configuring source code locations.
I am defining a gradle task in which I want to go to the parent directory of the current project. According to the documentation at https://docs.gradle.org/current/javadoc/org/gradle/api/Project.html, I should have been able to use getParent() property on my current project. But when I try it, it returns a String (path of the parent directory) though the documentation clearly states the method should return a Project. Why is this happening?
Most certainly you are calling getParent() on a file/directory, or inside a closure that delegates to a java.io.File, which indeed returns String with parent folder's path.
Try to call project.parent explicitly and see if it helps.
ps. Actual code snippet might help as well.
I've got a small problem (maybe it isnt even a problem)
I am making an application in Ruby, and the folder/file structure goes something like this:
OrderSet/
..item.rb
..file.rb
..order_object.rb
OrderGet/
..item.rb
..files.rb
..order.rb
As you can see I got two item.rb files, they are both different in class structure. Now I need to create an OrderSet/item.rb object, how do I specify it needs to look in OrderSet and does not get the OrderGet one?
I have to make clear, all files are required in the main rb file.
I have tried doing OrderSet.Item (the class is called Item inside the item.rb) but it complains about an ininitialized constant OrderSet
Thanks in advance!
[edit]
I have also tried to make modules out of it, maybe I don't understand the concept correctly, but I have tried it with OrderSet.Item.new (OrderSet as module name)
You could use a module to create a namespace - that way each set of classes would be encapsulated to what they do (the folder name from your example). So classes in OrderSet would be wrapped in a module for example OrderSet/item.rb would become:
module OrderSet
class Item
# methods and properties
end
end
Then you could use it like
new_order_set = OrderSet::Item.new
RubyMonk has a lesson called Modules As Namespaces which has more details and examples you can run in your browser.
I have multi-module project under SBT.
Project A (library) has reference.conf file with A's configuration parameters. Project A depends on akka-actor library, which ships with its own reference.conf file. Project A redefines some akka's parameters in own reference.conf.
Project B depends on A.
When I call ConfigFactory.load() in B, I'm getting wrong order of reference.confs merging. It first takes A's config, then applies akka-actor's config over it. Eventually, I'm getting initial akka-actor's configuration.
How can I fix it? I need to get akka-actor's config loaded first, then my A's config should be applied over it.
Ok, looks like I've found the answer in sources of ConfigFactory.
All the reference.conf is being loaded through ClassLoader.getResources. It returns java.util.Enumeration[URL]. The order of URLs in this enum is the answer to the question. So all you need to do: ensure the order of your reference.conf resources in this enumeration properly arranged.
Here is an example of how to do that. First, create your own version of ClassLoader by overriding getResources method:
import scala.collection.JavaConverters._
class CustomClassLoader(loader: ClassLoader) extends ClassLoader(loader){
override def getResources(name: String): util.Enumeration[URL] = {
val resources = super.getResources(name).asScala.toList
// arrange resources as you wish here
java.util.Collections.enumeration(resources.asJava)
}
}
Last, call load method of ConfigFactory with your CustomClassLoader instance.
I want to set up a code snippet (in this case in C#) to create a property which is additionally initialized in the class constructor, which includes that code is not only inserted in the class body but also explicitly in the constructor. Is that possible with just one snipped, and if yes: how?
Thanks in advance!
I'm not sure i've completely understood your question, but you can use this tool :
http://snippeteditor.codeplex.com/
You can write a snippet for a class which contains one property set in the class constructor
Take a look at the class and prop or propfull snippets, it should help you