Using the Cassandra Update Rows Activity

Use the Update Rows Activity to update records in Cassandra.

About this task

Use this task to update records in the Cassandra instance. The call to this Activity is a synchronous call where the input data is sent to the Activity for processing and the response is sent back to the orchestration.

Procedure

  1. In an active orchestration, open the Activities tab and expand the Cassandra folder contents.
  2. Drag the Update Rows activity icon onto the orchestration. Select the activity. The Cassandra Update Rows Activity Checklist is displayed.
  3. In the checklist, click Summary.
  4. Review the contents of the Activity Name field, and make the required changes.
  5. In the checklist, click Pick Endpoint.
  6. Click Browse and use the Project Explorer dialog box to select the relevant Cassandra endpoint.
  7. Optional: You can create the endpoint by clicking New and specifying the required connection details. Click OK to save and use the endpoint for this configuration.
  8. To make required changes to the selected endpoint configuration, click Edit to access the options in a separate window. Any changes you make globally affects all uses of the endpoint in active orchestrations.
  9. In the checklist, click Configure.
  10. Under Configure, click PickTable and provide Keyspace name. Click Browse to dynamically select a table from the current list of tables in the database specified by the Endpoint.

    To select a table, choose one of the following options:

    • Click on a table in the list and click OK.
    • Provide the table name in the ‘Filter Table’ section and click on search button.
  11. Review that all the columns of selected table are displayed in the grid.
  12. Encoding UTF-8 is a standard character encoding for Unicode. This is the default encoding.
  13. If in case you have added/updated/deleted the existing columns in the table, use Refresh button to get the updated column details for the selected table.
    Note:
    • To update only one row in the database, directly select the Map Inputs section.
    • To update multiple records, the user needs to select the option of Delivery Rules and enable the checkbox for Batch.
  14. Under Configure, click Delivery Rules. select Enable Batch checkbox and define the number of rows you want to update at a time.
    1. Once the checkbox is selected, the Batch Type will be populated in the drop down section which is as follows:
      • LOGGED
      • UNLOGGED
      • COUNTER
    2. Select any one of the above batch type.
    3. The default value in the ‘Write Consistency Level’ dropdown is the one which is selected while creating the endpoint in the test connection. User can change the value by selecting any of the consistency level.
  15. Select the Map Inputs in the Checklist. The XML Schemas generated from the selected table of the Update Rows Activity are displayed as nodes under the request input parameter in the To Activity panel.

    For Column type map<?,?> , the schema would contain key, value and update option.

    The valid UpdateOption for map would be:
    • Add: To add the key value pair.
    • Remove: To remove the specified key. In case of remove, the value element should not be set to any value or mapping.

    The sample input request for Map data type:

    <to_do>
     <key>Staging</key>
     <value>Box.com</value>
     <updateOption>Add</updateOption>
    </to_do>

    For Column type set<?> and List<?> the schema would contain a recursive element value and UpdateOption.

    The valid UpdateOption values for Column Type List<?> are as follow:
    • Append: To append a single value at the end of the existing list.
    • Prepend: To prepend a single value at the beginning of the existing list.
    • Discard: To discard a single value from an existing list.
    • Append All: To append a collection of values at the end of the existing list.
    • Prepend All: To prepend a collection of values at the beginning of the existing list.
    • Discard All: To discard a collection of values from an existing list.
    The valid UpdateOption values for Column Type Set<?> are as follow:
    • Add: To add a single value in an existing set.
    • Remove: To remove a single value from an existing set.
    • Add All: To add a collection of values in an existing set.
    • Remove All: To remove a collection of values from an existing set.

    The sample input request for List, Set data type:

    <email>
     <value>john_3@abc.com</value>
     <value>john_4@abc.com</value>
     <value>john_5@abc.com</value>
     <updateOption>Append</updateOption>
    </email>
    
     <projects>
     <value>Salesforce.com</value>
     <value>Box.com</value>
     <value>SL</value>
     <updateOption>Add All</updateOption>
    </projects>
  16. Create a map between the orchestration variables and the input parameter of the activity.
    Note: Values must be provided at run time for any mandatory elements of the input structure. A value can be provided by specifying a default value for element or by mapping the element with an input node. During run time if no value is provided for a mandatory element, the Activity throws an exception, which is reported by the Web Management Console. If a value is not provided at run time for an optional input parameter, no exception is thrown during run time.
  17. Select the Map Outputs in the Checklist. The XML Schema generated to hold the response of the activity is displayed as nodes under the response output parameter in the From Activity panel.
  18. Create a map between the output parameters and orchestration variables.

Results

You have configured the Cassandra Update Rows activity.
Note:

You can add more than one object as input to this activity. To add more than one object as input, right click the Object Name (For example: Filter) field in the To Activity pane of Map Inputs, and select Expand Occurrences.




Feedback | Notices


Timestamp icon Last updated: Tuesday, 27 September 2016


https://www.ibm.com/support/knowledgecenter/en/SS3LC4_7.5.3/com.ibm.wci.doc/Cassandra_update_rows_activity.html