public static void main(Args _args)
{
EUK_AddBatchJobToRoleController addBatchJobToRoleController;
EUKMatrixRoleCreateRole eukMatrixRoleCreateRole;
EUK_AddBatchJobToRoleContract addBatchJobToRoleContract;
str CompanyId;
Args argsGenerationFromMatrix;
Description description;
EUKMatrixNum matrixID;
EUKMatrixName matrixName;
EUKVersionNum numVersion;
Str130 roleName;
EUKSecurityRole eukSecurityRole;
eukMatrixRoleVersion eukMatrixRoleVersion;
EUKHistoric historic;
EUKMatrixRole eukMatrixRole;
utcDateTime dateTime;
FormRun callerForm;
EUKRole eukRole;
;
dateTime = DateTimeUtil::utcNow();
// create a new instance of the controller
addBatchJobToRoleController = new EUK_AddBatchJobToRoleController();
// initialize from args
// one of the things this will do is read the "parameters" property from the menu item
addBatchJobToRoleController.initializeFromArgs(_args);
CompanyId = CompanyInfo::Find().DataArea;
argsGenerationFromMatrix = new Args();
argsGenerationFromMatrix.name(formstr(EUKMatrixRoleGenerationFromMatrix));
if(_args.caller() && _args.record() && _args.record().TableId == tableNum(EUKMatrixRoleVersion))
{
callerForm = _args.caller();
eukMatrixRoleVersion = _args.record();
eukMatrixRoleCreateRole = EUKMatrixRoleCreateRole::constructFromArgs(_args);
eukMatrixRole = eukMatrixRoleCreateRole.eukMatrixRole();
select firstonly eukRole where eukRole.RelatedMatrix == eukMatrixRole.MatrixID;
addBatchJobToRoleContract = addBatchJobToRoleController.getDataContractObject('_addBatchJobToRoleContract');
matrixID = addBatchJobToRoleContract.parmMatrixNum(eukMatrixRole.MatrixID);
matrixName = addBatchJobToRoleContract.parmMatrixName(eukMatrixRole.MatrixName);
numVersion = addBatchJobToRoleContract.parmVersionNum(eukMatrixRoleVersion.VersionNumber);
if(eukRole)
{
roleName = addBatchJobToRoleContract.parmRoleName(eukRole.Name);
description=addBatchJobToRoleContract.parmDescription(strFmt("@EUK269", addBatchJobToRoleContract.parmRoleName(eukRole.Name)));
}
else
{
roleName = addBatchJobToRoleContract.parmRoleName(CompanyId "-" addBatchJobToRoleContract.parmMatrixName(eukMatrixRole.MatrixName));
description=addBatchJobToRoleContract.parmDescription(strFmt("@EUK272",roleName));
}
addBatchJobToRoleController.startOperation();
if(eukRole)
{
eukSecurityRole = EUKSecurityRole::construct(roleName, eukMatrixRoleVersion);
eukSecurityRole.cleanRole();
eukSecurityRole.updateRole(eukMatrixRoleVersion);
info("@EUK270");
historic.fillHistoric(EUKTypeAction::MAJRole,description,curUserId(),dateTime,EUKMatrixRole.MatrixID);
new MenuFunction(menuitemDisplayStr(EUKMatrixRoleGenerationFromMatrix),MenuItemType::Display).run();
}
else
{
eukSecurityRole = EUKSecurityRole::construct(roleName, eukMatrixRoleVersion);
eukSecurityRole.createRole(eukMatrixRoleVersion);
eukSecurityRole.updateRole(eukMatrixRoleVersion);
info("@EUK273");
historic.fillHistoric(EUKTypeAction::GenerationRole,description,curUserId(),dateTime,EUKMatrixRole.MatrixID);
new MenuFunction(menuitemDisplayStr(EUKMatrixRoleGenerationFromMatrix),MenuItemType::Display).run();
if(callerForm && (callerForm.name() == formStr(EUKMatrixRoleVersion)) && formHasMethod(callerForm,identifierStr(updateDesign)))
{
_args.caller().updateDesign();
EUKMatrixRole::updateCallers(callerForm,_args,eukMatrixRoleVersion);
}
}
}
}
The code after the instruction start() operation , i want to execute it in batch n how can I do that?
Thanks