Triniti API‎ > ‎

Framework API


Invoke an Operation in Workflow

Pre-requisite for using the below API is framework-api.jar which should be available in the CLASSPATH

ServerSideProxy serversideProxy = ServerSideProxy.instance();
serversideProxy.connectToServer("http://<domain>:<port>/<tabimpl_context>/StateGpsServlet");

Hashtable inHashtable = new Hashtable();
/*
* Mandatory key and value pairs in the inHashtable to call required Operation in the Workflow
*/
eDynamo.classes.leaveapplication.EmpLeaveDataBean leaveBean = new EmpLeaveDataBean();
leaveBean.FromDate = <FromDateValue>;
leaveBean.ToDate = <ToDateValue>;
leaveBean.reason = "<Reason>";

inHashtable.put("username",<user>);
inHashtable.put("userobject",leaveBean);
inHashtable.put("operationid",<operationid>);
inHashtable.put("nodetype", <nodetype>);
inHashtable.put("workflowtypename", <workflow>);
inHashtable.put("applicationname", <application>);

/*
* outHashtable key and value pairs can be expected after the call
* In outHashtable, data key contains return message and showHtmlContent contains boolean.
*/
Hashtable outHashtable = serversideProxy.invokeFlushController(inHashtable);

Invoke Application Get Controller - Invoking Get Controller which is assigned to an application

Pre-requisite for using the below API is framework-api.jar which should be available in the CLASSPATH

ServerSideProxy serversideProxy = ServerSideProxy.instance();
serversideProxy.connectToServer("http://<domain>:<port>/<tabimpl_context>/StateGpsServlet");

Hashtable inHashtable = new Hashtable();
/*
* Mandatory key and value pairs in the inHashtable to call required Application Get Controller
*/
eDynamo.classes.SG_TRI2_ENTITY issueObject= new SG_TRI2_ENTITY();
issueObject.IA_ISSUE_NUMBER= <Issue Number>;
issueObject.IA_ISSUE_TITLE= "<Issue Title>";

inHashtable.put("username",<user>);
inHashtable.put("userobject",issueObject);
inHashtable.put("getController",<getController>);

Object completeUserObject = serversideProxy.invokeGetController(inHashtable);

Embed eWorksheet URL in a web page / email

http://<host>:<port>/jsp/applicationlinkjsp/tabviewer.jsp launches the given eWorksheet by passing the respective eWorksheet details in the Query String of the URL. The following URL is an example of eWorksheet link provided in Appraisal System email.

$CONTEXT_PATH$/jsp/applicationlinkjsp/tabviewer.jsp?emailid=$AppraisalDataBean.Mentor_Mail$&applicationName=Employee Information System&viewerSet=Employee Appraisal Worksheets&viewer=Mentor Review and Update&parametername=EMP_APPRAISAL_ID&parametervalue=$AppraisalDataBean.Appraisal_ID$&instanceId=$INSTANCE_ID$ &operationId=$Update Completed$.$OPERATION_NAME$

 Query String Parameter Mandatory / Optional  Description
emailid Mandatory Email id of the user, system will validate and verify the respective email id users access to the given eWorksheet. The value can be a bean variable token.
username Mandatory System will validate and verify the users access to the given eWorksheet. The value can be a bean variable token. Either emailid or username should be available in the URL's query string.
applicationName Mandatory Application where the required eWorksheet is available
viewerSet Mandatory Folder where the required eWorksheet is available
viewer Mandatory Required eWorksheet to be launched
parametername Optional Parameter name whose value will be set to parametervalue in the URL dynamically and the combination of parametername and parametervalue will be passed to system to query the eWorksheet data
parametervalue Optional Actual value of the field which is set in the parametername. The value can be a bean variable token.
instanceId Optional Workflow instance id for this record. The value can be a standard token - $INSTANCE_ID$.
operationId Optional Workflow operation for this record. The value can be a standard operation token - $<STATENAME>$.$OPERATION_NAME$.
WhereCondition Optional Dynamic Where Clause which can contains AND, OR and grouping where conditions. This where clause will be set to query dynamically before execution
viewType Optional Value should be either ADF View or Java View to launch the eWorksheet in either HTML or Java. Default value is Java if this parameter is not set in the query string.

Get Auto Number next value

Pre-requisite for using the below API is framework-api.jar which should be available in the CLASSPATH

AutoNumbersAPI autoNumberAPI = new AutoNumbersAPI("http://<domain>:<port>/<tabimpl_context>/StateGpsServlet");

/**
* Add list of auto number names in this vector to fetch respective auto number values
*/
Vector autoNumberNameVector = new Vector();
autoNumberNameVector.add("<autonumbername>");

/**
* Return Hashtable contains list of auto number names as keys and respective next number values as values
*/
Hashtable autoNumberHash = autoNumberAPI.getNextNumbers(autoNumberNameVector);

Get the list of Categories assigned to an Application & User

Pre-requisite for using the below API is framework-api.jar which should be available in the CLASSPATH

ServerSideProxy serversideProxy = ServerSideProxy.instance();
serversideProxy.connectToServer("http://<domain>:<port>/<tabimpl_context>/StateGpsServlet");
Category category = serversideProxy.getCategoryForAnApplication ("<Username>", "<Application Name>");

Get the list of Models assigned to an Application & Category

Pre-requisite for using the below API is  framework-api.jar which should be available in the CLASSPATH

