amxbpm_item.js

The amxbpm_item.js file contains the code for detecting a login session, performing a login, and launching openworkitem or another WCC application.

When this file is loaded by an HTML page, an object named amxbpm_port is created and can be used by other script code in the page. The following functions are made available through that object:

  • amxbpm_port.setBaseUrl(strURL)

    This function sets the base portion of the address of the ActiveMatrix BPM server. (Note that all other functions make use of this base URL, so this function must be called before any others. )

    If you are deploying the sample application to the same ActiveMatrix BPM server that is hosting Workspace, and the sample application is using the same httpConnector (the same port), specify a blank string for the base URL. This causes the URL to be determined at runtime based on the URL used to launch the application.

    If you are deploying the sample application to a different ActiveMatrix BPM server than the one hosting Workspace, or the sample application will be using a different httpConnector (port number), specify the ActiveMatrix BPM server and port number using this function. (Keep in mind cross-domain scripting issues when deploying to a different server/port than the one used by Workspace; see Cross-Domain Scripting.)

    For example:

    amxbpm_port.setBaseUrl("http://server_name:8080");

  • amxbpm_port.ping()

    This function returns true if the browser currently has a login session established with the ActiveMatrix BPM server. This login session may exist because the user is already logged into another WCC application (including the Workspace application), or another web page could be open that has performed a login using the other methods provided in amxbpm_item.js.

  • amxbpm_port.login(userId, password)

    This function attempts to log into the ActiveMatrix BPM server using the user ID and password that have been provided. If the login is successful, the function returns true.

  • amxbpm_port.logout()

    This function logs out on the ActiveMatrix BPM server.

  • amxbpm_port.openWorkspace()

    This function launches the Workspace application in a separate browser window.

  • amxbpm_port.open()

    This function launches the openworkitem application in a separate browser window. If any of the following URL parameters were specified when launching the current page, they are forwarded to the openworkitem application:

    • Id;
    • Version;
    • ChannelId;
    • ProcessName;
    • ModuleName;
    • Description;

    The externalLogin parameter is automatically included in the information sent to the openworkitem application, but is based on the existence of a login session. It will be true if a login session is detected and false if not.

    If none of the parameters listed above are specified, the first work item in the logged-in user's Inbox is automatically displayed.