Parsing values runtime in ServiceTask from in/out parameters

Hi

I want to get the Input/Output values inside the execution of a ServiceTask. I already solved the Extensions:Parameters parsing by:

@Override
    public void execute(DelegateExecution execution)  {
        FlowElement currentActivityElement = execution.getBpmnModelElementInstance();
        CamundaProperties camundaProperties = currentActivityElement.getExtensionElements().getElementsQuery().filterByType(CamundaProperties.class)
                .singleResult();

        Collection<CamundaProperty> properties = camundaProperties.getCamundaProperties();
        for (CamundaProperty property : properties) {
            System.out.println("Property: " + property.getCamundaName() + " - " + property.getCamundaValue());
        }
}

}

But I can not find a solution for the same purpose with the above mentioned problem. If I query the inputOutput object, I can only get the implementing type choosed from the “Type” field.

CamundaInputOutput inOuts = currentActivityElement.getExtensionElements().getElementsQuery().filterByType(CamundaInputOutput.class)
                .singleResult();
        for (CamundaInputParameter in : inOuts.getCamundaInputParameters()) {
            System.out.println("Inputs: " + in.getCamundaName() + " - " + in.getValue());
        }

Other getters on that API are not suitable: getAttributeValue, getRawTextContext, getTextContent

Hi @ezolnbl,

why do you want to use the Model Api to get the input/output elements?

If you use an input parameter then you can access the value inside the delegate by name.

execution.getVariable("inputParameterName")

Best regards,
Philipp

Hi Philipp,

Thanks for the answer.

BR
Zoltán