MicroStrategy ONE

Executing Multiple Events Using the URL API

URLs typically include only one event, but it is possible for a single URL to cause the execution of multiple events in a specified order. The ability to execute multiple events in a single request and define the order in which they are executed is important because it allows you to control the flow of page execution. While the Controller itself does not have the ability to redirect or specify page flow, you can cause different pages to be processed during a single request by sending multiple events in the request and using the evtorder parameter to call or stack these multiple events in a specified order.  After one page has finished processing, a different page can be displayed. When there are multiple events in the URL, the application processes each event individually and checks to make sure that the status is "Successful" after each event is processed.  If it is not, the remaining valid events are not processed.

To execute multiple events using the URL API and specify the exact order in which they should be executed, you must build a URL that includes the following:

  • Root URL for the environment in which you are operating (J2EE or .NET)

    J2EE environment

    http://webserver/MicroStrategy/servlet/mstrWeb

    .NET environment

    http://webserver/MicroStrategy/asp/main.aspx:

    where webserver is the name of the machine where MicroStrategy Web is installed.  

  • Separate sets of parameters that define each event to be executed

    For each event that should be executed by the request, you must provide all of the parameters required for that event to be executed. For example, to execute a report, you would need to include the appropriate evt and src parameters, as well as a reportID parameter specifying the exact report to be executed and a reportViewMode parameter specifying whether the report should be displayed as a grid, a graph, or both.  

  • Parameter that specifies the order in which multiple events should be executed

    You must add an evtorder parameter that lists the events to be executed— by the event ID— in the order in which they should be executed. Use the %2c separator to separate multiple events. The application checks the value of this parameter and processes the events in this list, in the order in which they appear, before it processes any other events found in the request.

  • Separate parameters, in the form eventID=1, for each event to be executed

    You must Include the ID of each of the events as a separate parameter in the URL so that MicroStrategy Web knows that the event has to be executed.

If a session needs to be created, you also need to include parameters that provide information such as the MicroStrategy project and Intelligence Server to which you want to connect, the port to use, and any necessary authentication information.  

The root URL is separated from the list of parameters with a "?" character, and the individual parameter name-value pairs are separated from one another with a "&" character. When individual parameters have multiple values, these values must be separated by special characters, such as commas, colons, and semi-colons. For example, the individual event IDs in theevtorderparameter are separated by the%2cseparator, the encode value for a comma. While most browsers will correctly interpret the comma as a separator between the event IDs, the safest approach is to use the encoded comma value— %2c— as a separator, although it is more difficult to read.

Explanation of a sample URL with multiple events

The sample URL shown below illustrates how to execute multiple events using the URL API. The events in this sample URL first execute the Shipping Analysis document in the MicroStrategy Tutorial project, then select  Southeast in the Region category, and finally export the document to PDF.

J2EE environment:

http://webserver/MicroStrategy/servlet/mstrWeb?

evt=2048001

&src=mstrWeb.2048001

&documentID=BAE6E1434B91F7C5465AB2BB1D4D78F5

&evt=20003

&src=mstrWeb.rwd.rwframe.pbb.20003

&elemKey=K25BB8D679D4B11D3E4981000E787EC6DE8A4:1:2:0:2:1:3:3:Southeast

&evt=3103

&src=mstrWeb.3103

&executionMode=3

&rwExportMode=1

&evtorder=2048001%2c20003%2c3103

&3103=1

&2048001=1

&20003=1

.NET environment:

http://webserver/MicroStrategy/asp/Main.aspx?

evt=2048001

&src=Main.aspx.2048001

&documentID=BAE6E1434B91F7C5465AB2BB1D4D78F5

&evt=20003

&src=Main.aspx.rwd.rwframe.pbb.20003

&elemKey=K25BB8D679D4B11D3E4981000E787EC6DE8A4:1:2:0:2:1:3:3:Southeast

&evt=3103

&src=Main.aspx.3103

&executionMode=3

&rwExportMode=1

&evtorder=2048001%2c20003%2c3103

&3103=1

&2048001=1

&20003=1

You cannot simply copy and paste the URLs shown above. In addition to replacing webserver with the name of your web server, you also need to get the actual value for the elemKey parameter because the one that is shown above contains a symbolic representation of an unprintable character.

The URL shown above will perform the following actions, in the order listed below (which is the order specified by the evtorder parameter in the URL):

  1. Execute the entire "Shipping  Analysis” document  

  2. Select different attribute elements in the page-by axis (select the Electronics category in Q4 only)  

  3. Export the document to PDF

The specific events to be executed and the order in which they are to be executed are specified in the URL, as shown below:

&evtorder=2048001%2c20003%2c3103

&3103=1

&2048001=1

&20003=1

The separate pieces of the URL for each individual event are shown below in the order in which they are executed.

  1. Execute the entire “Shipping Analysis” document

    J2EE environment:

    evt=2048001

    &src=mstrWeb.2048001

    &documentID=BAE6E1434B91F7C5465AB2BB1D4D78F5

    .NET environment:

    evt=2048001

    &src=Main.aspx.2048001

    &documentID=BAE6E1434B91F7C5465AB2BB1D4D78F5

     

  1. Select different attribute elements in the page-by axis (select only Southeast in the Region category)

    J2EE environment:

    &evt=20003

    &src=mstrWeb.rwd.rwframe.pbb.20003

    &elemKey=K25BB8D679D4B11D3E4981000E787EC6DE8A4:1:2:0:2:1:3:3:Southeast

    .NET environment:

    &evt=20003

    &src=Main.aspx.rwd.rwframe.pbb.20003

    &elemKey=K25BB8D679D4B11D3E4981000E787EC6DE8A4:1:2:0:2:1:3:3:Southeast

  2. Export the entire “Shipping Analysis” document to PDFL

    J2EE environment:

    &evt=3103

    &src=mstrWeb.3103

    &executionMode=3

    &rwExportMode=1

    .NET environment:

    &evt=3103

    &src=Main.aspx.3103

    &executionMode=3

    &rwExportMode=1

See also