Typed variable declaration : Attempt to resolve method: getValue() on undefined variable or class name: mTab : at Line: 3 : in file: inline evaluation of:
mTab .getValue ( "C_ORDER_ID" )
So i changed mTab to A_Tab
After that next error shows
Typed variable declaration : Class: MOrder not found in namespace : at Line: 4 : in file: inline evaluation of: ``import java.math.BigDecimal; BigDecimal
What to do next ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
BigDecimal PriceList,BasePrice,ChannelDiscPerc,ChannelDiscAmt;
Integer X_Doc_ID=(Integer)A_Tab.getValue("C_Order_ID");
MOrder quote=new MOrder(Env.getCtx(),X_Doc_ID.intValue(),null);
if (quote.getC_DocType_ID()==1000027)
{PriceList = new java.math.BigDecimal(0.00);
BasePrice = new java.math.BigDecimal(0.00);
ChannelDiscPerc = new java.math.BigDecimal(0.00);
ChannelDiscAmt = new java.math.BigDecimal(0.00);
if (A_Tab.getValue("PriceList") != null)
{PriceList = (BigDecimal)A_Tab.getValue("PriceList");}
if (A_Tab.getValue("ChannelDiscount") != null)
{ChannelDiscPerc = (BigDecimal)A_Tab.getValue("ChannelDiscount");}
ChannelDiscAmt = new BigDecimal ((PriceList.doubleValue() * ChannelDiscPerc.doubleValue()) / 100.00);
A_Tab.setValue("ChannelDiscountAmt", ChannelDiscAmt );
BasePrice=new BigDecimal (PriceList.doubleValue() - ChannelDiscAmt.doubleValue());
A_Tab.setValue("BasePrice", BasePrice);}
result = "";
This a beanshell script callout
a) Can you do some clean up (ref. not realy required.) ?
b) Please explain this code and what is ENV & getCtx()
MOrder quote=new MOrder(Env.getCtx(),X_Doc_ID.intValue(),null);
Payment Terms: 100% Thanks in Advance & Balance 100% on Delivery!!!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Shiju, which is the condition to execute the callout, I suppose on creation of the order the callout the C_Order_ID is zero.
Debugging script callouts is very hard, so my advice would be to add some log.log or System.out.println to your code to see what's happening inside (old way of debug).
Also, all the SQL code can be replaced with just one line like:
String description = DB.getSQLValueString ....
Regards,
Carlos Ruiz
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hii Shiju!!!
You need replace Integer X_ItCode = (Integer)A_Tab.getValue("M_Product_ID");
with
X_ItCode = (Integer)A_Tab.getValue("M_Product_ID");
Good Luck!!!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I think you are over complicating things!
in the CalloutOrder look for ...
if (Env.isSOTrx(ctx, WindowNo))
{
MProduct product = MProduct.get (ctx, M_Product_ID.intValue());
and below it add
mTab.setValue("Description", product.getDescription());
because of the isSOTrx this would only work for SO but even so the existing
>>> MProduct product = MProduct.get (ctx, M_Product_ID.intValue());
Should show you how to get a product rather than writing SQL!
colin
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Integer X_ItCode = (Integer)A_Tab.getValue("M_Product_ID");
if (X_ItCode == null)
X_ItCode = Integer.valueOf(0);
System.out.println("X_ItCode="+X_ItCode);
String sql= "Select Description from M_Product where M_Product_ID=?";
String X_ItDesc = org.compiere.util.DB.getSQLValueString( null, sql, X_ItCode.intValue());
A_Tab.setValue( "Description", X_ItDesc );
result = "";
--------------
I created the Rule with value="beanshell:fillDescription"
And filled the callout on C_OrderLine.M_Product_ID with "org.compiere.model.CalloutOrder.product;@script:beanshell:fillDescription"
There are lots of things to improve to such callout, for example as Colin advised using model class to get the product, or avoiding to execute the query when the product is not filled, etc.
Being a member for ADempiere - House of Commons and taking liberty to Carlos Ruiz words i list here the following script - (status: "Chalte-Chalte")
>>There are lots of things to improve to such callout, for example as Colin advised using model class to get the product, or avoiding to execute the query when the product is not filled, etc.<<
Window: : Rule
Search Key : beanshell:fillProductDesc
Name : Fill Product Description
Event : Callout
Rule Type : JSR 223 Scripting APIs
Script:
--------
package org.compiere.model;
Hi everyone
Good work guys, it surely help community people but i m just thinking of image.
All image in adempiere get stored in AD_Image table & i want to display the image on orderline tab. I m trying through script callout by taking references of above provided script but i m failing to read it.Is it possible to display image by script callout.
Thanks.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
hi !
Its very easy if you want to display image ont he order line you can create one foreign key as AD_IMAGE_id and make the referencekey as image . now youcan abletodisplay the image in product line.
Otherwise if you want to display images related toproduct. Please create one tab in product table with mandatory fields ,Name, AD_image_id(foreign key of AD_image table), product_id(make as parentlink coloum alsoitshouldbe a foreign key of product table).
Using this tab you can upload image for each product.
Now you have to write callout in orderline product field ,if product is selected it has to fetch the related image id for product and set that image_id aastoyour orderline image_id . It will work fine exactlly.
if you face any problem pleasecaontact me at salientvijay@gmail.com
Thanks & regards
vijay
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'd like to experiment (heavily) with beanshell script callout :)
Is there a (complete) documentation of what API calls can I do there?
Or is there a logical way how one could collect that?
I see here some magic code which apparently works but I can't extend it without understanding it (and the environment).
Thanks for the help,
Akos
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Rule window allows to customize ADempiere to some extend without modifying the code and very easy to manage. But if its used heavily for validation of data entry (column/fields) then it can slow down the system
(i mean the data entry process). The best way for validation of columns is to modify the *callouts.java as Carlos points
Thanks for the info. Before asking, I saw these links.
I have some experience with BSH programming, I know performance won't be a problem here.
I would like to have some information about the available objects for the BSH script at runtime, since it is not documented in Adempiere wiki.
If I won't get an answer to my question: no problem. I will reverse engineer it , and create a documentation about it in my own wiki.
I don't think that my english would be so bad or my question would be so hard to understand, I just recognise this as an "insider info" that has "business value" so it is not published.
It's all understood now, thread closed.
Regards,
Akos
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
> "I don't think that my english would be
> so bad or my question would be so hard
> to understand, I just recognise this
> as an "insider info" that has
> "business value" so it is not
> published."
I see you blaming here and there for not getting the answers you want (and maybe this is related to your ask for me in twitter to answer here).
I don't think the problem is your english, or question hard to understand. Instead of I think your question is too general, it doesn't show you're doing your homework - this is researching and asking here specific problems you have.
I always hate the "please give me step by step instructions" kind of questions.
Your claim about "lack of documentation" is ignoring the fact that there are plenty of documentation and even working examples on your case.
And your claim that some "insider info" is not published trying to get business is just self-defeating, now I don't like to answer your questions :-(
Regards,
Carlos Ruiz
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
The post is not directed to anyone, just should be considered maybe.
No, I'm not blaming for "not getting the answer". I would not blame at all if I don't get any answer. I understand, people have limited time and/or knowledge, and noone had the time+knowledge right now to answer my question.
But in this case I felt that I got a "pseudo answer", pointing me to the documentation I've already read (and I wrote that I'm through all the docs). These pseudo answers tell me that I should pay a bit and then I'd get the information. And this is irritating me, although I understand the motivation fully.
At this time I don't want to pay for this since I have the time and knowledge to find out myself sooner or later, without any external help. But then the question arises: if nobody invested the time to document what I ask for, why should I do that? More precisely: I'm kinda sure that documentation exists, it is just not published.
Documenting things to a certain level generates business, this is a good marketing strategy. Let"s call this level: medium.
Documenting things above this level (above medium) means less consulting need, thus less consulting hours sold. This is weakening the marketing strategy described before.
I can fully understand this strategy as well, just it has to be made clear. A lot of open-source projects (for example JasperReports) are doing this, I have no problem with this at all. It just has to be told clearly. Then I don't waste time asking and reading the useless (marketing) answers.
Regards,
Akos Gabriel
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Look at x and y clases in the source, their methods can be used within script callout. x class with context A, y class with context B.
And so on.
I've tried your example code and it works even for me.
I won't complain any more about documentation since I would be able to find my answer in the time I wrote my previous post.
Regards,
AKOS Gabriel
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
> "These pseudo answers tell me that I
> should pay a bit and then I'd get the
> information"
I re-read (several times) the answers you got, and I didn't find anybody compelling you to pay anybody.
It's obvious knowledge costs - you can pay somebody to teach you, you can learn by yourself (in this case the cost is your time and effort), you can ask in forums hoping somebody know the answer and give it to you, or hoping some charitable soul do your homework.
There are plenty of options, and each option has an implied cost.
> "But then the question arises: if
> nobody invested the time to document
> what I ask for, why should I do that?"
Indeed is a really tricky selfish question, why should I wrote the scripting option for Adempiere and release it for you to use it?
Why did I took the time to write documentation for this development?
Why did I took the time to write even a working example to help you to understand?
Now, why must I help you to learn beanshell? What must be my motivation to let you learn something that you're going to exploit mostly for yourself, and probably not returning anything to Adempiere project?
Any time somebody ask me for SPECIFIC help about the scripting option I give help. But you're asking us to help you to learn a script language. And asking us for MORE documentation because you think somebody else must document it for you. And then you complain that you're not motivated to contribute documentation, even when you're using programs that others wrote.
Sorry, I don't like what I'm reading here.
> "Documenting things to a certain level
> generates business … Documenting
> things above this level … means less
> consulting need … I can fully
> understand this strategy as well, just
> it has to be made clear"
Gabriel, although I'm sure there are certain contributions described like you wrote, you must not generalize.
With these statements you're generalizing, and I think this is a very wide community. There are people that contribute a little and hide a lot, there are people that contribute a lot and hide a little, and there are people that contribute without hiding anything. (Well, and there are also people that hide everything)
It's not fair putting all developers, implementors and community on the same bag.
At least from my side, practically all my developments are documented in wiki, trackers, explained cases of use, samples, seed sample data, etc. So, I don't find fair your statements about this. I consider the documentation I provided for script callouts is enough, in this specific case going deep it's easier reading code than reading some documentation (that becomes obsolete easily).
Also you can take training on beanshell, but probably not here.
Anyways, I need to express also my opinion as I feel unfair these kind of statements.
Regards,
Carlos Ruiz
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
What is the code for beanshell script callout from a column DISCOUNT
in tab C_ORDERLINE can check the C_DOCTYPE_ID=1000025 ?
when C_DOCTYPE_ID is a column in tab C_ORDER
Hi shiju!
Please use the foloowing code to check your condition
Integer order_id = (Integer) mTab.getValue("C_ORDER_ID");
MOrder obj = new MOrder(Env.getCtx(),order_id.intValue(),null);
if(obj.getC_DocType_ID()==1000025 )
{
your code....
}
if you phase any problem please let me know...
Thanks & Regards
Vijay
Hi
It shows an error as follows
Typed variable declaration : Attempt to resolve method: getValue() on undefined variable or class name: mTab : at Line: 3 : in file: inline evaluation of:
mTab .getValue ( "C_ORDER_ID" )
So i changed mTab to A_Tab
After that next error shows
Typed variable declaration : Class: MOrder not found in namespace : at Line: 4 : in file: inline evaluation of: ``import java.math.BigDecimal; BigDecimal
What to do next ?
I have explored MORDER.JAVA, MORDERLINE.JAVA and MORDERTAX.JAVA and finaly had
it cobled like this
package org.compiere.model;
import java.math.BigDecimal;
import java.util.Properties;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.util.Env;
import org.compiere.util.Msg;
BigDecimal PriceList,BasePrice,ChannelDiscPerc,ChannelDiscAmt;
Integer X_Doc_ID=(Integer)A_Tab.getValue("C_Order_ID");
MOrder quote=new MOrder(Env.getCtx(),X_Doc_ID.intValue(),null);
if (quote.getC_DocType_ID()==1000027)
{PriceList = new java.math.BigDecimal(0.00);
BasePrice = new java.math.BigDecimal(0.00);
ChannelDiscPerc = new java.math.BigDecimal(0.00);
ChannelDiscAmt = new java.math.BigDecimal(0.00);
if (A_Tab.getValue("PriceList") != null)
{PriceList = (BigDecimal)A_Tab.getValue("PriceList");}
if (A_Tab.getValue("ChannelDiscount") != null)
{ChannelDiscPerc = (BigDecimal)A_Tab.getValue("ChannelDiscount");}
ChannelDiscAmt = new BigDecimal ((PriceList.doubleValue() * ChannelDiscPerc.doubleValue()) / 100.00);
A_Tab.setValue("ChannelDiscountAmt", ChannelDiscAmt );
BasePrice=new BigDecimal (PriceList.doubleValue() - ChannelDiscAmt.doubleValue());
A_Tab.setValue("BasePrice", BasePrice);}
result = "";
This a beanshell script callout
a) Can you do some clean up (ref. not realy required.) ?
b) Please explain this code and what is ENV & getCtx()
MOrder quote=new MOrder(Env.getCtx(),X_Doc_ID.intValue(),null);
Payment Terms: 100% Thanks in Advance & Balance 100% on Delivery!!!
What is wrong with this Script Callout ?
No Error... But not updating the Prodcut Description from M_PRODUCT table
package org.compiere.model;
import java.lang.*;
import java.util.*;
import java.util.Properties;
import java.util.logging.Level;
import java.sql.*;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.math.*;
import java.math.BigDecimal;
import java.io.Serializable;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.util.*;
import org.compiere.model.*;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
import org.compiere.util.Ini;
import org.compiere.util.Msg;
Integer X_ItCode;
Integer X_Doc_ID=(Integer)A_Tab.getValue("C_Order_ID");
MOrder quote = new MOrder(Env.getCtx(),X_Doc_ID.intValue(),null);
if (quote.getC_DocType_ID()!=1000027)
{
X_ItCode = (Integer)(0);
if (A_Tab.getValue("M_Product_ID") != null)
{
Integer X_ItCode = (Integer)A_Tab.getValue("M_Product_ID");
}
String sql= "Select prod.Description from M_Product prod where prod.M_Product_ID=?";
PreparedStatement pstmt = null;
ResultSet rs = null;
try
{
pstmt = DB.prepareStatement(sql, null);
pstmt.setInt(1, X_ItCode.intValue());
rs = pstmt.executeQuery();
if (rs.next())
{ A_Tab.setValue( "Description", rs.getString(1) ); }
}
catch (SQLException e)
{
log.log(Level.SEVERE, sql, e);
return e.getLocalizedMessage();
}
finally
{
DB.close(rs, pstmt);
rs = null; pstmt = null;
}
}
result = "";
Hi Shiju, which is the condition to execute the callout, I suppose on creation of the order the callout the C_Order_ID is zero.
Debugging script callouts is very hard, so my advice would be to add some log.log or System.out.println to your code to see what's happening inside (old way of debug).
Also, all the SQL code can be replaced with just one line like:
String description = DB.getSQLValueString ....
Regards,
Carlos Ruiz
Hi Mr. Carlos, Thank you ... I will try that.
Hii Shiju!!!
You need replace Integer X_ItCode = (Integer)A_Tab.getValue("M_Product_ID");
with
X_ItCode = (Integer)A_Tab.getValue("M_Product_ID");
Good Luck!!!
Wants Product Description to be automatically filled after selecting Product Id in Order Line
But Something is wrong somewhere! requires more brains
Integer X_ItCode = null;
if (A_Tab.getValue("M_Product_ID") != null)
{
X_ItCode = (Integer)A_Tab.getValue("M_Product_ID");
}
String sql= "Select Description from M_Product where M_Product_ID=?";
String X_ItDesc = DB.getSQLValueString( null, sql, X_ItCode);
A_Tab.setValue( "Description", X_ItDesc );
result = "";
I think you are over complicating things!
in the CalloutOrder look for ...
if (Env.isSOTrx(ctx, WindowNo))
{
MProduct product = MProduct.get (ctx, M_Product_ID.intValue());
and below it add
mTab.setValue("Description", product.getDescription());
because of the isSOTrx this would only work for SO but even so the existing
>>> MProduct product = MProduct.get (ctx, M_Product_ID.intValue());
Should show you how to get a product rather than writing SQL!
colin
Hi Shiju, this code worked for me:
Integer X_ItCode = (Integer)A_Tab.getValue("M_Product_ID");
if (X_ItCode == null)
X_ItCode = Integer.valueOf(0);
System.out.println("X_ItCode="+X_ItCode);
String sql= "Select Description from M_Product where M_Product_ID=?";
String X_ItDesc = org.compiere.util.DB.getSQLValueString( null, sql, X_ItCode.intValue());
A_Tab.setValue( "Description", X_ItDesc );
result = "";
--------------
I created the Rule with value="beanshell:fillDescription"
And filled the callout on C_OrderLine.M_Product_ID with "org.compiere.model.CalloutOrder.product;@script:beanshell:fillDescription"
There are lots of things to improve to such callout, for example as Colin advised using model class to get the product, or avoiding to execute the query when the product is not filled, etc.
Regards,
Carlos Ruiz - globalqss
http://globalqss.com
> I created the Rule with value="beanshell:fillDescription"
Aha... a beanshell based Rule. I had missed that bit in the discussion.
colin
guys. can i change integer to string? like this.
String X_ItCode = A_Tab.getValue("kota");
String sql= "Select biaya_pokok from a_biaya where kota=?";
String X_ItDesc = org.compiere.util.DB.getSQLValueString( null, sql, X_ItCode);
if (X_ItDesc != null)
{A_Tab.setValue("biaya_pengiriman",X_ItDesc);}
else
{A_Tab.setValue("biaya_pengiriman","");}
}
result = "";
Thank you all for your time and overwhelming support
Hi Colin,
In spite of the code provided (CalloutOrder.java )
>> mTab.setValue("Description", product.getDescription()); <<
is not present in version 353A. That is why a beanshell callout is attempted.
So here i wish to confirm after testing 353A is not updating the
C_ORDERLINE.Description from M_PRODUCT.Description
when Product Id is modified.
Further can you provide a link to know more about = "CTX" in code
>> MProduct product = MProduct.get (ctx, M_Product_ID.intValue()); <<
Regards
Shiju
Being a member for ADempiere - House of Commons and taking liberty to Carlos Ruiz words i list here the following script - (status: "Chalte-Chalte")
>>There are lots of things to improve to such callout, for example as Colin advised using model class to get the product, or avoiding to execute the query when the product is not filled, etc.<<
Window: : Rule
Search Key : beanshell:fillProductDesc
Name : Fill Product Description
Event : Callout
Rule Type : JSR 223 Scripting APIs
Script:
--------
package org.compiere.model;
import java.lang.*;
import java.util.*;
import java.util.Properties;
import java.util.logging.Level;
import java.sql.*;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.math.*;
import java.math.BigDecimal;
import java.io.Serializable;
import org.adempiere.exceptions.AdempiereException;
import org.compiere.model.*;
import org.compiere.util.*;
import org.compiere.util.DB;
import org.compiere.util.DisplayType;
import org.compiere.util.Env;
import org.compiere.util.Ini;
import org.compiere.util.Msg;
if (A_Tab.getValue("M_Product_ID") != null)
{
Integer X_ItCode = (Integer)A_Tab.getValue("M_Product_ID");
String sql= "Select Description from M_Product where M_Product_ID=?";
String X_ItDesc = org.compiere.util.DB.getSQLValueString( null, sql, X_ItCode);
if (X_ItDesc != null)
{A_Tab.setValue("Description",X_ItDesc);}
else
{A_Tab.setValue("Description","");}
}
result = "";
Hi everyone
Good work guys, it surely help community people but i m just thinking of image.
All image in adempiere get stored in AD_Image table & i want to display the image on orderline tab. I m trying through script callout by taking references of above provided script but i m failing to read it.Is it possible to display image by script callout.
Thanks.
hi !
Its very easy if you want to display image ont he order line you can create one foreign key as AD_IMAGE_id and make the referencekey as image . now youcan abletodisplay the image in product line.
Otherwise if you want to display images related toproduct. Please create one tab in product table with mandatory fields ,Name, AD_image_id(foreign key of AD_image table), product_id(make as parentlink coloum alsoitshouldbe a foreign key of product table).
Using this tab you can upload image for each product.
Now you have to write callout in orderline product field ,if product is selected it has to fetch the related image id for product and set that image_id aastoyour orderline image_id . It will work fine exactlly.
if you face any problem pleasecaontact me at salientvijay@gmail.com
Thanks & regards
vijay
Hi,
I'd like to experiment (heavily) with beanshell script callout :)
Is there a (complete) documentation of what API calls can I do there?
Or is there a logical way how one could collect that?
I see here some magic code which apparently works but I can't extend it without understanding it (and the environment).
Thanks for the help,
Akos
Possibly you will get all info at
http://www.beanshell.org/home.html
Rule window allows to customize ADempiere to some extend without modifying the code and very easy to manage. But if its used heavily for validation of data entry (column/fields) then it can slow down the system
(i mean the data entry process). The best way for validation of columns is to modify the *callouts.java as Carlos points
You can also refer
http://www.adempiere.com/index.php/Script_Callout
http://www.adempiere.com/index.php/Rule_Engine_Implementation
https://scripting.dev.java.net/
http://www.adempiere.com/index.php/Callout
http://www.adempiere.com/index.php/Callout_Code
Hi Shiju,
Thanks for the info. Before asking, I saw these links.
I have some experience with BSH programming, I know performance won't be a problem here.
I would like to have some information about the available objects for the BSH script at runtime, since it is not documented in Adempiere wiki.
If I won't get an answer to my question: no problem. I will reverse engineer it , and create a documentation about it in my own wiki.
I don't think that my english would be so bad or my question would be so hard to understand, I just recognise this as an "insider info" that has "business value" so it is not published.
It's all understood now, thread closed.
Regards,
Akos
Hi Akos
I don't know exactly wether there is an "INSIDER INFO" as you claim.
To me its just like wether there is "Water in the MOON?"
Gabriel, about:
> "I don't think that my english would be
> so bad or my question would be so hard
> to understand, I just recognise this
> as an "insider info" that has
> "business value" so it is not
> published."
I see you blaming here and there for not getting the answers you want (and maybe this is related to your ask for me in twitter to answer here).
I don't think the problem is your english, or question hard to understand. Instead of I think your question is too general, it doesn't show you're doing your homework - this is researching and asking here specific problems you have.
I always hate the "please give me step by step instructions" kind of questions.
Your claim about "lack of documentation" is ignoring the fact that there are plenty of documentation and even working examples on your case.
And your claim that some "insider info" is not published trying to get business is just self-defeating, now I don't like to answer your questions :-(
Regards,
Carlos Ruiz
Ruiz and others,
(attention, long theoretical post follows)
The post is not directed to anyone, just should be considered maybe.
No, I'm not blaming for "not getting the answer". I would not blame at all if I don't get any answer. I understand, people have limited time and/or knowledge, and noone had the time+knowledge right now to answer my question.
But in this case I felt that I got a "pseudo answer", pointing me to the documentation I've already read (and I wrote that I'm through all the docs). These pseudo answers tell me that I should pay a bit and then I'd get the information. And this is irritating me, although I understand the motivation fully.
At this time I don't want to pay for this since I have the time and knowledge to find out myself sooner or later, without any external help. But then the question arises: if nobody invested the time to document what I ask for, why should I do that? More precisely: I'm kinda sure that documentation exists, it is just not published.
Documenting things to a certain level generates business, this is a good marketing strategy. Let"s call this level: medium.
Documenting things above this level (above medium) means less consulting need, thus less consulting hours sold. This is weakening the marketing strategy described before.
I can fully understand this strategy as well, just it has to be made clear. A lot of open-source projects (for example JasperReports) are doing this, I have no problem with this at all. It just has to be told clearly. Then I don't waste time asking and reading the useless (marketing) answers.
Regards,
Akos Gabriel
Carlos,
Answers I expected for my question:
Look at x and y clases in the source, their methods can be used within script callout. x class with context A, y class with context B.
And so on.
I've tried your example code and it works even for me.
I won't complain any more about documentation since I would be able to find my answer in the time I wrote my previous post.
Regards,
AKOS Gabriel
Gabriel,
> "These pseudo answers tell me that I
> should pay a bit and then I'd get the
> information"
I re-read (several times) the answers you got, and I didn't find anybody compelling you to pay anybody.
It's obvious knowledge costs - you can pay somebody to teach you, you can learn by yourself (in this case the cost is your time and effort), you can ask in forums hoping somebody know the answer and give it to you, or hoping some charitable soul do your homework.
There are plenty of options, and each option has an implied cost.
> "But then the question arises: if
> nobody invested the time to document
> what I ask for, why should I do that?"
Indeed is a really tricky selfish question, why should I wrote the scripting option for Adempiere and release it for you to use it?
Why did I took the time to write documentation for this development?
Why did I took the time to write even a working example to help you to understand?
Now, why must I help you to learn beanshell? What must be my motivation to let you learn something that you're going to exploit mostly for yourself, and probably not returning anything to Adempiere project?
Any time somebody ask me for SPECIFIC help about the scripting option I give help. But you're asking us to help you to learn a script language. And asking us for MORE documentation because you think somebody else must document it for you. And then you complain that you're not motivated to contribute documentation, even when you're using programs that others wrote.
Sorry, I don't like what I'm reading here.
> "Documenting things to a certain level
> generates business … Documenting
> things above this level … means less
> consulting need … I can fully
> understand this strategy as well, just
> it has to be made clear"
Gabriel, although I'm sure there are certain contributions described like you wrote, you must not generalize.
With these statements you're generalizing, and I think this is a very wide community. There are people that contribute a little and hide a lot, there are people that contribute a lot and hide a little, and there are people that contribute without hiding anything. (Well, and there are also people that hide everything)
It's not fair putting all developers, implementors and community on the same bag.
At least from my side, practically all my developments are documented in wiki, trackers, explained cases of use, samples, seed sample data, etc. So, I don't find fair your statements about this. I consider the documentation I provided for script callouts is enough, in this specific case going deep it's easier reading code than reading some documentation (that becomes obsolete easily).
Also you can take training on beanshell, but probably not here.
Anyways, I need to express also my opinion as I feel unfair these kind of statements.
Regards,
Carlos Ruiz