2Defining Workflows for Siebel EAI

Defining Workflows for Siebel EAI

This chapter explains workflow integration processes and how to use them to develop your integration projects. The chapter depends on several sample workflows that are included in Siebel. It contains the following topics:

Note: In version 8.0 and higher of Siebel, workflow processes are created in Siebel Tools. However, the sample workflows in this chapter are found in the Administration - Business Process screen, then the Workflow Processes view in the Siebel client.

For information on creating workflow processes, see Siebel Business Process Framework: Workflow Guide.

Sample Integration Workflows

Siebel EAI includes several sample workflows that illustrate how you can receive, process, and send integration messages. This chapter includes four of those samples, along with brief descriptions that are intended to help you understand the workflow elements specific to Siebel EAI.

Note: One of the methods of invoking a workflow process is through a workflow policy. To invoke a workflow process that includes steps that call EAI adapters from a workflow policy, you must create a workflow policy action using the Run Workflow Process workflow policy program. The workflow policy action will invoke the Workflow Process Manager component. For information on creating workflow policies, see Siebel Business Process Framework: Workflow Guide.

The sample workflows explained in this chapter include:

    Import Account (File)

    This is a sample workflow process that reads an XML file (c:\account.xml) and imports the account information into the Siebel environment using the EAI XML Read from File business service. The EAI XML Read from File business service converts the data and the EAI Siebel Adapter updates the Siebel database.

    To review the Import Account (File) sample workflow process

    1. Navigate to Administration - Business Process, then Workflow Processes.

    2. Query for Import Account (File).

    3. With the Import Account (File) workflow process selected, click the Process Properties tab in the lower applet to review the process properties for this workflow process.

      Workflow process properties are global to the entire workflow. For example, as shown in the following table, the Import Account (File) workflow has several properties. The Account Message is defined to identify the output of the Read File step (a parsed version of the XML Account Message) as a hierarchical structure. The Error Message, Error Code, Object Id, and Siebel Operation Object Id properties are included in the workflow by default.

      Name Data Type In/Out

      Account Message

      Hierarchy

      In/Out

      Error Code

      String

      In/Out

      Error Message

      String

      In/Out

      Object Id

      String

      In/Out

    4. Click the Process Designer tab in the lower applet to review the process design for this workflow process.

      In this image of a workflow, items are connected in the following order: Start, Read File, Update Account, End.
    5. Double-click the Read File step to review its method and arguments.

      This step uses the Read Siebel Message method of the EAI XML Read from File business service to convert XML from a file into an integration object hierarchy, with the following input argument.

      Input Arguments Type Value

      File Names

      Literal

      c:\account.xml

      Note how the path and file name are specified as a string in the Value field of the Input Arguments applet.

      Also note the following output property for this step.

      Property Name Type Output Argument

      Account Message

      Output Argument

      Siebel Message

    6. Double-click the Update Account step to review its method and arguments.

      This step uses the EAI Siebel Adapter business service with the Insert or Update method to read the Siebel Message and update or insert the Account object in the Siebel Database. The EAI Siebel Adapter uses the information in the XML file and the following input argument to accomplish this task.

      Arguments Type Property Name Property Data Type

      Siebel Message

      Process Property

      Account Message

      Hierarchy

      Because the Insert or Update method is specified on the EAI Siebel Adapter business service, this step checks the Siebel Database to see if the Account object defined in the XML file already exists in the database. If the account exists, then it updates the account in the database with the account instance from the XML file; otherwise, it inserts the account into the database.

      Export Account (File)

      This sample workflow process exports an account to a file in an XML format. This workflow uses the EAI Siebel Adapter and the EAI XML Write to File business service to query the data and then convert the data from the Siebel business object to an XML document.

      To review the Export Account (File) sample workflow process

      1. Navigate to Administration - Business Process, then Workflow Processes.

      2. Query for Export Account (File).

      3. With the Export Account (File) workflow process selected, click the Process Properties tab to review the process properties for this workflow process.

        Workflow process properties are global to the entire workflow. For example, as shown in the following table, the Export Account (File) workflow has several properties. The Output Message property is defined to identify the outbound account as a hierarchical structure. The Object Id property is included in each workflow by default.

        Name Data Type In/Out

        Object Id

        String

        In/Out

        Output Message

        Hierarchy

        In/Out

      4. Click the Process Designer tab in the lower applet to review the process design for this workflow process.

        In this image of a workflow, items are connected in the following order: Start, Get Account, Write to File, End.
      5. Double-click the Get Account step to review its method and arguments.

        This step uses the EAI Siebel Adapter business service to query an account from your Siebel Database. The EAI Siebel Adapter uses the following input arguments.

        Input Arguments Type Value Property Name Property Data Type

        Output Integration Object Name

        Literal

        Sample Account

        -

        -

        Object Id

        Process Property

        -

        Object Id

        String

        Note that Output Integration Object Name of Sample Account is part of the query criteria. The Sample Account integration object describes the structure of the Account business object and was created using the Integration Object Builder. The other part of the query criteria is the Object Id, which is a process property that includes the account number 1-6 defined as a process property before.

        Also note the following output property for this step.

        Property Name Type Output Argument

        Output Message

        Output Argument

        Siebel Message

        The output from this step is Output Message. Output Message is a process property that will include the Siebel Message, which contains data for the account. The format is specified by the Sample Account integration object.

      6. Double-click the Write to File step to review its method and arguments.

        This step invokes the EAI XML Write to File business service with the Write Siebel Message method. The EAI XML Write to File uses the following input arguments.

        Input Arguments Type Value Property Name Property Data Type

        File Name

        Literal

        c:\account.xml

        -

        -

        Siebel Message

        Process Property

        -

        Output Message

        Hierarchy

        The EAI XML Write to File business service converts the hierarchical message to XML and writes the resulting document to the file named in the File Name argument.

        Import Employee (MQSeries)

        This is a sample workflow process that receives an XML string from an IBM MQSeries queue and updates the Employee instance in the Siebel Database.

        To review the Import Employee (MQSeries) sample workflow process

        1. Navigate to Administration - Business Process, then Workflow Processes.

        2. Query for Import Employee (MQSeries).

        3. With the Import Employee (MQSeries) process selected, click the Process Properties tab to review its process properties.

          Workflow process properties are global to the entire workflow. For example, as shown in the following table, the Import Employee (MQSeries) workflow has several properties. The Employee Message contains the object as an integration object hierarchy, when converted. The object must be in that format before it can be inserted or updated in the Siebel environment. The Employee XML property defines the MQSeries message as XML recognizable by Siebel applications. The Error Code, Error Message, Object Id, and Siebel Operation Object Id properties are included in the workflow by default.

          Name Data Type

          Employee Message

          Hierarchy

          In/Out

          Employee XML

          Binary

          In/Out

          Error Code

          String

          In/Out

          Error Message

          String

          In/Out

          Object Id

          String

          In/Out

          Siebel Operation Object Id

          String

          In/Out

        4. Click the Process Designer tab in the lower applet to review the process design for this workflow process.

          In this image, items are connected in the following order: Start, Receive, Convert to Internal, Update Employee, End.
          Note: When using the MQSeries Receiver, remember that the MQ Receiver task will read the message from the queue and pass it into your workflow process in the <Value> field. This means your workflow process does not need to read the message from the MQSeries Queue. To get the XML string that has been read, you need to create a process property and set its default value as follows: Name=MyXMLStringProperty and Default= <Value>. You should use this process property as the input to the EAI XML Converter business service.
        5. Double-click the Receive step to review its method and arguments.

          This step uses the Receive method of the EAI MQSeries Server Transport to get the inbound message from the Employee physical queue named in the Physical Queue Name argument. This step uses the following input arguments.

          Input Arguments Type Value

          Physical Queue Name

          Literal

          Employee

          Queue Manager Name

          Literal

          Siebel

          As shown in the following table, the output from this step is put into the Employee XML process property with the assumption that the inbound message is already in XML format.

          Property Name Type Output Argument

          Employee XML

          Output Argument

          Message Text

        6. Double-click the Convert to Internal step to review its method and arguments.

          This step uses the XML to Property Set method of the EAI XML Converter to convert the inbound message to the Siebel business object format. The step uses the following input argument.

          Input Arguments Type Property Name Property Data Type

          XML Document

          Process Property

          Employee XML

          Binary

          The output from this step is passed in the Employee Message output argument as described in the following table.

          Property Name Type Output Argument

          Employee Message

          Output Argument

          Siebel Message

        7. Double-click the Update Employee step to review its method and arguments.

          This step uses the EAI Siebel Adapter business service with the Insert or Update method and the following input argument to update the database.

          Input Arguments Type Property Name Property Data Type

          Siebel Message

          Process Property

          Employee Message

          Hierarchy

          The EAI Siebel Adapter checks the Siebel Database for an Employee record that matches the current instance of Employee in the Employee Message property. If an Employee record matching the current instance does not exist in the database, the EAI Siebel Adapter inserts the record into the database; otherwise, it updates the existing record with the instance.

          Export Employee (MQSeries)

          This is a sample workflow process that sends an XML string for an employee to an IBM MQSeries queue.

          To review the Export Employee (MQSeries) sample workflow process

          1. Navigate to Administration - Business Process, then Workflow Processes.

          2. Query for Export Employee (MQSeries).

          3. With the Export Employee (MQSeries) workflow process selected, click the Process Properties tab to review the process properties defined for this workflow process.

            Workflow process properties are global to the entire workflow. For example, as shown in the following table, the Export Employee (MQSeries) workflow has multiple properties. The Employee Message contains the object as an integration object hierarchy, before conversion. The Employee XML property specifies the Siebel object that has been converted to XML. The Error Code, Error Message, Object Id, and Siebel Operation Object Id properties are included in each workflow by default.

            Name Data Type In/Out Default String

            Employee Message

            Hierarchy

            In/Out

            -

            Employee XML

            Binary

            In/Out

            -

            Error Code

            String

            In/Out

            -

            Error Message

            String

            In/Out

            -

            Object Id

            String

            In/Out

            1-548

            Siebel Operation Object Id

            String

            In/Out

            -

            Note that the Object Id process property is set to 1-548 in the Default String column. This string identifies an actual employee record in the Siebel Database by its Row Id. You can set this workflow to use the active employee record instead of specifying a hard-coded employee number. You can accomplish this by creating a button that invokes this workflow from the Administration - User, then the Employees view, or you can pass the value of the Object Id into the workflow process as an input argument.

          4. Click the Process Designer tab in the lower applet to review the process design for this workflow process.

            In this image of a workflow, items are connected in the following order: Start, Get Employee, Convert to XML, Send, End.
          5. Double-click the Get Employee step to review its method and arguments.

            This step uses the Query method of the EAI Siebel Adapter business service, with the following input arguments to get an instance of an Employee record from the Siebel Database. The Sample Employee integration object describes the structure of the Employee business object and was created using the Integration Object Builder wizard. The other part of the query criteria is the Object Id, which is a process property containing value 1-548.

            Input Arguments Type Value Property Name Property Data Type

            Output Integration Object Name

            Literal

            Sample Employee

            -

            -

            Object Id

            Process Property

            -

            Object Id

            String

            The output from this step is passed in the Employee Message output argument as described in the following table.

            Property Name Type Output Argument

            Employee Message

            Output Argument

            Siebel Message

          6. Double-click the Convert to XML step to review its method and arguments.

            This step uses the Property Set to XML method of the EAI XML Converter business service to convert the outbound Siebel Message to XML. The converter stores the outbound Siebel Message in the Employee XML output argument with the following input argument.

            Input Arguments Type Property Name Property Data Type

            Siebel Message

            Process Property

            Employee Message

            Hierarchy

            The output from this step is passed in to the Employee XML output argument as shown in the following table.

            Property Name Type Value Output Argument

            Employee XML

            Output Argument

            -

            XML Document

          7. Double-click the Send step to review its method and arguments.

            This step invokes the EAI MQSeries Server Transport business service with the Send method to put the XML message onto the MQSeries queue, Employee. The message is represented by the Message Text argument, as shown in the following table.

            Input Arguments Type Value Property Name Property Data Type

            Message Text

            Process Property

            -

            Employee XML

            String

            Physical Queue Name

            Literal

            Employee

            -

            -

            Queue Manager Name

            Literal

            Siebel

            -

            -

            The Queue Manager that handles the request is called Siebel. The XML message is put onto the Employee queue, where it remains until another application retrieves it from the queue.

            Testing the Workflow Integration Process

            When you have finished defining your integration workflow process, you can use the Workflow Process Simulator to test its behavior.

            The Workflow Process Simulator, included in the Workflow Process Manager, allows you to validate your processes before deploying them in production environments.

            When you simulate an integration process that performs some external action—for example, the Export Account (File) workflow writes an XML file to a disk location—you can verify the end result by checking if the output object exists, or if a predetermined event has occurred.

            Note: You can also enable detailed client logging and use the /s option for creating SQL spool scripts. This option provides more detailed information when running the integration workflow process in the Workflow Process Simulator. For details, see Siebel Remote and Replication Manager Administration Guide.

            To test the workflow processes described in this chapter using the Workflow Process Simulator, you must export them to an XML file from the Workflow Processes view in the Siebel client, and then import the XML file into the Workflow Processes list in Siebel Tools. The Workflow Process Simulator runs from Siebel Tools.

              Exporting the Workflow Process to an XML File

              You export the workflow process from the Workflow Processes view in the Siebel client. In this example, Export Account (File) is exported.

              To export a workflow process to an XML file

              1. Navigate to Administration - Business Process, then Workflow Processes.

              2. Query for Export Account (File).

              3. From the pull-down menu, choose Export Workflow.

              4. Choose a location to save the XML file.

              The workflow process XML file, in this example Export Account (File).xml, is created.

                Importing the XML File Into Siebel Tools

                You import the workflow process XML file into the Workflow Processes list in Siebel Tools.

                To import the XML file into Siebel Tools

                1. In the Object Explorer in Siebel Tools, select Workflow Process.

                2. Right-click inside the Workflow Processes list in the Object List Editor, then choose Import Workflow Process.

                3. Browse for the workflow process XML file, then click Open.

                The workflow process is imported into Siebel Tools.

                  Running the Workflow Process Simulator

                  You run the Workflow Process Simulator from the Workflow Process list in Siebel Tools.

                  To simulate a workflow process

                  1. In Siebel Tools, choose Toolbars, then the Simulate view to activate the Simulator.

                  2. In the Object Explorer in Siebel Tools, select Workflow Process.

                  3. Query for Export Account* in the Object List Editor.

                  4. Right-click on Export Account (File), then choose Simulate Workflow Process.

                    The Workflow Process Designer appears and the Start element has a highlighted border to indicate that it is the active element.

                  5. Click Start Simulation in the Simulate toolbar.

                    A new instance of the Siebel Debugger starts and then runs the Simulator.

                  6. Click Simulate Next to activate the next step.

                    As you step through the process, the border of each active element becomes highlighted in turn, unless the simulator encounters an error, in which case it displays an error message alert.

                  7. Click Complete Simulation to pause.

                  8. Click Stop Simulation to stop.

                  For more information about running the Workflow Process Simulator, reviewing process values, and using Workflow Process Manager and Workflow Batch Manager, see Siebel Business Process Framework: Workflow Guide.

                  Note: Use the Workflow Process Simulator only for testing purposes. Do not use the Workflow Process Simulator to load data.