Run Precompile method with Additional parameters

Posted by sjigesh on 17-Sep-2015 15:06

Hi All,

 I am able to convert an erf file to .eds programmatically (by using precompile method). However it differs slightly with the one that is generated through console.

I feel that if I add the below parameters to either the ICCServer/ICDeploy classes it will generate the same file as the one that is generated in the console

1)      Minimum Pool Size

2)      Maxximum Pool Size

3)      Dynamic Reload : Yes

4)      XML Messaging Style : Hier

 

Please assist on which class should I invoke or how should I make the precompile method run with the above 4 parameters

Below is the code that I am using

package com;

 

import cli.System.Console;

 

import com.corticon.eclipse.server.core.ICcServer;

import com.corticon.eclipse.server.core.impl.CcServerImpl;

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

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

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 CorticonEDS {

 

      public static void main(String[] args) throws CcServerInvalidSandboxException, CcServerFileOrDirNotFoundException, CcServerInvalidArgumentException, CcServerInvalidDecisionServiceException {

            CorticonEDS TC = new CorticonEDS();

            TC.preCompileService();

      }

public void preCompileService() throws CcServerInvalidSandboxException, CcServerFileOrDirNotFoundException, CcServerInvalidArgumentException, CcServerInvalidDecisionServiceException{

//    ICcDeploy d = CcDeployFactory.newDeployment();

 

      ICcServer d =new CcServerImpl();

     

           d.precompileDecisionService("C:\\ Rule_Flow \\P_Ruleflow.erf", "P_Ruleflow", "C:\\Rule_Flow", true);

 System.out.println("Completed");

   

 

}

     

     

}

 

All Replies

Posted by Chris S. Hogan on 17-Sep-2015 15:10

These properties are not specified at compile time, these properties are supplied at deployment time.
 
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: Thursday, September 17, 2015 3:07 PM
To: TU.Corticon@community.progress.com
Subject: [Technical Users - Corticon] Run Precompile method with Additional parameters
 
Thread created by sjigesh

Hi All,

 I am able to convert an erf file to .eds programmatically (by using precompile method). However it differs slightly with the one that is generated through console.

I feel that if I add the below parameters to either the ICCServer/ICDeploy classes it will generate the same file as the one that is generated in the console

1)      Minimum Pool Size

2)      Maxximum Pool Size

3)      Dynamic Reload : Yes

4)      XML Messaging Style : Hier

 

Please assist on which class should I invoke or how should I make the precompile method run with the above 4 parameters

Below is the code that I am using

package com;

 

import cli.System.Console;

 

import com.corticon.eclipse.server.core.ICcServer;

import com.corticon.eclipse.server.core.impl.CcServerImpl;

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

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

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 CorticonEDS {

 

      public static void main(String[] args) throws CcServerInvalidSandboxException, CcServerFileOrDirNotFoundException, CcServerInvalidArgumentException, CcServerInvalidDecisionServiceException {

            CorticonEDS TC = new CorticonEDS();

            TC.preCompileService();

      }

public void preCompileService() throws CcServerInvalidSandboxException, CcServerFileOrDirNotFoundException, CcServerInvalidArgumentException, CcServerInvalidDecisionServiceException{

//    ICcDeploy d = CcDeployFactory.newDeployment();

 

      ICcServer d =new CcServerImpl();

     

           d.precompileDecisionService("C:\\ Rule_Flow \\P_Ruleflow.erf", "P_Ruleflow", "C:\\Rule_Flow", true);

 System.out.println("Completed");

   

 

}

     

     

}

 

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by sjigesh on 18-Sep-2015 00:27

Then how does deployment console sets these parameters.

Cant we simulate the code so that it will work the same way as deployment console. I strongly feel that we are able to do it through console then there should be some way where we can do it through the code.The deploiyment console does invoke some piece of code . if we can do the same way ...we should be able to achieve the results

Cant we do something like

CcServerDeploymentObject CCDepObj = new CcServerDeploymentObject();

CCDepObj.setMaxPoolSize(5);

CCDepObj.setMinPoolSize(1);

CCDepObj.setAutoReloadRules(true);

CCDepObj.setMsgStructureType("Hier");

//CCDepObj.setVocabularyUri("C:\\Jigesh-HBE\\Dev1\\Source\\Business\\Eligibility\\EDBCBusinessRules\\Ky.Hbe.Edbc.Rules\\EDBC_R5\\Vocabulary\\SNAP.ecore");

ICC.precompileDecisionService("C:\\Jigesh-HBE\\Dev1\\Source\\Business\\Eligibility\\EDBCBusinessRules\\Ky.Hbe.Edbc.Rules\\EDBC_R5\\Rule_Flow\\SNAP_Ruleflow.erf", "SNAP_Ruleflow", "C:\\Jigesh-HBE\\Dev1\\Source\\Business\\Eligibility\\EDBCBusinessRules\\Ky.Hbe.Edbc.Rules\\EDBC_R5\\Rule_Flow", true);

Posted by Chris S. Hogan on 18-Sep-2015 09:41

The deployment console does 3 things. It can pre-compile the ERF to an EDS, it can generate an XSD/WSDL, and it can create a CDD file. The CDD file contains the information about pool size, auto-reload, etc. This CDD file is read during deployment time, not at compilation time.
 
