Re: [rules-users] Guvnor REST api, compile package

2013-09-09 Thread anchi
I could not figure out why compile is not working. I solved it by changing
Guvnor source - i removed 'is up to date' check.

Now I have one more concern, is there a REST method to delete snapshot?
Documentation mentions just snapshot creation.



--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-REST-api-compile-package-tp4025756p4025872.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Guvnor REST api, compile package

2013-09-04 Thread anchi
Ok, I somehow managed to resolve question 3 and 3.a. But questions 1. and 2.
remain, please point me to the right direction.

What I need is to build a package and if build was successful then create a
new snapshot.
My problem is how to build a package?

I found out that creating a new snapshot by calling
.../rest/packages/{packageName}/snapshot/{snapshotName} *sometimes* triggers
package build. But I cannot figure out how is this determined?

What I've found out is:
1. Approach that doesn't work:
  - update package version by sending modified package metadata to
.../rest/packages/{packageName} (I basically just change package
description)
  - then trigger creation of new snapshot with REST request
It does not compile the package

2. Approach that works:
 - click Save in Guvnor console (which changes package version)
 - then trigger creation of new snapshot with REST request
Package is compiled

So where is the catch? How can I make sure that package is built before
creating a snapshot?
I don't really see a point of having a REST interface if it still requires
to use Guvnor console for being able to use a knowledge base packages




--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-REST-api-compile-package-tp4025756p4025811.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Guvnor REST api, compile package

2013-09-04 Thread anchi
Thanks for your answer.
Yes, I've just tried this, it doesn't work.

In this part where it says ...or its binary is not up to date..., it does
not clearly say what criteria is used to determine that binary is not up to
date.

So this is my use case scenario:
1. I have a package that compiles
2. I'm using Guvnor plugin for Eclipse to update one of the assets (BPMN
file) with a new version that will cause compile errors
3. Now I try to create a snapshot with REST call and I want to get a compile
error (since package cannot compile anymore)

But Guvnor just doesn't detect the change (although I can see in console
that version number has changed for my asset, but not for the package).



--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-REST-api-compile-package-tp4025756p4025813.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Guvnor - support for custom file extensions

2012-05-21 Thread anchi
Just a feedback if somebody will need to add custom extensions.
This was our requirement: We have custom extensions for BPMN2 diagrams and
we needed Guvnor to include our diagrams when building a package. There were
just a few small changes required to achieve it:

-registering extensions in org.drools.guvnor.client.common.AssetFormats
-change
org.drools.guvnor.client.common.AssetFormats.convertAssetFormatToResourceType(..)
-register content handler in contenthandler.properties
-minor chnages in org.drools.guvnor.server.contenthandler.drools.
BPMN2ProcessHandler.storeAssetContent(..)

And that is it! :)
This will only affect package builder. Assets will still appear under Other
assets category when listing all package assets. I haven't explored how to
change this. Also it is useful to register default editor for your assets
(in this case that would be BPMN2 editor) in asseteditors.xml.


--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-support-for-custom-file-extensions-tp3970683p4004788.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Building Guvnor from source

2012-05-18 Thread anchi
Thanks. It works after setting this in run configuration:
-Xmx1500M -XX:MaxPermSize=512m

There is a note about setting VM arguments in eclipse.ini file (which is
only used for launching Eclipse). But it doesn't say about setting it in run
configuration. Maybe you might update it with this info. 

--
View this message in context: 
http://drools.46999.n3.nabble.com/Building-Guvnor-from-source-tp3999132p4000581.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Building Guvnor from source

2012-05-17 Thread anchi
Hi!

I'm trying to build Guvnor from source. I have followed instructions listed
here:
https://github.com/droolsjbpm/droolsjbpm-build-bootstrap/blob/master/README.md

I am able to start the application. After clicking on URL in Development
Mode tab, Guvnor app starts to load but after a few seconds becomes
unresponsive and I get an OutOfMemoryException:
 [org.drools.guvnor.Guvnor] Out of memory; to increase the amount of memory,
use the -Xmx flag at startup (java -Xmx128M ...)

I have increased VM memory, however, no matter how much memory I give, it
always throws this exception.

I get this output in the console:
WARN  17-05 16:14:26,525
(RulesRepositoryManager.java:createRulesRepository:65)   Creating
RulesRepository with default username.
INFO  17-05 16:14:26,530 (RulesRepositoryConfigurator.java:getInstance:46)  
Creating an instance of the RulesRepositoryConfigurator.
WARN  17-05 16:14:30,598
(RulesRepositoryManager.java:createRulesRepository:65)   Creating
RulesRepository with default username.
WARN  17-05 16:14:31,764
(RulesRepositoryManager.java:createRulesRepository:65)   Creating
RulesRepository with default username.

Any suggestions?

--
View this message in context: 
http://drools.46999.n3.nabble.com/Building-Guvnor-from-source-tp3999132.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Guvnor REST API and XLS decision tables

2012-05-17 Thread anchi
Thanks, I'll listen to your advice and switch to downloading binary asset
content.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-REST-API-and-XLS-decision-tables-tp3985574p3999138.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Guvnor REST API and XLS decision tables

2012-05-16 Thread anchi
No it is not corrupted, I've uploaded it through Guvnor web console. When I
download it directly through Guvnor UI, I get a valid file.

Also when I reach it through REST API using:
http://{guvnor_url}/rest/packages/{package}/assets/{xls_name}/binary , I
also get a valid file.

The only case when I get a corrupted file is when I use:
http://{guvnor_url}/rest/packages/{package}/assets/{xls_name}/source

