Search in sources :

Example 1 with DeployedTasks

use of org.wso2.carbon.humantask.core.integration.jmx.DeployedTasks in project carbon-business-process by wso2.

the class HumanTaskServiceComponent method registerMBeans.

/**
 * to register all the MBeans.
 *
 * @throws Exception
 * @throws MBeanRegistrationException
 * @throws InstanceAlreadyExistsException
 * @throws NotCompliantMBeanException
 */
public void registerMBeans() throws Exception, MBeanRegistrationException, InstanceAlreadyExistsException, NotCompliantMBeanException {
    log.info("Registering HT related MBeans");
    HTTaskStatusMonitor taskStatusMonitor = new HTTaskStatusMonitor();
    DeployedTasks deployedTasks = new DeployedTasks();
    MBeanRegistrar.registerMBean(taskStatusMonitor, "org.wso2.carbon.humantask.core.integration.jmx:type=HTTaskStatusMonitorMXBean");
    MBeanRegistrar.registerMBean(deployedTasks, "org.wso2.carbon.humantask.core.integration.jmx:type=DeployedTasksMXBean");
    log.info("MXBean for Human tasks registered successfully");
}
Also used : DeployedTasks(org.wso2.carbon.humantask.core.integration.jmx.DeployedTasks) HTTaskStatusMonitor(org.wso2.carbon.humantask.core.integration.jmx.HTTaskStatusMonitor)

Example 2 with DeployedTasks

use of org.wso2.carbon.humantask.core.integration.jmx.DeployedTasks 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;
}
Also used : HumanTaskStore(org.wso2.carbon.humantask.core.store.HumanTaskStore) HumanTaskServer(org.wso2.carbon.humantask.core.HumanTaskServer) HumanTaskBaseConfiguration(org.wso2.carbon.humantask.core.store.HumanTaskBaseConfiguration)

Aggregations

HumanTaskServer (org.wso2.carbon.humantask.core.HumanTaskServer)1 DeployedTasks (org.wso2.carbon.humantask.core.integration.jmx.DeployedTasks)1 HTTaskStatusMonitor (org.wso2.carbon.humantask.core.integration.jmx.HTTaskStatusMonitor)1 HumanTaskBaseConfiguration (org.wso2.carbon.humantask.core.store.HumanTaskBaseConfiguration)1 HumanTaskStore (org.wso2.carbon.humantask.core.store.HumanTaskStore)1