use of com.netsteadfast.greenstep.vo.SysBpmnResourceVO in project bamboobsc by billchen198318.
the class SystemBpmnResourceSaveOrUpdateAction method update.
private void update() throws ControllerException, AuthorityException, ServiceException, Exception {
this.checkFields();
String uploadOid = this.getFields().get("uploadOid");
if (!StringUtils.isBlank(uploadOid)) {
// 有更新上傳檔案
this.selfTestUploadResourceData();
}
SysBpmnResourceVO resource = new SysBpmnResourceVO();
resource.setOid(this.getFields().get("oid"));
DefaultResult<SysBpmnResourceVO> oldResult = this.sysBpmnResourceService.findObjectByOid(resource);
if (oldResult.getValue() == null) {
throw new ServiceException(oldResult.getSystemMessage().getValue());
}
resource = oldResult.getValue();
String beforeId = resource.getId();
byte[] beforeContent = resource.getContent();
resource.setContent(null);
// 先清除原本的byte資料, 要不然每次update 資料越來越大
sysBpmnResourceService.updateObject(resource);
if (!StringUtils.isBlank(this.getFields().get("uploadOid"))) {
this.fillContent(resource);
} else {
resource.setContent(beforeContent);
}
this.fillResource(resource);
resource.setId(beforeId);
DefaultResult<SysBpmnResourceVO> result = this.sysBpmnResourceService.updateObject(resource);
this.message = result.getSystemMessage().getValue();
if (result.getValue() != null) {
String oldDeploymentIdId = result.getValue().getDeploymentId();
if (!StringUtils.isBlank(oldDeploymentIdId) && !StringUtils.isBlank(uploadOid)) {
// 更新上傳部屬
BusinessProcessManagementUtils.deleteDeployment(result.getValue(), false);
this.deployment(true);
}
this.success = IS_YES;
}
}
use of com.netsteadfast.greenstep.vo.SysBpmnResourceVO in project bamboobsc by billchen198318.
the class SystemBpmnResourceSaveOrUpdateAction method export.
private void export() 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();
this.uploadOid = UploadSupportUtils.create(Constants.getSystem(), UploadTypes.IS_TEMP, false, resource.getContent(), resource.getId() + ".zip");
this.message = SysMessageUtil.get(GreenStepSysMsgConstants.INSERT_SUCCESS);
this.success = IS_YES;
}
use of com.netsteadfast.greenstep.vo.SysBpmnResourceVO in project bamboobsc by billchen198318.
the class BusinessProcessManagementUtils method startProcess.
public static String startProcess(String resourceId, Map<String, Object> paramMap) throws ServiceException, Exception {
if (StringUtils.isBlank(resourceId)) {
throw new Exception(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
SysBpmnResourceVO sysBpmnResource = new SysBpmnResourceVO();
sysBpmnResource.setId(resourceId);
return startProcess(sysBpmnResource, paramMap);
}
use of com.netsteadfast.greenstep.vo.SysBpmnResourceVO in project bamboobsc by billchen198318.
the class BusinessProcessManagementUtils method loadResource.
public static SysBpmnResourceVO loadResource(String resourceId) throws ServiceException, Exception {
if (StringUtils.isBlank(resourceId)) {
throw new Exception(SysMessageUtil.get(GreenStepSysMsgConstants.PARAMS_BLANK));
}
SysBpmnResourceVO sysBpmnResource = new SysBpmnResourceVO();
sysBpmnResource.setId(resourceId);
DefaultResult<SysBpmnResourceVO> result = sysBpmnResourceService.findByUK(sysBpmnResource);
if (result.getValue() == null) {
throw new ServiceException(result.getSystemMessage().getValue());
}
return result.getValue();
}
use of com.netsteadfast.greenstep.vo.SysBpmnResourceVO in project bamboobsc by billchen198318.
the class BusinessProcessManagementUtils method queryProcessDefinition.
public static List<ProcessDefinition> queryProcessDefinition(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 queryProcessDefinition(sysBpmnResource);
}
Aggregations