How to pass custom java objects to Drools - jboss

I am new to Drools engine and Business rule in it. I am trying to figure out, in the Data Objects, is there any way to pass the custom objects so that using the parameters to refer in my own drl file?
I setup kie-drools-wb-650final-eap7.war on my JBoss application server. I made the server up and running and was able to login to the application. Now my question is regarding the Data Objects section. I tried to create a new Data Object and it got created. Where the newly created Data Object will be stored and is there any chance of injecting my own created objects into that.
Please help me in solving this problem.
When we setup kie-drools-wb-6.5.0.Final-eap7.war in Jboss application server and run the application, i am presented with default Data Objects like Application etc... My question is where can I find these objects stored in the application.

Related

Defining various DB & Salesforce access information in an external file and using them in Mule Anypoint Studio

I am running Mule Anypoint studio v6.2.4 under Windows. I have an application which gets data records from a SQL Server DB and populates them into Salesforce Org. The application was developed using examples and works fine in the current scenario of one DB and one SF parameters defined in a mule.properties file. This structure works but with serious limitations. Whenever a new DB instance is provided (DEV/QA/SAT/UAT...) and a different destination SF Org is chosen, all the mule applications need to be modified as the access parameters are defined in the property file.
I asked for help about how to dynamically define and use the access parameters in this question. (Defining various DB & Salesforce access information in Mule Anypoint Studio). While the proposed solution worked, it was still based on property file approach. Hence whenever a new DB or SF Org is to be worked on, all the mule applications will still need to be changed because of the property file approach.
A correct approach will be define all the access parameters in an external file. In the mule app, retrieve the appropriate access parameters based on DB name or Org name (provided as http query parameters). Use their values to initialise appropriate mule script variables. This way new DBs or Orgs can be added at will and mule app should work without any re-compilation or changes.
My mule app is batch based and config code fragment to access SQL DB is as follows::
<db:generic-config name="legacyDB" url="jdbc:jtds:sqlserver:${dbHost}:${dbPort};databaseName=${dbName};user=${dbUser};password=${dbPassword}" doc:name="Generic DB Config"/>
How would I accomplish it so that DB or SF access works as defined? Details will help me as I am not that proficient in Mule yet.
Thanks
Kishore
What about reading an external file using a JavaClass and returning a JavaObject to Mule, then you can easily manage those values.
Check this project and change the path in the LoadExternalFile.java to load your own json file. There is an example in the src/main/resources
https://github.com/angelalberici/external-property

Drupal Commerce, How to control custom form fields in the product form?

I'm developing a custom module that has to send some information to a Web Service after a Product is inserted, updated or deleted.
In order to ensure that all the fields required by the Web Service exist, I have decided that the module should be the one in charge to put them in the Product form. I achieved It by extending the commerce_product_product_form function.
But now, I have noticed that the values for the fields that I have added are not saved, so I supposed that I have to define a custom table in the module to store the additional information.
I have taken the example from AutoSKU regarding how to save and load data for Product Types form. But, what I've not found is how to do, or what are the hooks for saving and loading data for the Product form.
So, my questions are:
Is It correct what I'm thinking about creating a new table for storing the additional information that I require or can It be implemented as part of the existent routines that the commerce module handles?
If the module has to save and load the data by using a custom table, What are the hooks that I should use in order to append the form data and save It to the module tables?
If I can store the information using the commerce routines, What should be the way and/or the hooks to define the custom form fieds?
Can you tell me if there is any example about how to achieve this?, I have seen some modules but, basically all of them just modified a behavior of the existent fields, they don't add new fields, as far as I could see. The modules that I have reviewed are:
commerce_custom_product
commerce_dressing_room
commerce_fancy_attributes
commerce_tickets
I would like to achieve this by using the commerce and Drupal best practices but I need to finish this module as soon as possible. So, in the meanwhile I'll be saving the data to a custom table and loading the additional information in the commerce_product_product_form hook and saving the information in the commerce_product_save hook.
For loading the data I have tried with the hook_commerce_product_load and hook_entity_load, but for some reason the call seems never happening (I'm sending some information to Watch Dog but It's never displayed), I also have tried by clearing the cache without any change.
Any help would be appreciate.
Thanks in advanced
Are these fields going to be created during normal use of the application (hourly/daily)? Or are they only being added at the beginning (initialization process)?
If the latter, you could create an install script similar to the ones found with many, many modules out there (module-name.install).
Have you considered adding the fields to the content type?

how do i create database using entity

I followed very simple example from www.asp.net to create Web API project using Empty project template for Web API. This tutorial does not create database instead it just create model class and seed data inside api controller.
I successfully consumed API controller using angular service and able to show data on UI. Till here everything is fine.
However, moving one step further i would like create database but not sure about the steps.
I don't want to follow some other tutorial available on same site which does all of these things because i am not understand the overall concept even though i'll able to create database. Also, tutorial talks about using MVC approach which i dont want to use. I just looking for Web API, EF and Angular combination.
Can someone guide me for writing context class and overall database creation steps.?

How to create/insert product programmatically in Websphere Commerce 7 WCS7

I'm developing an ecommerce based on Websphere Commerce 7 WCS7. I need to import products from an external supplier, which is exposing a webservice. I've already implemented a Controller Command performing all the operation needed to extract the products from the remote service, and I've them avalaible as custom Java classes.
I'm a little bit confused about the approach I should follow in this case. I've defined the attributes needed in my scenario and used the dataload utility to import them in the DB. What should I do next? I expect to be able to "create" WCS product programmatically from my Controller Command but I don't know how to use the attribute I've defined in a programmatic insert.
Can someone point me on the right track on how to perform this kind of operation? I went through the documentation, but, given the fact I'm quite new of the WCS environment, I don't know how to proceed according to the current best practices.
It is possible to create a new catalog entry programmatically if you copy what is being done in the LOBTools. I have not done this myself though. I have always added new products via the data loads and when we did need to add from an external service I just output the information to a file and loaded along with our other products. The reason was due to keeping the catalog in sync with the product management system.
Have a look at the various DataBean classes in WCS, like: CatalogEntryDataBean.
See here for WCS data beans:Link
And here for "activation" of a DataBean:Link

Is it possible to generate a Core Data structure programmatically?

I am currently working on a project which may require the ability to generate a Core Data model and classes automatically from a JSON feed which describes each object, it's properties and relationships. This would enable our company to quickly generate a working core data database from our CRM at the start of each project.
Is this possible/easy to achieve? If so, does anyone have any tips on where I can get started?
I have already created various iOS apps which use Core Data but I have never made one which needs to automatically create a Core Data model.
Yes, you can create a Core Data model dynamically. An NSManagedObjectModel can be created without a stored model, and NSEntityDescription/NSAttributeDescription instances can be defined and added to it before being passed to an NSPersistentStoreCoordinator. Apple has an example of doing this in their Core Data Utility Tutorial.