use of org.activiti.engine.impl.pvm.process.ActivityImpl in project Activiti by Activiti.
the class ProcessDefinitionBuilder method buildProcessDefinition.
public PvmProcessDefinition buildProcessDefinition() {
for (Object[] unresolvedTransition : unresolvedTransitions) {
TransitionImpl transition = (TransitionImpl) unresolvedTransition[0];
String destinationActivityName = (String) unresolvedTransition[1];
ActivityImpl destination = processDefinition.findActivity(destinationActivityName);
if (destination == null) {
throw new ActivitiException("destination '" + destinationActivityName + "' not found. (referenced from transition in '" + transition.getSource().getId() + "')");
}
transition.setDestination(destination);
}
return processDefinition;
}
use of org.activiti.engine.impl.pvm.process.ActivityImpl in project Activiti by Activiti.
the class ProcessDefinitionBuilder method startTransition.
public ProcessDefinitionBuilder startTransition(String destinationActivityId, String transitionId) {
if (destinationActivityId == null) {
throw new PvmException("destinationActivityId is null");
}
ActivityImpl activity = getActivity();
transition = activity.createOutgoingTransition(transitionId);
unresolvedTransitions.add(new Object[] { transition, destinationActivityId });
processElement = transition;
return this;
}
use of org.activiti.engine.impl.pvm.process.ActivityImpl in project Activiti by Activiti.
the class CustomUserTaskBpmnParseHandler method executeParse.
protected void executeParse(BpmnParse bpmnParse, UserTask userTask) {
// Do the regular stuff
super.executeParse(bpmnParse, userTask);
// Make user tasks always async
ActivityImpl activity = findActivity(bpmnParse, userTask.getId());
activity.setAsync(true);
}
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