use of org.wso2.carbon.humantask.core.dao.jpa.openjpa.model.Task in project carbon-business-process by wso2.
the class Exit method execute.
@Override
public void execute() {
authorise();
TaskDAO task = getTask();
checkPreConditions();
checkState();
task.exit();
processTaskEvent();
checkPostConditions();
}
use of org.wso2.carbon.humantask.core.dao.jpa.openjpa.model.Task in project carbon-business-process by wso2.
the class Forward method createTaskEvent.
@Override
protected EventDAO createTaskEvent() {
TaskDAO task = getTask();
EventDAO taskEvent = super.createTaskEvent();
taskEvent.setDetails("");
processTaskEvent();
return taskEvent;
}
use of org.wso2.carbon.humantask.core.dao.jpa.openjpa.model.Task in project carbon-business-process by wso2.
the class GetInput method execute.
@Override
public void execute() {
authorise();
TaskDAO task = getTask();
checkPreConditions();
checkState();
if (StringUtils.isNotEmpty(partName)) {
inputElement = CommonTaskUtil.getMessagePart(task.getInputMessage(), partName);
} else {
inputElement = (Element) task.getInputMessage().getBodyData().getFirstChild().getFirstChild();
}
checkPostConditions();
}
use of org.wso2.carbon.humantask.core.dao.jpa.openjpa.model.Task in project ballerina by ballerina-lang.
the class ParserUtils method getAllPackages.
/**
* Get All Native Packages.
*
* @return {@link Map} Package name, package functions and connectors
*/
public static Map<String, ModelPackage> getAllPackages() {
final Map<String, ModelPackage> modelPackage = new HashMap<>();
// TODO: remove once the packerina api for package listing is available
final String[] packageNames = { "net.http", "net.http.authadaptor", "net.http.endpoints", "net.http.mock", "net.http.swagger", "net.uri", "mime", "net.websub", "net.websub.hub", "net.grpc", "auth", "auth.authz", "auth.authz.permissionstore", "auth.basic", "auth.jwtAuth", "auth.userstore", "auth.utils", "caching", "collections", "config", "data.sql", "file", "internal", "io", "jwt", "jwt.signature", "log", "math", "os", "reflect", "runtime", "security.crypto", "task", "time", "transactions.coordinator", "user", "util" };
try {
List<BLangPackage> builtInPackages = LSPackageLoader.getBuiltinPackages();
for (BLangPackage bLangPackage : builtInPackages) {
loadPackageMap(bLangPackage.packageID.getName().getValue(), bLangPackage, modelPackage);
}
CompilerContext context = CommonUtil.prepareTempCompilerContext();
for (String packageName : packageNames) {
PackageID packageID = new PackageID(new Name("ballerina"), new Name(packageName), new Name("0.0.0"));
BLangPackage bLangPackage = LSPackageLoader.getPackageById(context, packageID);
loadPackageMap(bLangPackage.packageID.getName().getValue(), bLangPackage, modelPackage);
}
} catch (Exception e) {
// Above catch is to fail safe composer front end due to core errors.
logger.warn("Error while loading packages");
}
return modelPackage;
}
use of org.wso2.carbon.humantask.core.dao.jpa.openjpa.model.Task in project carbon-apimgt by wso2.
the class APIPublisherImpl method cleanupPendingTaskForAPIStateChange.
private void cleanupPendingTaskForAPIStateChange(String apiId) throws APIManagementException {
Optional<String> workflowExtRef = getWorkflowDAO().getExternalWorkflowReferenceForPendingTask(apiId, WorkflowConstants.WF_TYPE_AM_API_STATE);
if (workflowExtRef.isPresent()) {
WorkflowExecutor executor = WorkflowExecutorFactory.getInstance().getWorkflowExecutor(WorkflowConstants.WF_TYPE_AM_API_STATE);
try {
executor.cleanUpPendingTask(workflowExtRef.get());
} catch (WorkflowException e) {
String warn = "Failed to clean pending api state change task for " + apiId;
// failed cleanup processes are ignored to prevent failing the deletion process
log.warn(warn, e.getLocalizedMessage());
}
getWorkflowDAO().deleteWorkflowEntryforExternalReference(workflowExtRef.get());
}
}
Aggregations