Composing Data

Once the raw data is loaded, compose it into canonical items. The composition phase has two processes: grouping and composition.

Context

Follow the steps to compose the raw items and check to see if the composition was successful.

Procedure

  1. From a command prompt, issue the following cURL command to launch composition.
    curl -k -u admin:<password> --request POST https://localhost:8443/datahub-webapp/v1/pools/GLOBAL/compositions

    Data Hub responds on the server side with:

    2016-06-15 15:06:06,757 [INFO] [c.h.d.r.r.PoolActionResource] Received POST request /compositions with args [GLOBAL] with user [admin]
    2016-06-15 15:06:06,774 [DEBUG] [c.h.d.s.i.DefaultEventPublicationService] Publishing data hub event : PerformCompositionEvent{actionId=1}
    2016-06-15 15:06:06,777 [DEBUG] [c.h.d.p.i.EventBasedProcessMonitor] Registered Composition #1: 1 processes running
    2016-06-15 15:06:06,784 [DEBUG] [c.h.d.s.i.DefaultEventPublicationService] Publishing data hub event : CompositionStartedEvent{actionId=1}
    2016-06-15 15:06:06,858 [DEBUG] [c.h.d.s.i.DefaultRawTypeComposerService] 2 items found for composition of type RawProduct
    2016-06-15 15:06:07,033 [DEBUG] [c.h.d.s.i.DefaultRawTypeComposerService] 0 items found for composition of type RawProduct
    2016-06-15 15:06:07,036 [DEBUG] [c.h.d.s.i.AkkaEnabledCompositionActionHandler] Entering handleCompositionSuccess
    2016-06-15 15:06:07,052 [DEBUG] [c.h.d.s.i.DefaultEventPublicationService] Publishing data hub event : CompositionCompletedEvent{actionId=1, status=SUCCESS}
    2016-06-15 15:06:07,054 [DEBUG] [c.h.d.c.e.CompositionActionContinuationEventHandler] Querying for Raw Items in pool GLOBAL remaining in PENDING state.
    2016-06-15 15:06:07,059 [DEBUG] [c.h.d.p.i.EventBasedProcessMonitor] Unregistered Composition #1, 0 processes running
    
  2. From a command prompt, issue the following cURL command to check whether composition was successful.
    curl -k -u admin:<password> --request GET https://localhost:8443/datahub-webapp/v1/pools/GLOBAL/compositions

    Data Hub responds on the client side with:

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
    <compositionActionDatas>
    	<compositionActionData>
    		<actionId>1</actionId>
    		<type>COMPOSITION</type>
    		<startTime>2016-06-15T15:06:06.813-06:00</startTime>
    		<endTime>2016-06-15T15:06:07.039-06:00</endTime>
    		<status>SUCCESS</status>
    		<poolName>GLOBAL</poolName>
    		<count>1</count>
    	</compositionActionData>
    </compositionActionDatas>

Results

The POST request you sent in step one triggered the composition of all items in the GLOBAL data pool. The request caused the raw item to be transformed into a canonical item, according to your canonical data model. This canonical item is now ready for transformation into a target item for one or more target systems. In the next tutorial you publish this item to a file using the file adapter.