Using drools decision table with spreadsheet I was able to make this:
decision table with xls file
But in workbench I can´t
guided decision table
The error I was getting is:
Unable to Analyse Expression entrega.setSeq1( ""number|"+entrega.getNumeroML|()" );:
[Error: unable to resolve method using strict-mode: org.drools.core.spi.KnowledgeHelper.verbalizar()]
[Near : {... rega.setSeq1( ""number|"+entrega.ge ....}] ^ [Line: 5, Column: 0]
How to set a fact value in action?
Thanks
RESOLVED:
From:
https://groups.google.com/forum/#!topic/drools-usage/ZM76HPQ62cU
Create a "Action BRL Fragment" (you'll need to click the "Include advanced options" on the new column dialog).
With this you can either:-
(1) Add "free form DRL" and enter entrega.setSeq1( "number|"+entrega.getNum() );
(2) Select "modify entrega", select the Seq1 field and use a "formula" for the value entering "number|"+entrega.getNum()
Related
I'm trying to update a field so i can test liquibase's functioning on my job. I'm using this
syntax
UPDATE "Country" SET "name" = 'Perúpe' WHERE "id" = 10;
But it will throw an error that says:
Caused by: org.postgresql.util.PSQLException: ERROR: column "Perúpe" does not exist
Which is not a column, it is a value that i'm trying to input so i know liquibase is working.
It is working with a db that was done outside liquibase, and it has only 3 liquibase inputs. Those are ok. When i try to enter a new one, it will crash and stop the app, until i erase that test.
I think my syntax could be wrong. It moved from the table (relation does not exist) to the value of my entry. What could i be doing wrong?
This has been asked and answered previously. Error: Column does not exist in postgresql for update
As Adrian wrote in their comment above, using single quotes instead of double quotes is the reported solution.
We have made an generic search client on the project I work on.
Its a simple search plug-in that allows us to search on properties of an entity.
ex:
public class Movie {
private String id;
private String director;
private String title;
//set-getters
}
If we need to find a specific movie we can do stuff like:
movie.title='some title'
movie.title='some title' and director='bob'
If at some point in time we add a property X.
We can do:
movie.X='Y'
Without any code changes in our search solution.
This is working very well for us (for the basic searches) but now i ran into an problem. One of our entities has an property called "properties" and when we try to search on this an error is thrown..
"org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: generatedAlias1 near line 1, column 149 [select generatedAlias0 from N as generatedAlias1, S as generatedAlias0 where ( N.properties is null ) and ( N.id=S.node )]
The generated query works if i run it on my local DB, when I use the search end-point, it fails. Properties is a String field on the entity and VARCHAR in DB.
Any idea what went wrong?
changed 'properties' to 'options'.. seems properties is a reserved word in the underlying query building libs
In a development environment with SQLite 3.7.11 and Java, despite having read the following answers:
Answer 1
Answer 2
Answer 3,
am finding the usage of the SQLite IN clause not very straight-forward.
Assume a simple table TEST with the following structure:
----------------------------
id PRODUCT TAG
(int) (text) (text)
----------------------------
1 Cinthol Soap, Bath, Cleaning
2 Vim Dishwash, Kitchen, Cleaning
3 Burger Food, Breakfast, Lunch, Dinner
The following queries are behaving this way:
----------------------------------------------------------------------------
Query Result Expected
----------------------------------------------------------------------------
SELECT PRODUCT FROM TEST WHERE TAG IN('Soap') Cinthol Cinthol
SELECT PRODUCT FROM TEST WHERE TAG IN('Dinner') <EMPTY> Burger
SELECT PRODUCT FROM TEST WHERE TAG IN('Soap', 'Bath') <EMPTY> Cinthol
SELECT PRODUCT FROM TEST WHERE TAG IN('Cleaning') <EMPTY> Cinthol, Vim
So the questions are:
Except the first query, why are the others not producing the expected results? Is there something fundamentally wrong in the understanding?
If wrong, what is the right query to get the expected results (without using the instr function)?
Furthermore, the TAG column eventually has to be bound with an array of tokens in Java, building the query dynamically. The answers listed above have pointers to that, though.
Thanks in advance!
In clause doesn't work like this.assume if you had one TAG each column you could get the results.you need to add another table to keep your tags.in this table you need pk , foreign key(id deom tests) ,and tag so that you wil have multitags for each product.this is a solution you can make different.You had better search database notmalization first.gl
When I try to load an Entity with Hibernate I get the following error in postgres-log:
ERROR: column appuser0_.device_token does not exist at character 35
STATEMENT: select appuser0_.id as id1_27_0_, appuser0_.device_token as device_t2_27_0_,....
The column device_token definitely exists - and if I copy-paste the whole logged statement and execute it in PGAdmin, I get the expected result.
So what do I forget? What is the difference between the Hibernate statement and the manually executed one?
This issue was caused by the multi tenant configuration so that the wrong DataSource has been chosen.
Depending on how you defined the query, the problem might be located somewhere else: For example, HQL Queries are using the "property-names" of the class, not the column names.
And if you have something like:
#Column("device_token")
private String deviceToken;
Then your HQL-Query should target "deviceToken" and not "device_token". We also encountered a similar error once: Hibernate was reporting "user_id" is missing, because we named the property "userId" with the underscored version for the column name only.
This might be not the problem for you but worth double checking it.
I have two tables, price_feed and price_feed_type. Price feed will contain the data for different implementations of price feeds.
Now, this would usually be done through the <discriminator> tag, with a discriminator field in the price_feed table. However, it would be preferable in the context of the system to have this field in the price_feed_type table. I've come across the <discriminator formula="..."/> method, and tried working with this.
One solution is as follows (assume this is entered in the formula attribute):
(SELECT implementing_class FROM price_feed_type INNER JOIN price_feed ON price_feed.price_feed_type_id = price_feed_type.price_feed_type_id")
Another solution is the following, and I should note that I've tried with both priceFeedID and price_feed.price_feed_type_id
(SELECT implementing_class FROM price_feed_type WHERE price_feed_type.price_feed_type_id = price_feed.price_feed_type)
Either one gives the following error:
org.postgresql.util.PSQLException: ERROR: column timedprice3_.implementing_class does not exist
An extra note, without the parantheses, I get the error:
org.postgresql.util.PSQLException: ERROR: syntax error at or near "SELECT"
Any ideas as to how to fix this?
EDIT:
To add what I've found so far:
Using either one, if I do SELECT *, and then do SELECT implementing_class outside, it gives a different error. Full code:
(SELECT implementing_class FROM (SELECT * FROM price_feed_type INNER JOIN price_feed ON price_feed.price_feed_type_id = price_feed_type.price_feed_type_id) AS foo)
The error is:
org.postgresql.util.PSQLException: ERROR: syntax error at or near "."