Integrating third-party applications in HTML Workspace

Adobe® LiveCycle® Workspace supports the management of task assignment and completion activities for forms and documents. These forms and documents can be XDP Forms, Flex® forms, or Guides (deprecated) that have been rendered in XDP, PDF, HTML, or Flex formats.

These capabilities are further enhanced. LiveCycle now supports collaboration with third-party applications that support functionality similar to the Livecycle Workspace. A common part of this functionality is the workflow of assignment and subsequent approval of a task. LiveCycle provides a single unified experience for Livecycle enterprise users so that all such task assignments or approvals for the supported applications can be handled through Livecycle Workspace.

As an example, let us consider Correspondence Management as the sample candidate for integration with HTML Workspace. Correspondence Management has the concept of a 'Letter', which can be rendered and allows actions.

Create Correspondence Management assets

Start by creating a sample Correspondence Management template that is rendered in HTML Workspace. For more details, see Working with letter templates' topic in Correspondence Management guide.

Access the Correspondence Management template at its URL to verify if the Correspondence Management template can be rendered successfully. The URL has a pattern similar to http://[server]:[port]/lc/content/cm/createcorrespondence.html?cmLetterId=encodedLetterId&cmUseTestData=1&cmPreview=0;

where encodedLetterId is the URL-encoded letter Id. Specify the same letter Id, when defining the render process for Workspace task in Workbench.

Create Custom Render/Submit Process

The custom render/submit process let you use the data specified in 'Assign Task' operation. The process interprets the location of the form template and data and returns it appropriately to the workspace client.

Use the following steps to create a custom renderer:

  1. Launch Workbench. Log in to localhost as administrator.

  2. Click File > New > Application. In the Application Name field, enter CMDemoSample and then click Finish.

  3. Select CMDemoSample/1.0 and right-click NewProcess. In the name field, enter CMRenderer and then click Finish.

  4. Drag the Activity Picker and add the Set Value Operation.

  5. Create an output variable runtimeMap of type ‘map’ and subtype ‘object’ (WorkflowDSC > object).

  6. Add mappings as shown here.

    Location Expression  
    /process_data/runtimeMap[@id="hint:externalAppForm"]
    true()
    Denotes if the application is an external application. Value in this field is mandatory for successful integration.
    /process_data/runtimeMap[@id="externalAppFormUrl"]
    concat('/lc/content/cm/createcorrespondence.html?cmLetterId=',/process_data/@letterId,'&cmUseTestData=1&cmPreview=0&cmLcWorkspace=1')
    Complete URL, which when loaded in Workspace client iframe, renders the external application form user interface.
    /process_data/runtimeMap[@id="externalAppFormType"] 'text/html' Optional. Denotes the external app content type. Not in use currently. Meant for any possible future enhancements (Default: text/html)
    /process_data/runtimeMap[@id="hideACLActions"]
    true()
    Optional. If true, hides actions such as forward, reject, and share from the user interface (Default: false)
    /process_data/runtimeMap[@id="hideDirectActions"] false() Optional. If true, hides actions such as submit and save from the user interface (Default: false)
    /process_data/runtimeMap[@id="cancelMessage"] 'submitCancel' Optional. Message from third-party app to notify Workspace to cancel the task (that is, close without save/submit). (Default: cancel)
    /process_data/runtimeMap[@id="errorMessage"] 'submitFault' Optional. Message from third-party app to notify Workspace that an error occurred. (Default: error)
    /process_data/runtimeMap[@id="successMessage"] 'submitSuccess' Optional. Message from third-party app to workspace that an event has occurred successfully. (Default: submit)
    /process_data/runtimeMap[@id="actionEnabledMessage"] 'actionChanged'
    Optional. Message from third-party app to notify workspace whether to enable a direct action button. The third-party app is required to send a payload (true/false).
    /process_data/runtimeMap[@id="externalAppName"] 'ccrSwf'
    Optional. Id of the embed tag of the third-party application. (Default 'ccrSwf')
  7. Drag the Activity Picker to add an Execute Script Operation.

  8. Add the following script:

    import java.util.Map;

    import java.util.HashMap;

    Map runtimeMap = patExecContext.getProcessDataMapValue("runtimeMap");

    Map routeActionMap = new HashMap();

    routeActionMap.put("complete","Submit");

    routeActionMap.put("Approve","Submit");

    routeActionMap.put("Reject","Submit");

    runtimeMap.put("routeActionMap",routeActionMap);

    patExecContext.setProcessDataMapValue("runtimeMap",runtimeMap);

    This maps the user actions defined for the task with the third-party application actions. If no user action is defined for the task, ‘complete’ is used. Otherwise, the named actions are used. Since a render service is orchestration-agnostic, map all possible user actions (across processes) to the corresponding third-party app actions.

  9. Add another variable to the application named letterId of type string. Mark it as input and required

    Note:

    Correspondence Management does not have a requirement of custom submit process as Correspondence Management submit takes care of the post process requirements. For other applications, a custom submit can be created for the additional requirements.

Create a Task to view the external app

Correspondence Management integration in HTML Workspace

  1. Add a new process called CMTest to the application.

  2. Add an xdp (say ApplicationforLongTermCareServices.xdp) to the application and place it under CMDemoSample/CMDemoSample/1.0

  3. Select ‘AssignTask’ from Activity Picker. A warning may appear asking you to change the process from short lived to long lived. Click Yes.

  4. In ‘Initial User Selection’, select ‘Assign to specific user’ and add user (say Gloria Rios).

  5. In the ‘Presentation and Data’ tab’ for the asset, browse to ApplicationforLongTermCareServices.xdp added in step 2. This asset is a placeholder and will not be used in case of external application.

  6. Click on ‘Manage Action Profiles’

  7. Add a new Action Profile and name it CMTest

  8. In Render Process, select the renderer you created, that is
    /CMDemoSample/1.0/CMRenderer.process

  9. Click OK. Render process properties are displayed as shown here:

    Specify a letter Id for example /content/apps/cm/correspondence/letters/NoticeOfActionLetterWithoutPostProcess. This is the same letter Id that you created at the beginning of the exercise.

  10. Deploy the Application. Check in and save assets if prompted.

  11. Right click on the CMTest process from Workbench and select Invoke.

  12. Login to HTML Workspace http://[server]:[port]/lc/content/ws as Gloria Rios, as specified in Step 4.

     

  13. Open the task you had added. The Correspondence Management Letter should open up.

     

  14. Fill in the required data and submit the letter. The window should close. Any Correspondence Management post-process activity associated with the letter is invoked.

Get help faster and easier

New user?