sugarcrm: run java script from custom logic hook

 

 

<?php
if(!defined('sugarEntry') || !sugarEntry) die('Not A Valid Entry Point');

class idempiere_sync {

function idempiere_sync(&$bean, $event, $arguments)

{
require_once('log4php/LoggerManager.php');

$JAVA_HOME = "/usr/lib/jvm/java-8-openjdk-amd64";
$PATH = "$JAVA_HOME/bin:/usr/local/bin:/usr/bin:/bin";
putenv("JAVA_HOME=$JAVA_HOME");
putenv("PATH=$PATH");

$output = shell_exec('/home/Scripts/talend/iDempiere/SugarCRM/CRM_iDempiere/CRM_iDempiere_run.sh');
echo $output;

}
}

?>

Leave a Reply

Your email address will not be published. Required fields are marked *