use of com.centurylink.mdw.model.value.variable.VariableTypeVO in project mdw-designer by CenturyLinkCloud.
the class PluginDataAccess method getVariableTypes.
public List<VariableTypeVO> getVariableTypes(boolean reload) {
if (reload || varTypes == null) {
try {
if (MdwPlugin.getActiveWorkbenchWindow() != null)
designerDataModel.reloadVariableTypes(designerDataAccess);
List<VariableTypeVO> cleanedUpVarTypes = new ArrayList<>();
if (workflowProject.checkRequiredVersion(6, 0)) {
for (VariableTypeVO varType : designerDataModel.getVariableTypes()) {
switch(varType.getVariableType()) {
case "java.lang.String[]":
case "java.lang.Integer[]":
case "java.lang.Long[]":
case "java.util.Map":
case "com.centurylink.mdw.model.FormDataDocument":
case "com.centurylink.mdw.common.service.Jsonable":
break;
default:
cleanedUpVarTypes.add(varType);
}
}
} else {
for (VariableTypeVO varType : designerDataModel.getVariableTypes()) {
switch(varType.getVariableType()) {
case "java.lang.Exception":
case "com.centurylink.mdw.model.Jsonable":
break;
default:
cleanedUpVarTypes.add(varType);
}
}
}
designerDataModel.setVariableTypes(cleanedUpVarTypes);
varTypes = designerDataModel.getVariableTypes();
Collections.sort(varTypes, new Comparator<VariableTypeVO>() {
public int compare(VariableTypeVO varType1, VariableTypeVO varType2) {
return varType1.getVariableTypeId().compareTo(varType2.getVariableTypeId());
}
});
} catch (Exception ex) {
PluginMessages.uiError(ex, "Load Variable Types", workflowProject);
}
}
return varTypes;
}
use of com.centurylink.mdw.model.value.variable.VariableTypeVO in project mdw-designer by CenturyLinkCloud.
the class VariableHelper method isDocumentVariable.
/**
* Check if the variable type is of a document.
* Custom variable translators must be loaded from server to make
* the decision precise.
*
* @param vartype
* @param dao
* @return
*/
public static boolean isDocumentVariable(String vartype, DesignerDataAccess dao) {
VariableTranslator translator;
VariableTypeVO vo = VariableTypeCache.getVariableTypeVO(vartype);
if (vo == null)
return false;
try {
Class<?> cl = Class.forName(vo.getTranslatorClass());
translator = (VariableTranslator) cl.newInstance();
} catch (Exception e) {
e.printStackTrace();
return false;
}
return (translator instanceof DocumentReferenceTranslator);
}
use of com.centurylink.mdw.model.value.variable.VariableTypeVO in project mdw-designer by CenturyLinkCloud.
the class WorkflowAccessRest method getVariableTypes.
public List<VariableTypeVO> getVariableTypes() throws DataAccessException {
try {
String variableTypesJson = getServer().invokeResourceService("BaseData/VariableTypes?format=json");
JSONArray jsonArray = new JSONArray(variableTypesJson);
List<VariableTypeVO> variableTypes = new ArrayList<VariableTypeVO>();
for (int i = 0; i < jsonArray.length(); i++) variableTypes.add(new VariableTypeVO(jsonArray.getJSONObject(i)));
return variableTypes;
} catch (Exception ex) {
throw new DataAccessException("Error retrieving variable types", ex);
}
}
Aggregations