private boolean tableRowIsEmpty(TableData.TableRow tableRow) { return Optional.ofNullable(tableRow).map(row -> { List<TableData.TableCellValue> tableCellValues = row.getTableCellValues(); boolean allBlank = true; for (TableData.TableCellValue cell : tableCellValues) { if (StringUtils.isNotEmpty(cell.getValue())) { allBlank = false; break; } } return allBlank; }).orElse(true); }
private boolean isAllEmpty(Row row, int startCol) { for (int i = startCol; i < row.getLastCellNum(); i++) { Cell cell = row.getCell(i); if (cell != null && StringUtils.isNotEmpty(getCellValue(cell))) { return false; } } return true; }
private boolean tableRowIsEmpty(TableData.TableRow tableRow) { return Optional.ofNullable(tableRow).map(row -> { List<TableData.TableCellValue> tableCellValues = row.getTableCellValues(); boolean allBlank = true; for (TableData.TableCellValue cell : tableCellValues) { if (StringUtils.isNotEmpty(cell.getValue())) { allBlank = false; break; } } return allBlank; }).orElse(true); }
private boolean isAllEmpty(Row row, int startCol) { for (int i = startCol; i < row.getLastCellNum(); i++) { Cell cell = row.getCell(i); if (cell != null && StringUtils.isNotEmpty(getCellValue(cell))) { return false; } } return true; }
protected String getFieldString(String fieldName) { for (FieldExtension fieldExtension : decisionTask.getFieldExtensions()) { if (fieldName.equals(fieldExtension.getFieldName())) { if (StringUtils.isNotEmpty(fieldExtension.getStringValue())) { return fieldExtension.getStringValue(); } else if (StringUtils.isNotEmpty(fieldExtension.getExpression())) { return fieldExtension.getExpression(); } } } return null; }
@Override public void onStateTransition(CommandContext commandContext, DelegatePlanItemInstance planItemInstance, String transition) { if (PlanItemInstanceState.ACTIVE.equals(planItemInstance.getState())) { // The process task plan item will be deleted by the regular TerminatePlanItemOperation if (PlanItemTransition.TERMINATE.equals(transition) || PlanItemTransition.EXIT.equals(transition)) { deleteProcessInstance(commandContext, planItemInstance); } else if (PlanItemTransition.COMPLETE.equals(transition)) { CmmnEngineConfiguration cmmnEngineConfiguration = CommandContextUtil.getCmmnEngineConfiguration(commandContext); ProcessInstanceService processInstanceService = cmmnEngineConfiguration.getProcessInstanceService(); CaseInstanceEntity caseInstance = cmmnEngineConfiguration.getCaseInstanceEntityManager().findById(planItemInstance.getCaseInstanceId()); for (IOParameter ioParameter : outParameters) { String variableName = null; if (StringUtils.isNotEmpty(ioParameter.getTarget())) { variableName = ioParameter.getTarget(); } else if (StringUtils.isNotEmpty(ioParameter.getTargetExpression())) { Expression expression = cmmnEngineConfiguration.getExpressionManager().createExpression(ioParameter.getTargetExpression()); variableName = expression.getValue(planItemInstance).toString(); } Object variableValue = null; if (StringUtils.isNotEmpty(ioParameter.getSourceExpression())) { Expression expression = cmmnEngineConfiguration.getExpressionManager().createExpression(ioParameter.getSourceExpression()); variableValue = processInstanceService.getVariables(planItemInstance.getReferenceId()).get(expression.getValue(planItemInstance).toString()); } else if (StringUtils.isNotEmpty(ioParameter.getSource())) { variableValue = processInstanceService.getVariables(planItemInstance.getReferenceId()).get(ioParameter.getSource()); } caseInstance.setVariable(variableName, variableValue); } } } }
private List<TableData> getSheetData(int sheetIdx) { Sheet sheet = workBook.getSheetAt(sheetIdx); List<TableData> tables = new ArrayList<>(); int numOfRows = sheet.getLastRowNum() + 1; TableData currentTable = null; for (int rowNum = SKIP_LINE; rowNum < numOfRows; rowNum++) { Row row = sheet.getRow(rowNum); if (row == null) { if (addCurrentTable(tables, currentTable)) { currentTable = null; } continue; } if (row.getLastCellNum() < SKIP_COL) { continue; } if (StringUtils.isNotEmpty(getCellValue(row.getCell(SKIP_COL)))) { addCurrentTable(tables, currentTable); currentTable = getCurrentTable(sheet, row); } else { // data if (isAllEmpty(row, SKIP_COL + 1)) { continue; } currentTable = getTableData(currentTable, row); } } addCurrentTable(tables, currentTable); return tables; }
private List<TableData> getSheetData(int sheetIdx) { Sheet sheet = workBook.getSheetAt(sheetIdx); List<TableData> tables = new ArrayList<>(); int numOfRows = sheet.getLastRowNum() + 1; TableData currentTable = null; for (int rowNum = SKIP_LINE; rowNum < numOfRows; rowNum++) { Row row = sheet.getRow(rowNum); if (row == null) { if (addCurrentTable(tables, currentTable)) { currentTable = null; } continue; } if (row.getLastCellNum() < SKIP_COL) { continue; } if (StringUtils.isNotEmpty(getCellValue(row.getCell(SKIP_COL)))) { addCurrentTable(tables, currentTable); currentTable = getCurrentTable(sheet, row); } else { // data if (isAllEmpty(row, SKIP_COL + 1)) { continue; } currentTable = getTableData(currentTable, row); } } addCurrentTable(tables, currentTable); return tables; }
if (StringUtils.isNotEmpty(ioParameter.getTargetExpression())) { Expression expression = cmmnEngineConfiguration.getExpressionManager().createExpression(ioParameter.getTargetExpression()); variableName = expression.getValue(planItemInstanceEntity).toString(); } else if (StringUtils.isNotEmpty(ioParameter.getTarget())){ variableName = ioParameter.getTarget(); if (StringUtils.isNotEmpty(ioParameter.getSourceExpression())) { Expression expression = cmmnEngineConfiguration.getExpressionManager().createExpression(ioParameter.getSourceExpression()); variableValue = expression.getValue(planItemInstanceEntity); } else if (StringUtils.isNotEmpty(ioParameter.getSource())) { variableValue = planItemInstanceEntity.getVariable(ioParameter.getSource());
StringUtils.isNotEmpty(decisionTask.getDecision().getExternalRef())) {