use of org.wso2.carbon.humantask.core.engine.commands.Activate in project carbon-business-process by wso2.
the class BPMNInstanceService method activateProcessInstance.
/**
* Activate a process instance by passing the instance id
*
* @param instanceId
* @throws BPSFault
*/
public void activateProcessInstance(String instanceId) throws BPSFault {
Integer tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
RuntimeService runtimeService = BPMNServerHolder.getInstance().getEngine().getRuntimeService();
List<ProcessInstance> processInstances = runtimeService.createProcessInstanceQuery().processInstanceTenantId(tenantId.toString()).processInstanceId(instanceId).list();
if (processInstances.isEmpty()) {
String msg = "No process instances with the ID: " + instanceId;
log.error(msg);
throw new BPSFault(msg);
}
runtimeService.activateProcessInstanceById(instanceId);
}
use of org.wso2.carbon.humantask.core.engine.commands.Activate in project carbon-business-process by wso2.
the class TaskOperationsImpl method activate.
/**
* Activate the task, i.e. set the task to status Ready (Administrative Operations)
* @param taskIdURI : task identifier
* @throws IllegalStateFault
* @throws IllegalOperationFault
* @throws IllegalArgumentFault
* @throws IllegalAccessFault
*/
public void activate(URI taskIdURI) throws IllegalStateFault, IllegalOperationFault, IllegalArgumentFault, IllegalAccessFault {
try {
final Long taskID = validateTaskId(taskIdURI);
HumanTaskServiceComponent.getHumanTaskServer().getTaskEngine().getScheduler().execTransaction(new Callable<Object>() {
public Object call() throws Exception {
Activate activateCommand = new Activate(getCaller(), taskID);
activateCommand.execute();
return null;
}
});
} catch (Exception ex) {
handleException(ex);
}
}
use of org.wso2.carbon.humantask.core.engine.commands.Activate in project product-iots by wso2.
the class ServiceComponent method activate.
protected void activate(ComponentContext ctx) {
if (log.isDebugEnabled()) {
log.debug("Activating b Management Service Component");
}
try {
DeviceTypeManagerService deviceTypeManagerService = new DeviceTypeManagerService();
BundleContext bundleContext = ctx.getBundleContext();
serviceRegistration = bundleContext.registerService(DeviceManagementService.class.getName(), deviceTypeManagerService, null);
String setupOption = System.getProperty("setup");
if (setupOption != null) {
if (log.isDebugEnabled()) {
log.debug("-Dsetup is enabled. Iot Device management repository schema " + "initialization is about to begin");
}
try {
DeviceTypeUtils.setupDeviceManagementSchema();
} catch (DeviceMgtPluginException e) {
log.error("Exception occurred while initializing device management database " + "schema", e);
}
}
if (log.isDebugEnabled()) {
log.debug("b Management Service Component has been successfully activated");
}
} catch (Throwable e) {
log.error("Error occurred while activating Current Sensor Management Service " + "Component", e);
}
}
use of org.wso2.carbon.humantask.core.engine.commands.Activate in project identity-outbound-auth-sms-otp by wso2-extensions.
the class SMSOTPAuthenticatorServiceComponent method activate.
protected void activate(ComponentContext ctxt) {
try {
SMSOTPAuthenticator authenticator = new SMSOTPAuthenticator();
Hashtable<String, String> props = new Hashtable<String, String>();
ctxt.getBundleContext().registerService(ApplicationAuthenticator.class.getName(), authenticator, props);
if (log.isDebugEnabled()) {
log.debug("SMSOTP authenticator is activated");
}
} catch (Throwable e) {
log.fatal("Error while activating the SMSOTP authenticator ", e);
}
}
Aggregations