If you want to specifiy this attributes programmatically then you need to do so when you deploy the decision service.
 
Take a look at the ICcServer API:
 
void addDecisionService(java.lang.String astrDecisionServiceName,
                      java.lang.String astrRuleAssetPath,
                      boolean abAutoReload,
                      int aiMinPoolSize,
                      int aiMaxPoolSize,
                      java.lang.String astrMsgStructStyle,
                      java.lang.String astrDatabaseAccessMode,
                      java.lang.String astrDatabaseAccessReturnEntities,
                      java.lang.String astrDatabaseAccessPropertiesPath)
                        throws CcServerDecisionServiceAlreadyRegisteredException,
                               CcServerFileOrDirNotFoundException,
                               CcServerInvalidArgumentException,
                               CcServerDatabaseValidationException,
                               CcServerInvalidDecisionServiceException,
                               CcServerLicenseViolationException
Invokes addDecisionService(astrDecisionServiceName, astrRuleAssetPath, abAutoReload, aiMinPoolSize, aiMaxPoolSize, astrMsgStructStyle, astrDatabaseAccessMode, astrDatabaseAccessReturnEntities, astrDatabaseAccessPropertiesPath, false)
Parameters:
astrDecisionServiceName - - logical name of the Decision Service (and thus corresponding Corticon Engine pool).
astrRuleAssetPath - - path to the Ruleflow .erf or pre-compiled .eds file containing the Decision Service rules.
abAutoReload - - set to true if this Corticon Engine pool should conduct a timestamp check to see, if rules have been modified and dynamically reload Decision Service as necessary. See startDynamicUpdateMonitoringService for more details.
aiMinPoolSize - - number of Corticon Engine instances to initialize the pool with
aiMaxPoolSize - - the maximum number of Corticon Engine instances the pool can grow to
astrMsgStructStyle - - type of XML Message used for the payload containing business object data. One of three values: XML_FLAT_STYLE, XML_HIER_STYLE, XML_STYLE_AUTODETECT (default)
astrDatabaseAccessMode - - this indicates what mode of database access the Decision Service is deployed with. One of three values: DATABASE_ACCESS_NONE, DATABASE_ACCESS_READ_ONLY, DATABASE_ACCESS_READ_WRITE
astrDatabaseAccessReturnEntities - - this determines which entity instances are retruned as part of the response Possible values: DATABASE_ACCESS_RETURN_ALL_ENTITY_INSTANCES, DATABASE_ACCESS_RETURN_INCOMING_NEW_ENTITY_INSTANCES
astrDatabaseAccessPropertiesPath - - path to the JDO runtime properties file containing DB connection info
 
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: Friday, September 18, 2015 12:28 AM
To: TU.Corticon@community.progress.com
Subject: RE: [Technical Users - Corticon] Run Precompile method with Additional parameters
 
Reply by sjigesh

Then how does deployment console sets these parameters.

Cant we simulate the code so that it will work the same way as deployment console. I strongly feel that we are able to do it through console then there should be some way where we can do it through the code.The deploiyment console does invoke some piece of code . if we can do the same way ...we should be able to achieve the results

Cant we do something like

CcServerDeploymentObject CCDepObj = new CcServerDeploymentObject();

CCDepObj.setMaxPoolSize(5);

CCDepObj.setMinPoolSize(1);

CCDepObj.setAutoReloadRules(true);

CCDepObj.setMsgStructureType("Hier");

//CCDepObj.setVocabularyUri("C:\\Jigesh-HBE\\Dev1\\Source\\Business\\Eligibility\\EDBCBusinessRules\\Ky.Hbe.Edbc.Rules\\EDBC_R5\\Vocabulary\\SNAP.ecore");

ICC.precompileDecisionService("C:\\Jigesh-HBE\\Dev1\\Source\\Business\\Eligibility\\EDBCBusinessRules\\Ky.Hbe.Edbc.Rules\\EDBC_R5\\Rule_Flow\\SNAP_Ruleflow.erf", "SNAP_Ruleflow", "C:\\Jigesh-HBE\\Dev1\\Source\\Business\\Eligibility\\EDBCBusinessRules\\Ky.Hbe.Edbc.Rules\\EDBC_R5\\Rule_Flow", true);

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]

Posted by Jan Krishnamurthy on 18-Sep-2015 10:17

As mentioned in the discussion thread Automate (community.progress.com/.../20064.aspx)

Please review KB article below for detailed API methods:

knowledgebase.progress.com/.../000057671

knowledgebase.progress.com/.../000050949

- Jan

Posted by sjigesh on 19-Sep-2015 15:58

Thanks Jan and Chris. I am able to generate .eds file using addDecisonService and Precompile methods.

However I am still unable to figure out that the eds file that is generated through console does not exactly match with one that is generated through precompile/addDecison service method for the same erf file.

File Size for eds generated through console is 12.2 MB

File Size for eds generated through precompile/addDecision service is 12.5 MB

Is there any way I can analyze and find out or any solution through which I create same file programmatically so that it will exactly match with the one that is generated through Console  

Posted by James Arsenault on 20-Sep-2015 23:41

The .eds files are zip files. You should be able to open them with 7zip or similar. Extract both .eds files to a folder and perform a comparison.
 
Jim
 

This thread is closed