Skip to content

Commit

Permalink
FBP-100. Update extraction path
Browse files Browse the repository at this point in the history
  • Loading branch information
valb3r committed Jul 1, 2023
1 parent 3c6479d commit ce4acc5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ data class BpmnProcessObject(val process: BpmnProcess, val diagram: List<Diagram
elementById: MutableMap<BpmnElementId, WithParentId>,
propertiesByElemId: MutableMap<BpmnElementId, PropertyTable>) {
val externalProperties = PropertyType.values().filter {
it.isUsedOnlyBy.contains(element::class) && (it.externalProperty?.isPresent(elementById, propertiesByElemId[element.id]!!) ?: false)
it.isUsedOnlyBy.contains(element::class) && (it.externalProperty?.isPresent(elementById, propertiesByElemId, propertiesByElemId[element.id]!!) ?: false)
}
println()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import com.valb3r.bpmn.intellij.plugin.bpmn.api.bpmn.BpmnElementId
import com.valb3r.bpmn.intellij.plugin.bpmn.api.bpmn.elements.BpmnSequenceFlow
import com.valb3r.bpmn.intellij.plugin.bpmn.api.bpmn.elements.WithBpmnId
import com.valb3r.bpmn.intellij.plugin.bpmn.api.bpmn.elements.WithParentId
import com.valb3r.bpmn.intellij.plugin.bpmn.api.bpmn.elements.gateways.BpmnExclusiveGateway
import com.valb3r.bpmn.intellij.plugin.bpmn.api.bpmn.elements.tasks.BpmnSendEventTask
import com.valb3r.bpmn.intellij.plugin.bpmn.api.info.PropertyValueType.*
import kotlin.reflect.KClass
Expand Down Expand Up @@ -236,16 +237,16 @@ enum class FunctionalGroupType(val groupCaption: String, val actionResult: NewEl
}

interface ExternalProperty {
fun isPresent(allElems: Map<BpmnElementId, WithParentId>, elemProps: PropertyTable): Boolean
fun isPresent(allElems: Map<BpmnElementId, WithParentId>, allElemProps: Map<BpmnElementId, PropertyTable>, elemProps: PropertyTable): Boolean
fun externalValueReference(): Pair<BpmnElementId, PropertyType>
fun castFromExternalValue(value: Any): Any
fun castToExternalValue(value: Any): Any
}

class DefaultFlowExternalProp: ExternalProperty {

override fun isPresent(allElems: Map<BpmnElementId, WithParentId>, elemProps: PropertyTable): Boolean {
TODO("Not yet implemented")
override fun isPresent(allElems: Map<BpmnElementId, WithParentId>, allElemProps: Map<BpmnElementId, PropertyTable>, elemProps: PropertyTable): Boolean {
return allElems[BpmnElementId(elemProps[PropertyType.SOURCE_REF]?.value as String? ?: "")]?.element is BpmnExclusiveGateway
}

override fun externalValueReference(): Pair<BpmnElementId, PropertyType> {
Expand Down

0 comments on commit ce4acc5

Please sign in to comment.