Handling Flow

About this task

As the picture shows, there are some parameters required for the process. Here lists all the parameters and the example values:
  • {Project Name}: TestRestChannel
  • {Flow Name}: restChannelFlow
  • {Data Name}:stringDataFL
  • {KColl Name}:restKcollFL
  • {IColl Name}:listFL

Procedure

  1. Get process id {procid} of flow. Access the URL by method.
    http://localhost:8080/TestRestChannel/rest/flows/restChannelFlow.
    It would return json string which has all the , including
    "dse_processorId":"FUBNHCDMCUBTACEPDFCTFREOCDETAFEUABIAFMIA"
    FUBNHCDMCUBTACEPDFCTFREOCDETAFEUABIAFMIA is the process id.
    Note: All the other requests need process id first.
  2. Get data value of flow (GET method). Access the URL by Get method.
    • Field:
      http://localhost:8080/TestRestChannel/rest/flows/restChannelFlow/FUBNHCDMCUBTACEPDFCTFREOCDETAFEUABIAFMIA/stringDataFL
    • KColl:
      http://localhost:8080/TestRestChannel/rest/flows/restChannelFlow/FUBNHCDMCUBTACEPDFCTFREOCDETAFEUABIAFMIA/restKcollFL/stringDataFL
      • IColl: get list data of flow (json string)
        http://localhost:8080/TestRestChannel/rest/flows/restChannelFlow/FUBNHCDMCUBTACEPDFCTFREOCDETAFEUABIAFMIA/listFL
      • IColl: (json string)
        http://localhost:8080/TestRestChannel/rest/flows/restChannelFlow/FUBNHCDMCUBTACEPDFCTFREOCDETAFEUABIAFMIA/listFL/0
    • Context:
      http://localhost:8080/TestRestChannel/rest/flows/restChannelFlow/FUBNHCDMCUBTACEPDFCTFREOCDETAFEUABIAFMIA
  3. Edit the value of data in flow (POST or PUT) Access the URL by POST method to edit the data value.
    • Field:
      • URL:
        http://localhost:8080/TestRestChannel/rest/flows/restChannelFlow/FUBNHCDMCUBTACEPDFCTFREOCDETAFEUABIAFMIA
      • Content type: application/json
      • Input example: {"stringDataFL":"hello"}
    • KColl: there are two ways.
      • Edit all the values:
        • URL:
          http://localhost:8080/TestRestChannel/rest/flows/restChannelFlow/FUBNHCDMCUBTACEPDFCTFREOCDETAFEUABIAFMIA/restKcollFL
        • Content type: application/json
        • Input example: {"dataString":"hello"}
        • Result: restKcollFL has only {"dataString":"hello"} and other data are lost.
        • URL:
          http://localhost:8080/TestRestChannel/rest/flows/restChannelFlow/FUBNHCDMCUBTACEPDFCTFREOCDETAFEUABIAFMIA
        • Content type: application/json
        • Input example: {"restKcollFL":{"stringDataFL":"hello"}}
        • Result:restKcollFL has only {”dataString”:”hello”} and other data are lost.
    • IColl:
      • URL:
        http://localhost:8080/TestRestChannel/rest/flows/restChannelFlow/FUBNHCDMCUBTACEPDFCTFREOCDETAFEUABIAFMIA/listFL/0
      • Content type: application/json
      • Input example: {"dataString":"hello"}
      • Result: The KColl with index 0 in listFL would change to {"dataString":"hello"} and other data are lost.
  4. Move to the next state of flow (POST). Access the URL by POST.
    http://localhost:8080/TestRestChannel/rest/flows/restChannelFlow/FUBNHCDMCUBTACEPDFCTFREOCDETAFEUABIAFMIA
    Input: {"dse_nextEventName":"toNextEvent"}
    Note: dse_nextEventName is the parameter of system and toNextEvent is the next event name of the state.
  5. Delete elements in flow (Delete). Access the URL by Delete method.
    • Field:
      http://localhost:8080/TestRestChannel/rest/flows/restChannelFlow/FUBNHCDMCUBTACEPDFCTFREOCDETAFEUABIAFMIA/stringDataFL
    • KColl:
      http://localhost:8080/TestRestChannel/rest/flows/restChannelFlow/FUBNHCDMCUBTACEPDFCTFREOCDETAFEUABIAFMIA/restKcollFL/stringDataFL
    • IColl: delete the data with index 0 in listFL
      http://localhost:8080/TestRestChannel/rest/flows/restChannelFlow/FUBNHCDMCUBTACEPDFCTFREOCDETAFEUABIAFMIA/listFL/0