use of org.wso2.carbon.humantask.client.api.types in project carbon-business-process by wso2.
the class HumanTaskDAOConnectionImpl method getDeploymentUnit.
public DeploymentUnitDAO getDeploymentUnit(int tenantId, String md5sum) {
Query q = entityManager.createQuery("select hu from org.wso2.carbon.humantask.core.dao.jpa.openjpa.model" + ".DeploymentUnit hu WHERE hu.status=?1 and hu.tenantId=?2 and hu.checksum=?3");
q.setParameter(1, TaskPackageStatus.ACTIVE);
q.setParameter(2, tenantId);
q.setParameter(3, md5sum);
List<DeploymentUnit> resultList = q.getResultList();
DeploymentUnit deploymentUnit = null;
if (resultList.size() != 0) {
deploymentUnit = resultList.get(0);
}
return deploymentUnit;
}
use of org.wso2.carbon.humantask.client.api.types in project ballerina by ballerina-lang.
the class TextDocumentServiceUtil method prepareCompilerContext.
/**
* Prepare the compiler context.
*
* @param packageRepository Package Repository
* @param sourceRoot LSDocument for Source Root
* @param preserveWhitespace Preserve Whitespace
* @return {@link CompilerContext} Compiler context
*/
public static CompilerContext prepareCompilerContext(PackageRepository packageRepository, LSDocument sourceRoot, boolean preserveWhitespace, WorkspaceDocumentManager documentManager, CompilerPhase compilerPhase) {
org.wso2.ballerinalang.compiler.util.CompilerContext context = new CompilerContext();
context.put(PackageRepository.class, packageRepository);
CompilerOptions options = CompilerOptions.getInstance(context);
options.put(PROJECT_DIR, sourceRoot.getSourceRoot());
if (null == compilerPhase) {
throw new AssertionError("Compiler Phase can not be null.");
}
options.put(COMPILER_PHASE, compilerPhase.toString());
options.put(PRESERVE_WHITESPACE, Boolean.valueOf(preserveWhitespace).toString());
if (isProjectDir(sourceRoot.getSourceRoot(), sourceRoot.getURIString())) {
context.put(SourceDirectory.class, new LangServerFSProjectDirectory(sourceRoot.getSourceRootPath(), documentManager));
} else {
context.put(SourceDirectory.class, new LangServerFSProgramDirectory(sourceRoot.getSourceRootPath(), documentManager));
}
return context;
}
use of org.wso2.carbon.humantask.client.api.types in project ballerina by ballerina-lang.
the class LSPackageCache method loadPackagesMap.
private void loadPackagesMap() {
CompilerContext tempCompilerContext = CommonUtil.prepareTempCompilerContext();
for (String staticPkgName : staticPkgNames) {
PackageID packageID = new PackageID(new org.wso2.ballerinalang.compiler.util.Name("ballerina"), new org.wso2.ballerinalang.compiler.util.Name(staticPkgName), new org.wso2.ballerinalang.compiler.util.Name("0.0.0"));
this.packageMap.put(getPackageName(packageID), LSPackageLoader.getPackageById(tempCompilerContext, packageID));
}
}
Aggregations