I have adjusted my application to check for this special case, and when file
extension is .xls i use /binary URL (for other assets I'm using /source
url), but I'm still interested on how to get xls through REST api using
http://{guvnor_url}/rest/packages/{package}/assets/{xls_name}/source

--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-REST-API-and-XLS-decision-tables-tp3985574p3996565.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Guvnor REST API and XLS decision tables

2012-05-15 Thread anchi
Thanks for your reply. Things are clearer now! For some reason I expected
inverse behavior for /binary and /source, but now you've made it clear.

I have tried your advice to open a file returned from REST /source with
Excel. After renaming it (adding a proper file extension), Excel is not able
to open it, i.e. a file I get from Guvnor is corrupted which causes kbuilder
exceptions.

--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-REST-API-and-XLS-decision-tables-tp3985574p3987808.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Guvnor - support for custom file extensions

2012-05-14 Thread anchi
Nobody?

--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-support-for-custom-file-extensions-tp3970683p3985342.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


Re: [rules-users] Guvnor - support for custom file extensions

2012-05-14 Thread anchi
Thank you very much, I'll take a look at this!

--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-support-for-custom-file-extensions-tp3970683p3985455.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Guvnor REST API and XLS decision tables

2012-05-14 Thread anchi
Hi!

I'm wondering how does Guvnor REST api handle Excel decision tables? I'm
using 5.3.1.Final version.

It seems that when I use url for binary e.g.
/http://{guvnor_url}/rest/packages/package_name/assets/excel_table_name/binary/
, I get a source (.xls) file.
And when I use source url e.g.
/http://{guvnor_url}/rest/packages/package_name/assets/excel_table_name/source/
, I get a binary file.
Is this some bug or is it really expected to work this way?


Also, when I try to build binary file (which I get using source url:) )
using knowledge builder I'm getting exceptions, I have tried it in two ways:

1. kbuilder.add(urlResource, ResourceType.DTABLE);

Exception in thread main
org.drools.template.parser.DecisionTableParseException: An error occurred
opening the workbook. It is possible that the encoding of the document did
not match the encoding of the reader.
at
org.drools.decisiontable.parser.xls.ExcelParser.parseFile(ExcelParser.java:90)
at
org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:89)
at
org.drools.decisiontable.SpreadsheetCompiler.compile(SpreadsheetCompiler.java:68)
at
org.drools.decisiontable.DecisionTableProviderImpl.compileStream(DecisionTableProviderImpl.java:38)
at
org.drools.decisiontable.DecisionTableProviderImpl.loadFromInputStream(DecisionTableProviderImpl.java:21)
at
org.drools.compiler.DecisionTableFactory.loadFromInputStream(DecisionTableFactory.java:18)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:613)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:37)
at Main.main(Main.java:101)
Caused by: jxl.read.biff.BiffException: Unable to recognize OLE stream
at jxl.read.biff.CompoundFile.init(CompoundFile.java:116)
at jxl.read.biff.File.init(File.java:127)
at jxl.Workbook.getWorkbook(Workbook.java:268)
at
org.drools.decisiontable.parser.xls.ExcelParser.parseFile(ExcelParser.java:75)
... 8 more


2. kbuilder.add(urlResource, ResourceType.DRL);

java.lang.IndexOutOfBoundsException: Index: 693, Size: 693
at java.util.ArrayList.get(ArrayList.java:352)
at org.antlr.runtime.CommonTokenStream.LT(CommonTokenStream.java:103)
at org.drools.lang.ParserHelper.reportError(ParserHelper.java:386)
at org.drools.lang.DRLParser.compilationUnit(DRLParser.java:182)
at org.drools.compiler.DrlParser.compile(DrlParser.java:225)
at org.drools.compiler.DrlParser.parse(DrlParser.java:136)
at org.drools.compiler.DrlParser.parse(DrlParser.java:141)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:394)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:586)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:37)
at Main.main(Main.java:101)
Exception in thread main java.lang.RuntimeException:
org.drools.compiler.DroolsParserException: Unexpected exception raised while
parsing. This is a bug. Please contact the Development team :
Index: 693, Size: 693
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:692)
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:37)
at Main.main(Main.java:101)
Caused by: org.drools.compiler.DroolsParserException: Unexpected exception
raised while parsing. This is a bug. Please contact the Development team :
Index: 693, Size: 693
at org.drools.compiler.DrlParser.compile(DrlParser.java:242)
at org.drools.compiler.DrlParser.parse(DrlParser.java:136)
at org.drools.compiler.DrlParser.parse(DrlParser.java:141)
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:394)
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:586)
... 2 more


--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-REST-API-and-XLS-decision-tables-tp3985574.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users


[rules-users] Guvnor - support for custom file extensions

2012-05-08 Thread anchi
Hi!

I need to extend Guvnor to support custom file extensions for BPMN
processes. So instead of using /.bpmn/ or /.bpmn2/ we need to use our
own file extensions. At the moment Guvnor just assumes them the to be /Other
assets/ and ignores them when building a package.

I plan to change Guvnor source to achieve this. I would appreciate if I get
some guidelines from dev-team, what classes do I have to change. Since you
have recently been adding support for /.bpmn2/ extension, I guess you
could give me some hints.
I found out that I have to add my extensions to
/org.drools.guvnor.client.common.AssetFormats/, change
/org.drools.guvnor.server.builder.AssetItemValidator/ and
/org.drools.guvnor.server.verification.AssetVerifier/ . Is there something
else?


Thanks!

--
View this message in context: 
http://drools.46999.n3.nabble.com/Guvnor-support-for-custom-file-extensions-tp3970683.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
___
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users