use of com.netsteadfast.greenstep.vo.SysBpmnResourceVO in project bamboobsc by billchen198318.
the class BusinessProcessManagementUtils method deleteDeployment.
public static void deleteDeployment(String resourceId, boolean force) throws ServiceException, Exception {
if (StringUtils.isBlank(resourceId)) {
throw new Exception(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
SysBpmnResourceVO sysBpmnResource = new SysBpmnResourceVO();
sysBpmnResource.setId(resourceId);
deleteDeployment(sysBpmnResource, force);
}
use of com.netsteadfast.greenstep.vo.SysBpmnResourceVO in project bamboobsc by billchen198318.
the class BusinessProcessManagementUtils method getTaskDiagramById.
public static byte[] getTaskDiagramById(String resourceId, String taskId) throws Exception {
SysBpmnResourceVO resouce = loadResource(resourceId);
Task task = getTaskById(taskId);
if (null == task) {
return null;
}
ProcessDefinitionQuery pdQuery = repositoryService.createProcessDefinitionQuery().processDefinitionKey(resourceId);
List<ProcessDefinition> pdList = pdQuery.deploymentId(resouce.getDeploymentId()).list();
byte[] data = null;
for (ProcessDefinition pd : pdList) {
List<ProcessInstance> piList = runtimeService.createProcessInstanceQuery().processDefinitionId(pd.getId()).list();
for (ProcessInstance pi : piList) {
if (pi.getProcessInstanceId().equals(task.getProcessInstanceId())) {
data = getDiagramByte(pi);
}
}
}
return data;
}
use of com.netsteadfast.greenstep.vo.SysBpmnResourceVO in project bamboobsc by billchen198318.
the class BusinessProcessManagementUtils method deployment.
public static String deployment(String resourceId) throws ServiceException, Exception {
if (StringUtils.isBlank(resourceId)) {
throw new Exception(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
SysBpmnResourceVO sysBpmnResource = new SysBpmnResourceVO();
sysBpmnResource.setId(resourceId);
return deployment(sysBpmnResource);
}
use of com.netsteadfast.greenstep.vo.SysBpmnResourceVO in project bamboobsc by billchen198318.
the class SystemBpmnResourceSaveOrUpdateAction method deployment.
private void deployment(boolean overDeployment) throws ControllerException, AuthorityException, ServiceException, Exception {
SysBpmnResourceVO resource = new SysBpmnResourceVO();
resource.setOid(this.getFields().get("oid"));
DefaultResult<SysBpmnResourceVO> result = this.sysBpmnResourceService.findObjectByOid(resource);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
resource = result.getValue();
sysBpmnResourceService.hibernateSessionClear();
if (!overDeployment && !StringUtils.isBlank(resource.getDeploymentId())) {
this.message = "Already deployment!";
return;
}
String id = BusinessProcessManagementUtils.deployment(resource);
if (!StringUtils.isBlank(id)) {
this.message = "Deployment success!";
this.success = IS_YES;
} else {
this.message = "Deployment fail!";
}
}
use of com.netsteadfast.greenstep.vo.SysBpmnResourceVO in project bamboobsc by billchen198318.
the class SystemBpmnResourceSaveOrUpdateAction method save.
private void save() throws ControllerException, AuthorityException, ServiceException, Exception {
this.checkFields();
if (StringUtils.isBlank(this.getFields().get("uploadOid"))) {
super.throwMessage("uploadOid", "Please upload BPMN(zip) file!");
}
this.selfTestUploadResourceData();
SysBpmnResourceVO resource = new SysBpmnResourceVO();
this.fillResource(resource);
this.fillContent(resource);
DefaultResult<SysBpmnResourceVO> result = this.sysBpmnResourceService.saveObject(resource);
this.message = result.getSystemMessage().getValue();
if (result.getValue() != null) {
this.success = IS_YES;
}
}
Aggregations