use of org.activiti.engine.impl.pvm.process.ActivityImpl in project Activiti by Activiti.
the class SecureJavascriptTaskParseHandler method createSecureJavascriptTaskBehavior.
private void createSecureJavascriptTaskBehavior(BpmnParse bpmnParse, ScriptTask scriptTask, String language) {
if (StringUtils.isEmpty(scriptTask.getScript())) {
logger.warn("No script provided for scriptTask " + scriptTask.getId());
}
ActivityImpl activity = createActivityOnCurrentScope(bpmnParse, scriptTask, BpmnXMLConstants.ELEMENT_TASK_SCRIPT);
activity.setAsync(scriptTask.isAsynchronous());
activity.setExclusive(!scriptTask.isNotExclusive());
activity.setActivityBehavior(new SecureJavascriptTaskActivityBehavior(scriptTask.getId(), scriptTask.getScript(), language, scriptTask.getResultVariable(), scriptTask.isAutoStoreVariables()));
}
use of org.activiti.engine.impl.pvm.process.ActivityImpl in project carbon-business-process by wso2.
the class ProcessStatisticsService method getTasks.
/**
* Return all the tasks/activities in a process
* @param pId process instance id
* @return all the tasks/activities in a process
*/
@GET
@Path("/task-instances/{pId}")
@Produces({ MediaType.APPLICATION_JSON, MediaType.APPLICATION_XML })
public ResponseHolder getTasks(@PathParam("pId") String pId) {
ResponseHolder response = new ResponseHolder();
List<Object> list = new ArrayList();
RepositoryService repositoryService = BPMNOSGIService.getRepositoryService();
ProcessDefinitionEntity processDefinition = (ProcessDefinitionEntity) ((RepositoryServiceImpl) repositoryService).getDeployedProcessDefinition(pId);
if (processDefinition != null) {
for (ActivityImpl activity : processDefinition.getActivities()) {
TaskInfo taskInfo = new TaskInfo();
String taskDefKey = activity.getId();
String type = (String) activity.getProperty("type");
String taskName = (String) activity.getProperty("name");
taskInfo.setTaskDefinitionKey(taskDefKey);
taskInfo.setType(type);
taskInfo.setName(taskName);
list.add(taskInfo);
}
}
response.setData(list);
return response;
}
Aggregations