Enumerate Workflows

DataWedge 14.1

ENUMERATE_WORKFLOWS

Generates a list of workflow inputs available on the device. Returns the workflow ID and name, regardless of whether the workflow is licensed.

Function Prototype

Intent intent = new Intent();
intent.setAction("com.symbol.datawedge.api.ACTION");
intent.putExtra("com.symbol.datawedge.api.ENUMERATE_WORKFLOWS", "");

Parameters

ACTION [String]: "com.symbol.datawedge.api.ENUMERATE_WORKFLOWS"

Return Values

The enumerated list of workflows is returned via the broadcast intent com.symbol.datawedge.api.RESULT_ENUMERATE_WORKFLOWS. The list of workflows is returned as a string array, arrayList<String>.

Example Code

Sample code to register/unregister the broadcast intent to enumerate workflows, send the intent and retrieve the results:

    /*Call before sending the enumerate workflows query*/
    private void registerReceivers() {
        IntentFilter filter = new IntentFilter();
        filter.addAction("com.symbol.datawedge.api.RESULT_ACTION");
        filter.addCategory(Intent.CATEGORY_DEFAULT);
        registerReceiver(broadcastReceiver, filter);
    }

    /* Send the enumerate workflows command to DataWedge intent API*/
    private void enumerateWorkflows() {
        Intent intent = new Intent();
        intent.setAction("com.symbol.datawedge.api.ACTION");
        intent.putExtra("com.symbol.datawedge.api.ENUMERATE_WORKFLOWS", "");
        sendBroadcast(intent);
    }

    /*unregister the broadcast receiver*/
    private void unRegisterReceivers() {
        unregisterReceiver(broadcastReceiver);
    }

    /*Create broadcast receiver to receive the enumerate workflows result*/
    private BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
        @Override
        public void onReceive(Context context, Intent intent) {
            String action = intent.getAction();
            Log.d("EnumerateWorkflows", "Action: " + action);
            if (action.equals("com.symbol.datawedge.api.RESULT_ACTION")) {
                if (intent.hasExtra("com.symbol.datawedge.api.RESULT_ENUMERATE_WORKFLOWS")) {
                    Bundle workflowBundle = (Bundle) intent.getExtras().get("com.symbol.datawedge.api.RESULT_ENUMERATE_WORKFLOWS");
                    String strData = "";
                    int count = 1;
                    ArrayList<String> workflowList = new ArrayList<>();
                    if (workflowBundle != null) {
                        for (String key : workflowBundle.keySet()) {
                            String value = workflowBundle.getString(key);
                            if (value != null) {
                                String listItem = count + ") " +key +" - "+ value;
                                workflowList.add(listItem);
                                strData += listItem + "\n";
                                count++;
                            }
                        }
                        Log.d("EnumerateWorkflows",strData );
                    }
                }
            }
        }
    };

Sample output data:

    /* workflowID - WorkflowName */

    1) tin_number - Tire Identification Number(TIN)
    2) license_plate - License Plate
    3) container_scanning - Shipping Container ID
    4) free_form_ocr - Free - Form OCR
    5) free_form_capture - Free - Form Image Capture
    6) meter_reading - Meter
    7) document_capture - Document Capture
    8) id_scanning - Identification Documents
    9) vin_number - Vehicle Identification Number(VIN)

SEE ALSO:

Zebra Support Central | Integrator Guides, Product Manuals, Software Downloads and Support

Developer Portal | Zebra Developer Community

Intent | Android Developers

Intents and Intent Filters | Android Developers

Android Intents | Tutorial