Raising Events from External Products

Note: This topic assumes that you understand events and event definitions. For information about them, see About Events and About Application Links and Event Definitions.

Any external product that is capable of calling a Web service can raise events in SBM by calling a corresponding Web service. SBM Composer provides the ability to automatically generate a .wsdl file that you can use in the external product to call the Web service.

For example, suppose you use Salesforce.com to track customer prospects, and want to have a new item created in SBM whenever a potential customer is initially contacted. You can raise an external event that causes an asynchronous orchestration workflow to run whenever this event occurs. The orchestration workflow creates the item in SBM.

Because the event provides the inputs for the workflow, the .wsdl file must be designed specifically for the event and its associated orchestration workflows. You start by defining a custom event definition that defines the data you want to pass to the workflow. This event definition defines both the event that the external product will raise and the inputs for the orchestration workflow. The event definition determines the content of the .wsdl file. When you click the Export external event WSDL button in the event definition Property Editor, the .wsdl file that will be used to raise the event is created.

The following procedure describes a way to raise an external event that updates a field in a SBM item. In this procedure, a sales product sends an external event to update the Discount Percent field. In SBM Composer, you define two custom data fields in a custom event definition: ItemID and DiscountPercent. The orchestration workflow that is invoked when the external event is raised updates the item with the specified discount amount.

To update the discount percent value in an SBM item:

  1. Create a new orchestration process app.
  2. In App Explorer, right-click Application Links, and then select Add New Event Definition.
  3. In the Event Definition Configuration dialog box that opens, create a new custom event definition as shown in the following illustration, and then click OK.

    image

  4. Define values in the event definition editor that opens as shown in the following illustration. See Creating a New Custom Event Definition for more information.

    The Extension element is automatically added to the Custom data. Its Type is the event definition name with EventNoticeExtension appended to it.

    image

    The properties for the Extension element include its named type and namespace.

    image

  5. On the Event Map tab of the event definition Property Editor, click Add.
  6. In the Map Event Definition to Workflow dialog box that opens, select [New Workflow] and then click OK.

    image

    A new orchestration workflow is added to App Explorer.
  7. On the General tab of the event definition Property Editor, click Export external event WSDL, and save the .wsdl file to the file system of your computer.

    image

  8. Click the orchestration workflow that was added to App Explorer and add a Service step to it as shown below. This is the orchestration workflow that will be invoked when the external event is raised.

    image

  9. Configure the UpdateItem step to update the discount amount:
    1. On the General tab of the step Property Editor, select the Web service and operation shown in the following illustration.

      image

    2. Click the Data Mapping tab of the step Property Editor.
    3. Expand id under item, click in the Source elements column for the tableIdItemId step input, and then select ItemID under Extension in the Select a source popup that opens. (This is one of the custom data fields you added to the custom event definition.)

      image

    4. Click OK. The path is added to the Source elements column.

      image

    5. Right-click the extendedField[] step input, and then select Add Array Record. Expand extendedField[1], and then type DISCOUNTPERCENT in the Default value column for the dbName step input. This is the database name of the field that will be updated.
    6. Expand the value[] step input, right-click, and then select Add Array Record. Expand value[1] and then and then click in the Source elements column for the displayValue step input. In the Select a source popup that opens, select DiscountPercent under Extension. (This is the other custom data field you added to the custom event definition.) Click OK. The path is added to the Source elements column.

      image

  10. Deploy the process app.
  11. Use the exported .wsdl file to create a SOAP request to raise an external event. You can use any third-party product that can create and send SOAP requests to do this. If you are an advanced user, you can alternatively create the SOAP request manually and then send it in an e-mail message. For more information, see Raising an External Event through E-mail.