Error while running the precompileDecisionService Method

Posted by sjigesh on 08-Sep-2015 03:36

Hi All,

I want to convert the .ecore files to .xsd.As suggested by the team I have used precompileDecisionService to convert these files.However I m getting an error 

File (C:\test\ABC.ecore) does not point to an erf file.

Not sure whether I am using Correct method

Below is the Code that i am running

package com;


import com.corticon.eclipse.server.core.ICcServer;
import com.corticon.eclipse.server.core.impl.CcServerImpl;
import com.corticon.service.ccserver.exception.CcServerFileOrDirNotFoundException;
import com.corticon.service.ccserver.exception.CcServerInvalidArgumentException;
import com.corticon.service.ccserver.exception.CcServerInvalidDecisionServiceException;
import com.corticon.service.ccserver.exception.CcServerInvalidSandboxException;


public class TestPrecompile
{
public static void main(String[] args) {
TestPrecompile TCP = new TestPrecompile();
TCP.checkPrecimplileService();
}


public void checkPrecimplileService()
{
try
{
ICcServer server = new CcServerImpl();
server.precompileDecisionService("C:\\test\\SAFE.ecore","SAFE.xsd","C:\\test\\SAFE.xsd",true);
}
catch(CcServerFileOrDirNotFoundException e)
{
e.printStackTrace();
}


catch(CcServerInvalidArgumentException e)
{
e.printStackTrace();

}
catch(CcServerInvalidDecisionServiceException e)
{
e.printStackTrace();

} catch (CcServerInvalidSandboxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}
}

Error Details

Starting Progress Corticon Server : 5.4.1.0 -b6506
Progress Corticon Server log level : DIAGNOSTIC
Progress Corticon Server log path : C:/Users/......./logs
Progress Corticon Server sandbox location : C:/Users/......./CcServerSandbox

com.corticon.service.ccserver.exception.CcServerInvalidArgumentException: CcServerImpl.precompileDecisionService()(...) File (C:\test\ABC.ecore) does not point to an erf file.
Object state for: null: null
at com.corticon.eclipse.server.core.impl.CcServerImpl.precompileDecisionService(CcServerImpl.java:11874)
at com.corticon.eclipse.server.core.impl.CcServerImpl.precompileDecisionService(CcServerImpl.java:11826)
at com.TestPrecompile.checkPrecimplileService(TestPrecompile.java:25)
at com.TestPrecompile.main(TestPrecompile.java:16)

Plz help

All Replies

Posted by A_Haddad on 08-Sep-2015 04:08

Precompiling works on .erf rule-flow files (not .ecore files) and generates .eds files.

So the error you get is normal here : ((C:\test\ABC.ecore) does not point to an erf file.

I saw there is another method : iICcServer.getRulesetWSDL(string str) which returns a Document object.

This Document is the WSDL contract which contains the XSD structure used by a decision service.

This method supposes that you already have deployed (at least in-process) a decision service based on your vocabulary.

As you goal is to get only XSD description file, this is not the best way I think to get them with version 5.4.1.

I will look for another work-around. But it will not be simple I feel...

Posted by Jan Krishnamurthy on 08-Sep-2015 06:38

The precompiledecisionservice method can be used to convert precompile rule flow to eds. Not to get XSD from ecore



Sent via the Samsung GALAXY S® 5, an AT&T 4G LTE smartphone

Posted by sjigesh on 08-Sep-2015 09:00

Thanks Jan.

So is there some way where we can convert the ecore to xsd. If we can do it through UI , we should be able to do it programactically  as the UI might be Calling the some method/ proc to convert these files

Posted by Kendall Sparks on 08-Sep-2015 11:43

You should use the methods in CcDeploy (CcDeploy.jar) instead of the ones in CcServerImpl:
import com.corticon.eclipse.studio.deployment.swing.impl.CcDeploy;
 
To generate the XSD, you can use this method:
generateVocabularyXmlSchemaContract
 
There are also other methods for generating WSDLs and pre-compiling decision services.
 
[collapse]
From: sjigesh [mailto:bounce-sjigesh@community.progress.com]
Sent: Tuesday, September 08, 2015 1:37 AM
To: TU.Corticon@community.progress.com
Subject: [Technical Users - Corticon] Error while running the precompileDecisionService Method
 
Thread created by sjigesh

Hi All,

I want to convert the .ecore files to .xsd.As suggested by the team I have used precompileDecisionService to convert these files.However I m getting an error 

File (C:\test\ABC.ecore) does not point to an erf file.

Not sure whether I am using Correct method

Below is the Code that i am running

package com;


import com.corticon.eclipse.server.core.ICcServer;
import com.corticon.eclipse.server.core.impl.CcServerImpl;
import com.corticon.service.ccserver.exception.CcServerFileOrDirNotFoundException;
import com.corticon.service.ccserver.exception.CcServerInvalidArgumentException;
import com.corticon.service.ccserver.exception.CcServerInvalidDecisionServiceException;
import com.corticon.service.ccserver.exception.CcServerInvalidSandboxException;


public class TestPrecompile
{
public static void main(String[] args) {
TestPrecompile TCP = new TestPrecompile();
TCP.checkPrecimplileService();
}


public void checkPrecimplileService()
{
try
{
ICcServer server = new CcServerImpl();
server.precompileDecisionService("C:\\test\\SAFE.ecore","SAFE.xsd","C:\\test\\SAFE.xsd",true);
}
catch(CcServerFileOrDirNotFoundException e)
{
e.printStackTrace();
}


catch(CcServerInvalidArgumentException e)
{
e.printStackTrace();

}
catch(CcServerInvalidDecisionServiceException e)
{
e.printStackTrace();

} catch (CcServerInvalidSandboxException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

}
}

Error Details

Starting Progress Corticon Server : 5.4.1.0 -b6506
Progress Corticon Server log level : DIAGNOSTIC
Progress Corticon Server log path : C:/Users/......./logs
Progress Corticon Server sandbox location : C:/Users/......./CcServerSandbox

com.corticon.service.ccserver.exception.CcServerInvalidArgumentException: CcServerImpl.precompileDecisionService()(...) File (C:\test\ABC.ecore) does not point to an erf file.
Object state for: null: null
at com.corticon.eclipse.server.core.impl.CcServerImpl.precompileDecisionService(CcServerImpl.java:11874)
at com.corticon.eclipse.server.core.impl.CcServerImpl.precompileDecisionService(CcServerImpl.java:11826)
at com.TestPrecompile.checkPrecimplileService(TestPrecompile.java:25)
at com.TestPrecompile.main(TestPrecompile.java:16)

Plz help

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by A_Haddad on 08-Sep-2015 15:17

I just saw that there is also a batch file called "testDeployConsole.bat" under <Corticon5.4.1_server_install>\Server\bin directory that allows you controlling the Deployment Console through Java API calls. The option that can interest you is number "4 - Generate Vocabulary Schema".

Posted by sjigesh on 09-Sep-2015 14:49

Thanks everyone I am able to generate the ecore file to xsd

However I am facing an issue. The file that is generated after calling the method “generateVocabularyXmlSchemaContract” has a size less than the file generated by the console.

I have compared both the files(one generated by the method to the one generated by console) and it seems that xsd file generated through code has missed some statements

Not sure whether the parameters that I specified in the code are correct

Below are the details

package com;

import com.corticon.service.ccdeploy.exception.CcDeployFileOrDirNotFoundException;

import com.corticon.service.ccdeploy.exception.CcDeployInvalidArgumentException;

import com.corticon.service.ccdeploy.exception.CcDeployInvalidDecisionServiceException;

import com.corticon.eclipse.studio.deployment.swing.ICcDeploy;

import com.corticon.eclipse.studio.deployment.swing.impl.CcDeploy;

public class TestPrecompile

{

public static void main(String[] args) {

TestPrecompile TCP = new  TestPrecompile();

TCP.checkPrecimplileService();

}

public void checkPrecimplileService()

{

ICcDeploy deploy = new CcDeploy();

try {

deploy.generateVocabularyXmlSchemaContract("C:\\test\\ABC.ecore","","XML_HIER_STYLE","C:\\test");

} catch (CcDeployFileOrDirNotFoundException e) {

// TODO Auto-generated catch block

e.printStackTrace();

} catch (CcDeployInvalidArgumentException e) {

// TODO Auto-generated catch block

e.printStackTrace();

} catch (CcDeployInvalidDecisionServiceException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

}

}

File genarated via Console

Let me know if I need to do any modification

Posted by Chris S. Hogan on 09-Sep-2015 15:26

In the deployment console you have selected “Vocabulary Level” for the contract which means ALL elements in the Vocabulary are included. In the code you have executed the generateVocabularyXmlSchemaContract() method, which means ONLY elements used in the deployed decision service are included.
 
This is the reason the files are different sizes, and their contents differ.
 
Either behavior is available from the API as well as Deployment Console.
 
Christopher S. Hogan
Principal Systems Engineer

Progress

PHONE 646-201-4123
MOBILE 646-243-4282
www.progress.com
Twitter
Facebook
LinkedIn
Google+
 
 
[collapse]
From: sjigesh [mailto:bounce-sjigesh@community.progress.com]
Sent: Wednesday, September 09, 2015 2:50 PM
To: TU.Corticon@community.progress.com
Subject: RE: [Technical Users - Corticon] Error while running the precompileDecisionService Method
 
Reply by sjigesh

Thanks everyone I am able to generate the ecore file to xsd

However I am facing an issue. The file that is generated after calling the method “generateVocabularyXmlSchemaContract” has a size less than the file generated by the console.

I have compared both the files(one generated by the method to the one generated by console) and it seems that xsd file generated through code has missed some statements

Not sure whether the parameters that I specified in the code are correct

Below are the details

package com;

import com.corticon.service.ccdeploy.exception.CcDeployFileOrDirNotFoundException;

import com.corticon.service.ccdeploy.exception.CcDeployInvalidArgumentException;

import com.corticon.service.ccdeploy.exception.CcDeployInvalidDecisionServiceException;

import com.corticon.eclipse.studio.deployment.swing.ICcDeploy;

import com.corticon.eclipse.studio.deployment.swing.impl.CcDeploy;

public class TestPrecompile

{

public static void main(String[] args) {

TestPrecompile TCP = new  TestPrecompile();

TCP.checkPrecimplileService();

}

public void checkPrecimplileService()

{

ICcDeploy deploy = new CcDeploy();

try {

deploy.generateVocabularyXmlSchemaContract("C:\\test\\ABC.ecore","","XML_HIER_STYLE","C:\\test");

} catch (CcDeployFileOrDirNotFoundException e) {

// TODO Auto-generated catch block

e.printStackTrace();

} catch (CcDeployInvalidArgumentException e) {

// TODO Auto-generated catch block

e.printStackTrace();

} catch (CcDeployInvalidDecisionServiceException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

}

}

File genarated via Console

Let me know if I need to do any modification

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by Kendall Sparks on 09-Sep-2015 16:33

That method is correct for generating the vocabulary XSD.  The method for generating the decision level XSD is generateDecisionServiceXmlSchemaContract.
 
Can you share some examples of the differences between the XSD generated by Deployment Console and the API method?
 
[collapse]
From: Chris S. Hogan [mailto:bounce-chogan@community.progress.com]
Sent: Wednesday, September 09, 2015 1:27 PM
To: TU.Corticon@community.progress.com
Subject: RE: [Technical Users - Corticon] Error while running the precompileDecisionService Method
 
Reply by Chris S. Hogan
In the deployment console you have selected “Vocabulary Level” for the contract which means ALL elements in the Vocabulary are included. In the code you have executed the generateVocabularyXmlSchemaContract() method, which means ONLY elements used in the deployed decision service are included.
 
This is the reason the files are different sizes, and their contents differ.
 
Either behavior is available from the API as well as Deployment Console.
 
Christopher S. Hogan
Principal Systems Engineer
Progress

PHONE 646-201-4123
MOBILE 646-243-4282
www.progress.com
Twitter
Facebook
LinkedIn
Google+
 
 
[collapse]
From: sjigesh [mailto:bounce-sjigesh@community.progress.com]
Sent: Wednesday, September 09, 2015 2:50 PM
To: TU.Corticon@community.progress.com
Subject: RE: [Technical Users - Corticon] Error while running the precompileDecisionService Method
 
Reply by sjigesh

Thanks everyone I am able to generate the ecore file to xsd

However I am facing an issue. The file that is generated after calling the method “generateVocabularyXmlSchemaContract” has a size less than the file generated by the console.

I have compared both the files(one generated by the method to the one generated by console) and it seems that xsd file generated through code has missed some statements

Not sure whether the parameters that I specified in the code are correct

Below are the details

package com;

import com.corticon.service.ccdeploy.exception.CcDeployFileOrDirNotFoundException;

import com.corticon.service.ccdeploy.exception.CcDeployInvalidArgumentException;

import com.corticon.service.ccdeploy.exception.CcDeployInvalidDecisionServiceException;

import com.corticon.eclipse.studio.deployment.swing.ICcDeploy;

import com.corticon.eclipse.studio.deployment.swing.impl.CcDeploy;

public class TestPrecompile

{

public static void main(String[] args) {

TestPrecompile TCP = new  TestPrecompile();

TCP.checkPrecimplileService();

}

public void checkPrecimplileService()

{

ICcDeploy deploy = new CcDeploy();

try {

deploy.generateVocabularyXmlSchemaContract("C:\\test\\ABC.ecore","","XML_HIER_STYLE","C:\\test");

} catch (CcDeployFileOrDirNotFoundException e) {

// TODO Auto-generated catch block

e.printStackTrace();

} catch (CcDeployInvalidArgumentException e) {

// TODO Auto-generated catch block

e.printStackTrace();

} catch (CcDeployInvalidDecisionServiceException e) {

// TODO Auto-generated catch block

e.printStackTrace();

}

}

}

File genarated via Console

Let me know if I need to do any modification

Stop receiving emails on this subject.

Flag this post as spam/abuse.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse][/collapse]

Posted by sjigesh on 10-Sep-2015 14:46

Thanks everyone , the issue is resolved

should be

deploy.generateVocabularyXmlSchemaContract("C:\\test\\ABC.ecore","","HIER","C:\\test");#sthash.kBUfnVm9.dpuf

This thread is closed