Search in sources :

Example 1 with SysBpmnResourceVO

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);
}
Also used : SysBpmnResourceVO(com.netsteadfast.greenstep.vo.SysBpmnResourceVO) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException)

Example 2 with SysBpmnResourceVO

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;
}
Also used : Task(org.activiti.engine.task.Task) SysBpmnResourceVO(com.netsteadfast.greenstep.vo.SysBpmnResourceVO) ProcessDefinitionQuery(org.activiti.engine.repository.ProcessDefinitionQuery) ProcessDefinition(org.activiti.engine.repository.ProcessDefinition) ProcessInstance(org.activiti.engine.runtime.ProcessInstance)

Example 3 with SysBpmnResourceVO

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);
}
Also used : SysBpmnResourceVO(com.netsteadfast.greenstep.vo.SysBpmnResourceVO) ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException)

Example 4 with SysBpmnResourceVO

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!";
    }
}
Also used : ServiceException(com.netsteadfast.greenstep.base.exception.ServiceException) SysBpmnResourceVO(com.netsteadfast.greenstep.vo.SysBpmnResourceVO)

Example 5 with SysBpmnResourceVO

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;
    }
}
Also used : SysBpmnResourceVO(com.netsteadfast.greenstep.vo.SysBpmnResourceVO)

Aggregations

SysBpmnResourceVO (com.netsteadfast.greenstep.vo.SysBpmnResourceVO)12 ServiceException (com.netsteadfast.greenstep.base.exception.ServiceException)10 ByteArrayInputStream (java.io.ByteArrayInputStream)1 ZipInputStream (java.util.zip.ZipInputStream)1 Deployment (org.activiti.engine.repository.Deployment)1 ProcessDefinition (org.activiti.engine.repository.ProcessDefinition)1 ProcessDefinitionQuery (org.activiti.engine.repository.ProcessDefinitionQuery)1 ProcessInstance (org.activiti.engine.runtime.ProcessInstance)1 Task (org.activiti.engine.task.Task)1