use of org.wso2.ballerinalang.util.Lists in project carbon-business-process by wso2.
the class HumanTaskPackageManagementSkeleton method listTasksInPackage.
/**
* Lists the tasks in the given package name.
*
* @param packageName : The name of the package to list task definitions.
* @return : The Task_type0 array containing the task definition information.
*/
public Task_type0[] listTasksInPackage(String packageName) throws PackageManagementException {
if (StringUtils.isEmpty(packageName)) {
throw new IllegalArgumentException("The provided package name is empty!");
}
try {
List<SimpleTaskDefinitionInfo> taskDefsInPackage = getTenantTaskStore().getTaskConfigurationInfoListForPackage(packageName);
Task_type0[] taskDefArray = new Task_type0[taskDefsInPackage.size()];
int i = 0;
for (SimpleTaskDefinitionInfo taskDefinitionInfo : taskDefsInPackage) {
taskDefArray[i] = createTaskTypeObject(taskDefinitionInfo);
i++;
}
return taskDefArray;
} catch (Exception ex) {
String errMsg = "listTasksInPackage operation failed";
log.error(errMsg, ex);
throw new PackageManagementException(errMsg, ex);
}
}
Aggregations