Constant Field Values

Contents

io.camunda.*

  • io.camunda.optimize.service.collection.CollectionScopeService
    Modifier and Type
    Constant Field
    Value
    public static final String
    "User [%s] is not authorized to add scope [%s]. Either they aren\'t allowed to access the definition or the provided tenants."
  • io.camunda.optimize.service.db.report.interpreter.view.process.AbstractProcessViewRawDataInterpreter
    Modifier and Type
    Constant Field
    Value
    protected static final String
    "currentTime"
    protected static final String
    "dateFormat"
    protected static final String
    "flowNodeIdsToDurations"
    protected static final String
    "def flowNodeInstanceIdToDuration = new HashMap();\ndef dateFormatter = new SimpleDateFormat(params.dateFormat);\nfor (flowNodeInstance in params._source.flowNodeInstances) {\n if (flowNodeInstance.totalDurationInMs != null) {\n if (flowNodeInstanceIdToDuration.containsKey(flowNodeInstance.flowNodeId)) {\n def currentDuration = flowNodeInstanceIdToDuration.get(flowNodeInstance.flowNodeId);\n flowNodeInstanceIdToDuration.put(flowNodeInstance.flowNodeId, flowNodeInstance.totalDurationInMs + currentDuration)\n } else {\n flowNodeInstanceIdToDuration.put(flowNodeInstance.flowNodeId, flowNodeInstance.totalDurationInMs)\n }\n } else {\n if (flowNodeInstance.startDate != null) {\n def duration = params.currentTime - dateFormatter.parse(flowNodeInstance.startDate).getTime();\n if (flowNodeInstanceIdToDuration.containsKey(flowNodeInstance.flowNodeId)) {\n def currentDuration = flowNodeInstanceIdToDuration.get(flowNodeInstance.flowNodeId);\n flowNodeInstanceIdToDuration.put(flowNodeInstance.flowNodeId, duration + currentDuration)\n } else {\n flowNodeInstanceIdToDuration.put(flowNodeInstance.flowNodeId, duration)\n }\n }\n }\n}\nreturn flowNodeInstanceIdToDuration;\n"
    protected static final String
    "numberOfUserTasks"
    public static final String
    "Optional.ofNullable(params._source.flowNodeInstances)\n .map(list -> list.stream().filter(item -> item.flowNodeType.equals(\'userTask\')).count())\n .orElse(0L)\n"
    protected static final String
    "params.currentTime"
    public static final String
    "if (doc[params.duration].size() == 0) {\n params.currentTime - doc[params.startDate].value.toInstant().toEpochMilli()\n} else {\n doc[params.duration].value\n}\n"
  • io.camunda.optimize.service.db.writer.CollectionWriter
    Modifier and Type
    Constant Field
    Value
    public static final String
    "def newRoles = new ArrayList();\nfor (roleToAdd in params.rolesToAdd) {\n boolean exists = ctx._source.data.roles.stream()\n .anyMatch(existingRole -> existingRole.id.equals(roleToAdd.id));\n if (!exists){\n newRoles.add(roleToAdd);\n }\n}\nif (newRoles.size() == params.rolesToAdd.size()) {\n ctx._source.data.roles.addAll(newRoles);\n ctx._source.lastModifier = params.lastModifier;\n ctx._source.lastModified = params.lastModified;\n} else {\n ctx.op = \"none\";\n}\n"
    public static final String
    "New Collection"
    public static final String
    "def optionalExistingEntry = ctx._source.data.roles.stream()\n.filter(dto -> dto.id.equals(params.roleEntryId))\n.findFirst();\nif(optionalExistingEntry.isPresent()){\n def existingEntry = optionalExistingEntry.get();\n ctx._source.data.roles.removeIf(entry -> entry.id.equals(params.roleEntryId));\n if (params.containsKey(\"lastModifier\")) {\n ctx._source.lastModifier = params.lastModifier;\n }\n if (params.containsKey(\"lastModified\")) {\n ctx._source.lastModified = params.lastModified;\n }\n} else {\n throw new Exception(\'Cannot find role.\');\n}\n"
    public static final String
    "def optionalExistingEntry = ctx._source.data.roles.stream()\n.filter(dto -> dto.id.equals(params.roleEntryId))\n.findFirst();\nif(optionalExistingEntry.isPresent()){\n def existingEntry = optionalExistingEntry.get();\n def moreThanOneManagerPresent = ctx._source.data.roles.stream()\n .filter(dto -> params.managerRole.equals(dto.role))\n .limit(2)\n .count()\n == 2;\n if (!moreThanOneManagerPresent && params.managerRole.equals(existingEntry.role)) {\n // deletion of last manager is not allowed\n ctx.op = \"none\";\n } else {\n ctx._source.data.roles.removeIf(entry -> entry.id.equals(params.roleEntryId));\n if (params.containsKey(\"lastModifier\")) {\n ctx._source.lastModifier = params.lastModifier;\n }\n if (params.containsKey(\"lastModified\")) {\n ctx._source.lastModified = params.lastModified;\n }\n}\n} else {\n throw new Exception(\'Cannot find role.\');\n}\n"
    public static final String
    "for (id in params.ids) {\n ctx._source.data.scope.removeIf(scope -> scope.id.equals(id));\n}\nctx._source.lastModifier = params.lastModifier;\nctx._source.lastModified = params.lastModified;\n"
    public static final String
    "def scopes = ctx._source.data.scope;\nif(scopes != null) {\n scopes.removeIf(scope -> scope.id.equals(params.scopeEntryIdToRemove));\n}\n"
    public static final String
    "boolean removed = ctx._source.data.scope.removeIf(scope -> scope.id.equals(params.id));\nif (removed) {\n ctx._source.lastModifier = params.lastModifier;\n ctx._source.lastModified = params.lastModified;\n} else {\n ctx.op = \"none\";\n}\n"
    public static final String
    "Map newScopes = ctx._source.data.scope.stream()\n .collect(Collectors.toMap(s -> s.id, Function.identity()));\nparams.scopeEntriesToUpdate\n .forEach(newScope -> {\n newScopes.computeIfPresent(newScope.id, (key, oldScope) -> {\n newScope.tenants = Stream.concat(oldScope.tenants.stream(), newScope.tenants.stream())\n .distinct()\n .collect(Collectors.toList());\n return newScope;\n });\n newScopes.putIfAbsent(newScope.id, newScope);\n });\nctx._source.data.scope = newScopes.values();\nctx._source.lastModifier = params.lastModifier;\nctx._source.lastModified = params.lastModified;\n"
    public static final String
    "def optionalExistingEntry = ctx._source.data.roles.stream()\n.filter(dto -> dto.id.equals(params.roleEntryId))\n.findFirst();\nif(optionalExistingEntry.isPresent()){\n def existingEntry = optionalExistingEntry.get();\n def moreThanOneManagerPresent = ctx._source.data.roles.stream()\n .filter(dto -> params.managerRole.equals(dto.role))\n .limit(2)\n .count()\n == 2;\nif (!moreThanOneManagerPresent && params.managerRole.equals(existingEntry.role)) {\n// updating of last manager is not allowed\n ctx.op = \"none\";\n} else {\n existingEntry.role = params.role;\n ctx._source.lastModifier = params.lastModifier;\n ctx._source.lastModified = params.lastModified;\n}\n} else {\nthrow new Exception(\'Cannot find role.\');\n}\n"
    public static final String
    "def optionalEntry = ctx._source.data.scope.stream()\n .filter(s -> s.id.equals(params.entryId))\n .findFirst();\nif (optionalEntry.isPresent()) {\n def entry = optionalEntry.get();\n entry.tenants = params.entryDto.tenants;\n ctx._source.lastModifier = params.lastModifier;\n ctx._source.lastModified = params.lastModified;\n} else {\n throw new Exception(\'Cannot find scope entry.\');\n}\n"
  • io.camunda.optimize.service.db.writer.DashboardWriter
    Modifier and Type
    Constant Field
    Value
    public static final String
    "New Dashboard"