use of org.wso2.carbon.humantask.core.store.HumanTaskStore in project carbon-business-process by wso2.
the class HTQueryBuildHelperImpl method getAllDeployedTasks.
/**
* @param ltenantID
* @return all the deployed tasks for the given tenant
*/
public List<HumanTaskBaseConfiguration> getAllDeployedTasks(long ltenantID) {
int tenantID = (int) ltenantID;
HumanTaskStore humanTaskStore = HumanTaskServiceComponent.getHumanTaskServer().getTaskStoreManager().getHumanTaskStore(tenantID);
List<HumanTaskBaseConfiguration> humanTaskConfigurations = humanTaskStore.getTaskConfigurations();
return humanTaskConfigurations;
}
use of org.wso2.carbon.humantask.core.store.HumanTaskStore in project carbon-business-process by wso2.
the class HumanTaskDeployer method init.
public void init(ConfigurationContext configurationContext) {
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
log.info("Initializing HumanTask Deployer for tenant " + tenantId + ".");
try {
HumanTaskDeployerServiceComponent.getTenantRegistryLoader().loadTenantRegistry(tenantId);
createHumanTaskRepository(configurationContext);
HumanTaskServer humantaskServer = HumanTaskDeployerServiceComponent.getHumanTaskServer();
humanTaskStore = humantaskServer.getTaskStoreManager().createHumanTaskStoreForTenant(tenantId, configurationContext);
} catch (DeploymentException e) {
log.warn(String.format("Human Task Repository creation failed for tenant id [%d]", tenantId), e);
} catch (RegistryException e) {
log.warn("Initializing HumanTask Deployer failed for tenant " + tenantId, e);
}
}
use of org.wso2.carbon.humantask.core.store.HumanTaskStore in project carbon-business-process by wso2.
the class DeployedTasks method getAlldeployedTasks.
public String[] getAlldeployedTasks(int tenantID) {
String[] noTask = { "No deployed task for the specified tenant" };
String[] noStore = { "No Human Tasks Store found for the given tenantID" };
HumanTaskServer humanTaskServer = HumanTaskServiceComponent.getHumanTaskServer();
HumanTaskStore humanTaskStore = humanTaskServer.getTaskStoreManager().getHumanTaskStore(tenantID);
if (humanTaskStore == null) {
return noStore;
}
List<HumanTaskBaseConfiguration> humanTaskConfigurations = humanTaskStore.getTaskConfigurations();
deployedTasks = new String[humanTaskConfigurations.size()];
for (int i = 0; i < humanTaskConfigurations.size(); i++) {
deployedTasks[i] = humanTaskConfigurations.get(i).getName() + "\t" + humanTaskConfigurations.get(i).getDefinitionName() + "\t" + humanTaskConfigurations.get(i).getOperation();
}
if (deployedTasks.length == 0) {
return noTask;
}
return deployedTasks;
}
use of org.wso2.carbon.humantask.core.store.HumanTaskStore in project carbon-business-process by wso2.
the class HumanTaskPackageManagementSkeleton method getTenantTaskStore.
// Returns the task store for the tenant.
private HumanTaskStore getTenantTaskStore() {
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
HumanTaskServer server = HumanTaskServiceComponent.getHumanTaskServer();
return server.getTaskStoreManager().getHumanTaskStore(tenantId);
}
use of org.wso2.carbon.humantask.core.store.HumanTaskStore in project carbon-business-process by wso2.
the class HumanTaskUIResourceProvider method getUIResource.
/**
* @param name : The ui resource path.
* @return : The URL of the resource location if this request is a matching human task ui resource.
* null otherwise.
*/
public URL getUIResource(String name) {
if (name.contains("humantaskui")) {
String[] nameElements = name.split("/");
if (nameElements != null && nameElements.length == 5) {
int tenantId = Integer.parseInt(nameElements[2]);
String packageName = nameElements[3];
String fileName = nameElements[4];
HumanTaskStore taskStore = HumanTaskServiceComponent.getHumanTaskServer().getTaskStoreManager().getHumanTaskStore(tenantId);
String jspFilePath = taskStore.getHumanTaskDeploymentRepo().getAbsolutePath() + File.separator + packageName + File.separator + "web" + File.separator + fileName;
File jspFile = new File(jspFilePath);
if (jspFile.exists()) {
try {
return jspFile.toURI().toURL();
} catch (MalformedURLException e) {
return null;
}
}
}
}
return null;
}
Aggregations