ServerSideProxy serversideProxy = ServerSideProxy.instance();
serversideProxy.connectToServer("http://<domain>:<port>/<tabimpl_context>/StateGpsServlet");
Vector modelsVector = serversideProxy.getModelsForTheCategory("<Application Name>", "<Category Name>", "<Username>", null, null, null);

Get the list of versions of a Model in a Category

Pre-requisite for using the below API is  framework-api.jar which should be available in the CLASSPATH

ServerSideProxy serversideProxy = ServerSideProxy.instance();
serversideProxy.connectToServer("http://<domain>:<port>/<tabimpl_context>/StateGpsServlet");
Vector versionsVector = serversideProxy.getVersionIdFromDataBase("<Model Name>", "<Category Name>");

Get Application Id of an Application

Pre-requisite for using the below API is  framework-api.jar which should be available in the CLASSPATH

ServerSideProxy serversideProxy = ServerSideProxy.instance();
serversideProxy.connectToServer("http://<domain>:<port>/<tabimpl_context>/StateGpsServlet");
Integer applicationId = serversideProxy.getApplicationId("<Application Name">, "<UserName>", false);

Get the Query Dialog FDT & Get Controller of an Application

Pre-requisite for using the below API is  framework-api.jar, gpsclient.jar & tabdataclasses.jar which should be available in the CLASSPATH

ServerSideProxy serversideProxy = ServerSideProxy.instance();
serversideProxy.connectToServer("http://<domain>:<port>/<tabimpl_context>/StateGpsServlet");
Hashtable userDetailsHashtable = new Hashtable();
userDetailsHashtable.put("applicationName","<Application Name>");
userDetailsHashtable.put("userName","<Username>");
userDetailsHashtable.put("getuserprofilesettings",Boolean.TRUE);
Hashtable userProfileHashtable = serversideProxy.getUserProfileObject(userDetailsHashtable);
Vector userProfileObjectVector = (Vector) userProfileHashtable.get("UserProfileObjectVector");
UserProfile userProfile = (UserProfile) userProfileObjectVector.get(0);
Vector t_gps_user_rolesVector = userProfile.getRoleObjects();
T_GPS_USER_ROLES t_gps_user_roles = (T_GPS_USER_ROLES) t_gps_user_rolesVector.get(0);
T_GPS_ROLE_APPLICATION t_gps_role_application = t_gps_user_roles.t_gps_role_application[0];
T_GPS_APPLICATION_PROP t_gps_application_prop = t_gps_role_application.t_gps_application_prop;
Hashtable fdtAliasAndFileNameHashtable = t_gps_application_prop.fdtAliasAndFileNameHashtable;
Hashtable getControllerAliasHashtable = t_gps_application_prop.getControllerAliasHashtable;

Get the Bean Class & its Properties configured for Query Dialog of an Application

Pre-requisite for using the below API is  framework-api.jar & tabdataclasses.jar which should be available in the CLASSPATH

In general, whenever query dialog of an application is opened, it open the dialog by showing required bean class properties and upon selecting required values from LOV and submit, it prepares an object for the bean class by setting the selected values, and calls the get controller by passing the user object in a model based on the relation framework.

ServerSideProxy serversideProxy = ServerSideProxy.instance();
serversideProxy.connectToServer("http://<domain>:<port>/<tabimpl_context>/StateGpsServlet");
Hashtable paramHashtable = new Hashtable();
paramHashtable.put("applicationId", new Integer(<Application Id>));
paramHashtable.put("fdtFileName", "<FDT File Name");
Hashtable returnHashtable = serversideProxy.getWorkFlowInstance(paramHashtable);
        
T_GPS_WORKFLOW_INSTANCES instances = (T_GPS_WORKFLOW_INSTANCES) returnHashtable.get("response");

String beanClassName = instances.EDYNAMO_CLASS;
        
T_GPS_WF_INSTANCE_CLASSES[] t_gps_wf_instance_classes = instances.t_gps_wf_instance_classes;
T_GPS_WF_INSTANCE_CLASSES each_t_gps_wf_instance_classes = null;
        
T_GPS_WF_INST_CLASS_PROPS[] t_gps_wf_inst_class_props;
T_GPS_WF_INST_CLASS_PROPS each_t_gps_wf_inst_class_props;
        
for (int outer_index = 0; outer_index < t_gps_wf_instance_classes.length; outer_index++) {
    each_t_gps_wf_instance_classes = t_gps_wf_instance_classes[outer_index];
    t_gps_wf_inst_class_props = each_t_gps_wf_instance_classes.t_gps_wf_inst_class_props;
    for (int inner_index = 0; inner_index < t_gps_wf_inst_class_props.length; inner_index++) {
        each_t_gps_wf_inst_class_props = t_gps_wf_inst_class_props[inner_index];
        //each_t_gps_wf_inst_class_props.PROPERTY_NAME is class property name
        //each_t_gps_wf_inst_class_props.ALIAS_NAME is Display name in Query Dialog
        //each_t_gps_wf_inst_class_props.FDT_PARAMETER is a Parameter of FDT
        System.out.println(each_t_gps_wf_inst_class_props.PROPERTY_NAME + " : " + 
        each_t_gps_wf_inst_class_props.ALIAS_NAME + " : " + 
        each_t_gps_wf_inst_class_props.FDT_PARAMETER);
}
}
Comments