Open topic with navigation

TIBCO ActiveMatrix BusinessWorks™ Plug-in Development Kit 6.3.1

# How to Get Input at Run Time

BusinessWorks framework passes the input to the processContext parameter in the public N execute(N input, ProcessContext<N> processContext) method, which can be used to retrieve the actual value of a field.

You can find this method in the ActivityName_ActivityTypeActivity.java file from the runtime bundle.

In addition to this method, BusinessWorks Plug-in Development Kit provides the following code snippet to get the runtime input:

    public String getInputParameterStringValueByName(final N inputData, final ProcessingContext<N> processingContext, final String parameterName) {
         Model<N> model = processingContext.getMutableContext().getModel();
         N parameter = model.getFirstChildElementByName(inputData, null, parameterName);
         if (parameter == null) {
             return "";
         }
         return model.getStringValue(parameter);
    }

where

- `input` is the activity input data.
- `processingContext` is the XML processing context.
- `parameter value` is the parameter name that you want to get the value for.

The following example shows how to get the input:

    final String ACTIVITY_INPUT_FILE_NAME = "FileName";
    String fileName = getInputParameterStringValueByName(input,  processContext.getXMLProcessingContext(), ACTIVITY_INPUT_FILE_NAME);

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO ActiveMatrix BusinessWorks™ Plug-in Development Kit

Copyright © 2014-2022. TIBCO Software Inc. All Rights Reserved.