Compiling and Deploying the Custom Form

Procedure

  1. Set CUST_DEVROOT to your preferred location.
  2. Change to the %MQ_HOME%\build\custom.
  3. Execute the customutil script as follows:
    customutil.sh -createDirStructure

    This command creates a directory structure in the directory specified by the CUST_DEVROOT variable. You might notice some errors. However, as long as the directory structure is created, you can ignore the errors.

  4. Set the ANT_HOME variable as follows:
    set ANT_HOME=%MQ_HOME%\bin\buildTool
  5. Set the PATH variable as follows:
    set PATH=%PATH%;%MQ_HOME%\bin\buildTool\bin
  6. Create a %MQ_HOME%\thirdparty directory and copy the XMLC JAR files, gnu-regexp JAR files, and the jsse JAR files to the %MQ_HOME%\thirdparty directory.
  7. Create the template folder in the %CUST_DEVROOT%\src\com\tibco\mdm\ui\workflow\engine\workitem directory.
  8. Copy the custom HTML to the following directories:
    • Workitem:
      %CUST_DEVROOT%\src\com\tibco\mdm\ui\workflow\engine\workitem \templates
    • E-mail form:
      %CUST_DEVROOT%\src\com\tibco\mdm\ui\directory\contact
  9. Save all the HTML files in the html folder and other source files under relevant folders. For example, images in the images folder. After copying the HTML files, remember to change the links to images, css, and Javascript.
  10. Edit the $MQ_HOME\build\resources\html_interfaces.txt file to add a line for the HTML form that implements IWorkItemDisplayDoc:
    • Workitem:
      com.tibco.mdm.ui.workflow.engine.workitem.templates.MyCustomization=com.tibco.mdm.ui.infrastructure.IMqContent,com.tibco.mdm.ui.workflow.engine.workitem.workitem.IWorkItemDisplayDoc
    • E-mail form:
      com.tibco.mdm.ui.directory.contact.MyEmailCustomization=com.tibco.mdm.ui.infrastructure.IMqContent
  11. To compile HTML into xMLC classes, open a command prompt, change directory to %MQ_HOME%\build\custom, and execute the following command:
    ant compile

    The class files are created in the

    • Workitem:

      $CUST_DEVROOT\classes\servletclasses\WEB-INF\classes\com\tibco\mdm\ui\workflow\engine\workitem\templates directory

    • Form:
      $CUST_DEVROOT\classes\servletclasses\WEB-INF\classes\com\tibco\mdm\directory\contact
  12. To deploy the custom forms, open a command prompt, change directory to $MQ_HOME/build/custom and execute the following command:

    ant deployCustom

  13. Add the class file to the following:
    • For work item:

      ECM.ear\ECMClasses.jar\com\tibco\mdm\ui\workflow\engine\workitem\templates folder.

    • For Form:

      ECM.ear\ECMClasses.jar\com\tibco\mdm\directory\contact folder.

  14. If you want to create a custom TaskType to work on the HTML:
    1. Create a com.tibco.mdm.ui.workflow.engine.workitem.MyCustomization.java class that implements ICustomizer. Compile and deploy the class as described in the previous steps.
    2. In the createWorkItem activity of the workflow, modify the TaskType parameter with the new value as follows:

      <Parameter direction="in" name="TaskType" eval="constant" type="string">MATCHRECORD</Parameter>

    3. Associate the TaskType and the class by adding the following property in the ConfigValues.xml file:
      com.tibco.workflow.workitem.MATCHRECORD.class=com.tibco.mdm.ui.workflow.engine.workitem.MyCustomization
  15. Add an entry in WORKFLOWFORM table in application database. The attributes of this table and the value they take are:
    • ID: Primary Key, provide a unique number
    • VERSION: Default value. For example, 1.
    • OWNERORGANIZATIONID: Default value is 1 for all organizations. Otherwise, provide specific organization ID.
    • NAME: Custom form name.
    • DEFINITION: XMLC generated class name.
    • ACTIVE: Set to 'Y'.
    • MODMEMBERID: Default value is 101.
    • MODDATE: Provide current date.
    • MODVERSION: Default value is 1.
    • TYPE: EMAIL/TASK, depending on your form type. Use TASK for work item and EMAIL for Email.
    • ACTIONABLE: If form has some action, set to 'Y', otherwise 'N' for notifications.

      For example:

      INSERT INTO WORKFLOWFORM (ID, VERSION, OWNERORGANIZATIONID, NAME, DEFINITION, ACTIVE, MODMEMBERID, MODDATE, MODVERSION, TYPE, ACTIONABLE) VALUES (MQ_SEQUENCE_1.nextval, 1, 1, 'My Custom Form Name', 'com.tibco.mdm.ui.workflow.engine.workitem.template.MyCustomization', 'Y', 101, CURRENT_TIMESTAMP, 1, 'TASK', 'N');