Sample Trace File

Trace files help you gain a good understanding of what happened in the workflow.

A sample trace file is as follows:

********** Running process selection for event 85072 of type Start
Starting workflow #1/2
Process Selection Inputs
------------------------
	DocFormat = mlXML
	DocType = CatSource
	DocSubType = CatSourceLoad
	Sender Enterprise = null
	Sender Organization = null
	Receiver Enterprise = TESTORG
	Receiver Organization = testOrg
	Receiver Name = admin
	Originalsender = null
Selected process: No process was selected, for process 1
Starting workflow #2/2
Process Selection Inputs
------------------------
	DocFormat = mlXML
	DocType = CatSource
	DocSubType = CatSourceLoad
	Sender Enterprise = null
	Sender Organization = null
	Receiver Enterprise = TESTORG
	Receiver Organization = testOrg
	Receiver Name = admin
	Originalsender = null
Selected process: standard/workflow/wfin26catsourcev4
*************** Workflow Definition **************
<?xml version="1.0" encoding="UTF-8"?>
<!--
    Route the Import Data into Repository Workitem to Approvers.
    Note: We assume that Contains relationship has AUTOBUNDLE = 'Y'.
          If Contains has AUTOBUNDLE = 'N', then out of box import workflow will not work correctly.
          This is because out of box import workflow has 'Contains' being passed into the activity ManageRecordCollection.
          Therefore, if Contains is AUTOBUNDLE = 'N', all records imported will be a root record. No Bundles will be created and processed during import.
          BUT, since Contains is passed into SPAWN by default, then bundles will get created and spawned, which
          is INCONSISTENT with what was processed during import.
          THEREFORE, this workflow should be configured correctly if Contains relationship is changed.
-->
<Workflow Version="1.3"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:noNamespaceSchemaLocation="Workflow.xsd">
	<Owner>TIBCO</Owner>
	<Name>wfin26catsourcev4</Name>
	<Description
        lang="en">Data Source upload and import</Description>
	<Parameter
        direction="in" eval="variable" name="inDoc"
        type="document">1</Parameter>
	<Parameter direction="out"
        eval="variable" name="inDoc"
        type="document"/>
	<!--Execution>SYNCHR</Execution-->
	<Activity
            Name="AddMsgInfoToEvent">
		<Start/>
		<Action>UpdateEvent</Action>
		<Description
            lang="en">Initialize event info</Description>
		<Parameter
            direction="in" eval="constant" name="eventState"
            type="string">START</Parameter>
		<Parameter direction="in"
            eval="xpath" name="eventDescriptor"
            source="/Message/Body/Document/@subtype"
            type="string">inDoc</Parameter>
		<Parameter direction="in"
            eval="xpath" name="deploymentMode"
            source="/Message/@messageType"
            type="string">inDoc</Parameter>
		<Parameter direction="in"
            eval="constant" name="dbDirectLoadDump"
            type="string">N</Parameter>
		<Parameter direction="in"
            eval="constant" name="eventType"
        type="string">CAT</Parameter>
	</Activity>
	<Activity
            Name="UploadDataSource">
		<Action>UploadDataSource</Action>
		<Description
            lang="en">Upload data source summary</Description>
		<Parameter
            direction="in" eval="constant" name="eventState"
            type="string">UPLOAD</Parameter>
		<Parameter direction="in"
            eval="xpath" name="DataSource"
            source="/Message/Body/Document/BusinessDocument/CatalogAction/CatalogActionHeader/DataSource/RevisionID/BaseName/text()"
            type="string">inDoc</Parameter>
		<Parameter direction="in"
            eval="variable" name="InDocument"
            type="document">inDoc</Parameter>
		<Parameter
            direction="in" eval="constant" name="MaxNumberOfErrors"
            type="long">50</Parameter>
		<Parameter direction="out"
            eval="variable" name="TotalRecordsAttempted"
            type="long">totalRowsAttempted</Parameter>
		<Parameter
            direction="out" eval="variable"
            name="TotalRecordsWithErrors"
        type="long">totalRowsWithErrors</Parameter>
	</Activity>
	<Activity
            Name="ImportCatalog">
		<Action>ImportCatalog</Action>
		<Description
            lang="en">Import summary</Description>
		<Parameter
            direction="in" eval="constant" name="eventState"
            type="string">IMPORT</Parameter>
		<Parameter direction="in"
            eval="xpath" name="MasterCatalog"
            source="/Message/Body/Document/BusinessDocument/CatalogAction/CatalogActionHeader/MasterCatalog/RevisionID/BaseName/text()"
            type="string">inDoc</Parameter>
		<Parameter direction="in"
            eval="xpath" name="Incremental"
            source="/Message/Body/Document/BusinessDocument/CatalogAction/CatalogActionHeader/MasterCatalog/Extension[@name='Incremental']/Value/text()"
            type="string">inDoc</Parameter>
		<Parameter direction="in"
            eval="xpath" name="MergeData"
            source="/Message/Body/Document/BusinessDocument/CatalogAction/CatalogActionHeader/MasterCatalog/Extension[@name='MergeData']/Value/text()"
            type="string">inDoc</Parameter>
		<Parameter direction="in"
            eval="xpath" name="SplitImportBatch"
            source="/Message/Body/Document/BusinessDocument/CatalogAction/CatalogActionHeader/MasterCatalog/Extension[@name='SplitImportBatch']/Value/text()"
            type="string">inDoc</Parameter>
		<Parameter direction="in"
            eval="xpath" name="CatalogInputMap"
            source="/Message/Body/Document/BusinessDocument/CatalogAction/CatalogActionHeader/MasterCatalog/InputMap/RevisionID/BaseName/text()"
            type="string">inDoc</Parameter>
		<Parameter direction="in"
            eval="variable" name="InDocument"
            type="document">inDoc</Parameter>
		<Parameter
            direction="out" eval="variable" name="OutDocument"
            type="document">workDoc</Parameter>
		<Parameter
            direction="out" eval="variable" name="RecordsSuccess"
            type="long">recordsSuccess</Parameter>
		<!--Parameter direction="in" eval="constant" type="long" name="ErrorThreshold">100</Parameter-->
		<!--Parameter direction="in" eval="constant" type="long" name="RecordPerAsyncCall">10</Parameter-->
		<!--Parameter direction="in" name="AsynProcessIndicator" type="boolean" eval="constant">true</Parameter-->
		<!-- ProcessOption: MUTATION - M, DUPLICATE - D, RELATIONSHIP - R, CYCLIC - C -->
		<!--Parameter direction="in" name="ProcessOption" type="string" eval="constant">MD</Parameter-->
		<!-- If this param is not defined, activity will throw an exception to abort the workflow. By defining -->
		<!-- this param, you are taking responsibility to handle errors. -->
		<Parameter
            direction="out" eval="variable" name="CatalogsWithErrors"
        type="long">catalogsWithError</Parameter>
	</Activity>
	<Activity
            Name="ManageRecordCollection">
		<Action>ManageRecordCollection</Action>
		<Description
            lang="en">Create record bundles</Description>
		<Parameter
            direction="in" eval="constant" name="eventState"
            type="string">CREATEBUNDLE</Parameter>
		<Parameter
            direction="in" eval="variable" name="InDocument"
            type="document">workDoc</Parameter>
		<Parameter
            direction="in" eval="variable" name="InRecordList"
            type="recordlist">workRecordList</Parameter>
		<Parameter
            direction="in" eval="constant" name="RelationshipName"
            type="string">Contains</Parameter>
		<Parameter
            direction="in" eval="constant" name="BundlingOption"
            type="boolean">true</Parameter>
		<Parameter direction="in"
            eval="constant" name="SetRecordListReadOnly"
            type="boolean">false</Parameter>
		<!--Parameter direction="in" eval="constant" type="long" name="RecordPerAsyncCall">10</Parameter-->
		<!--Parameter direction="in" name="AsynProcessIndicator" type="boolean" eval="constant">true</Parameter-->
		<!--Parameter direction="in" name="IncludeDraftRecords" type="boolean" eval="constant">false</Parameter-->
		<Parameter
            direction="in" eval="constant" name="VersionOption"
            type="string">LATEST</Parameter>
		<Parameter
            direction="out" eval="variable" name="OutRecordList"
            type="recordlist">workRecordList</Parameter>
		<Parameter
            direction="out" eval="variable" name="OutRecordList2"
        type="recordlist">rejectRecordList</Parameter>
	</Activity>
	<!-- Added duplicate activity deliberately. This allows us to have no bundling for direct load. If we do need bundling,
	simply switch on bundling and uncomment relationshi. -->
	<Activity
            Name="ManageRecordCollectionDirectLoad">
		<Action>ManageRecordCollection</Action>
		<Description
            lang="en">Create simple record collection without bundling</Description>
		<Parameter
            direction="in" eval="constant" name="eventState"
            type="string">CREATEBUNDLE</Parameter>
		<Parameter
            direction="in" eval="variable" name="InDocument"
            type="document">workDoc</Parameter>
		<Parameter
            direction="in" eval="variable" name="InRecordList"
            type="recordlist">workRecordList</Parameter>
		<!--Parameter direction="in" name="RelationshipName" type="string" eval="constant">Contains</Parameter-->
		<Parameter
            direction="in" eval="constant" name="BundlingOption"
            type="boolean">false</Parameter>
		<!--Parameter direction="in" eval="constant" type="long" name="RecordPerAsyncCall">10</Parameter-->
		<!--Parameter direction="in" name="AsynProcessIndicator" type="boolean" eval="constant">true</Parameter-->
		<Parameter
            direction="in" eval="constant" name="SetRecordListReadOnly"
            type="boolean">false</Parameter>
		<!--Parameter direction="in" name="IncludeDraftRecords" type="boolean" eval="constant">false</Parameter-->
		<Parameter
            direction="in" eval="constant" name="VersionOption"
            type="string">LATEST</Parameter>
		<Parameter
            direction="out" eval="variable" name="OutRecordList"
            type="recordlist">workRecordList</Parameter>
		<Parameter
            direction="out" eval="variable" name="OutRecordList2"
        type="recordlist">rejectRecordList</Parameter>
	</Activity>
	<!-- Created sepearate activity to allow for different rulebase to used for direct load -->
	<Activity
            Name="EvaluateRulebaseDirectLoad">
		<Action>EvaluateRuleBase</Action>
		<Description
            lang="en">Apply validation rules for records which are not bundled</Description>
		<Parameter
            direction="in" eval="constant" name="eventState"
            type="string">EVALUATERULEBASE</Parameter>
		<!--        <Parameter direction="in" name="Rulebase" eval="constant" type="string">sampleRulebase</Parameter> -->
		<!--Parameter direction="in" name="Rulebase" eval="constant" type="string">D:\common\a\rulebase/catalogvalidation.xml</Parameter-->
		<!--Parameter direction="in" name="BundlePerAsyncCall" type="long" eval="constant">10</Parameter-->
		<!--Parameter direction="in" name="RecordPerAsyncCall" type="long" eval="constant">10</Parameter-->
		<!--Parameter direction="in" name="AsynProcessIndicator" type="boolean" eval="constant">true</Parameter-->
		<!--Parameter direction="in" name="RelationshipName" type="string" eval="constant">Contains</Parameter-->
		<Parameter
            direction="in" eval="variable" name="InDocument"
            type="document">inDoc</Parameter>
		<Parameter
            direction="in" eval="variable" name="InRecordList"
            type="recordlist">workRecordList</Parameter>
		<!-- Severity: Validations with severity < input Severity are considered Fatal errors.  The rest are considered Warnings. -->
		<Parameter
            direction="in" eval="constant" name="Severity"
            type="long">9</Parameter>
		<!--    RemoveRecord : NONE - Do NOT remove records with errors.  FATAL - Remove records with Fatal errors (see Severity)  -->
		<Parameter
            direction="in" eval="constant" name="RemoveRecord"
            type="string">FATAL</Parameter>
		<!-- SaveFlag indicates if any changes to attributes should be saved in the database. Values are: SAVE,NOSAVE -->
		<Parameter
            direction="in" eval="constant" name="SaveFlag"
            type="string">SAVE</Parameter>
		<!-- LogOption: A - AttributeLog, F - Log File -->
		<Parameter
            direction="in" eval="constant" name="LogOption"
            type="string">F</Parameter>
		<!-- Number of FATAL errors (see Severity) -->
		<Parameter
            direction="out" eval="variable" name="ValidationErrors"
            type="long">fatalErrors</Parameter>
		<!-- Number of Warnings (see Severity) -->
		<Parameter
            direction="out" eval="variable" name="ValidationErrors1"
            type="long">warningErrors</Parameter>
		<!-- OutRecordList - with Valid record bundles -->
		<Parameter
            direction="out" eval="variable" name="OutRecordList"
            type="recordlist">workRecordList</Parameter>
		<!-- OutRecordList2 - with Error record bundles -->
		<Parameter
            direction="out" eval="variable" name="OutRecordList2"
        type="recordlist">workRecordList1</Parameter>
	</Activity>
	<Activity
            Name="EvaluateRuleBase">
		<Action>EvaluateRuleBase</Action>
		<Description
            lang="en">Apply validation rules</Description>
		<Parameter
            direction="in" eval="constant" name="eventState"
            type="string">EVALUATERULEBASE</Parameter>
		<!--        <Parameter direction="in" name="Rulebase" eval="catalog" type="string" source="TransformRuleBase">inDoc</Parameter> -->
		<!--Parameter direction="in" name="Rulebase" eval="constant" type="string">D:\common\a\rulebase/catalogvalidation.xml</Parameter-->
		<!--Parameter direction="in" name="BundlePerAsyncCall" type="long" eval="constant">10</Parameter-->
		<!--Parameter direction="in" name="RecordPerAsyncCall" type="long" eval="constant">10</Parameter-->
		<!--Parameter direction="in" name="AsynProcessIndicator" type="boolean" eval="constant">true</Parameter-->
		<!--Parameter direction="in" name="RelationshipName" type="string" eval="constant">Contains</Parameter-->
		<Parameter
            direction="in" eval="variable" name="InDocument"
            type="document">inDoc</Parameter>
		<Parameter
            direction="in" eval="variable" name="InRecordList"
            type="recordlist">workRecordList</Parameter>
		<!-- Severity: Validations with severity < input Severity are considered Fatal errors.  The rest are considered Warnings. -->
		<Parameter
            direction="in" eval="constant" name="Severity"
            type="long">9</Parameter>
		<!--    RemoveRecord : NONE - Do NOT remove records with errors.  FATAL - Remove records with Fatal errors (see Severity)  -->
		<Parameter
            direction="in" eval="constant" name="RemoveRecord"
            type="string">FATAL</Parameter>
		<!-- SaveFlag indicates if any changes to attributes should be saved in the database. Values are: SAVE,NOSAVE -->
		<Parameter
            direction="in" eval="constant" name="SaveFlag"
            type="string">SAVE</Parameter>
		<!-- LogOption: A - AttributeLog, F - Log File -->
		<Parameter
            direction="in" eval="constant" name="LogOption"
            type="string">F</Parameter>
		<!-- Number of FATAL errors (see Severity) -->
		<Parameter
            direction="out" eval="variable" name="ValidationErrors"
            type="long">fatalErrors</Parameter>
		<!-- Number of Warnings (see Severity) -->
		<Parameter
            direction="out" eval="variable" name="ValidationErrors1"
            type="long">warningErrors</Parameter>
		<!-- OutRecordList - with Valid record bundles -->
		<Parameter
            direction="out" eval="variable" name="OutRecordList"
            type="recordlist">workRecordList</Parameter>
		<!-- OutRecordList2 - with Error record bundles -->
		<Parameter
            direction="out" eval="variable" name="OutRecordList2"
        type="recordlist">workRecordList1</Parameter>
	</Activity>
	<Activity
            Name="InternalApprovalMoveToFirst">
		<Action>StateTransition</Action>
		<Description
            lang="en">Set workflow to next step</Description>
		<Parameter
            direction="in" eval="constant" name="eventState"
            type="string">STATETRANSITION</Parameter>
		<Parameter
            direction="in" eval="variable" name="InDocument"
            type="document">workDoc</Parameter>
		<Parameter
            direction="in" eval="constant" name="ConversationAction"
            type="string">connect</Parameter>
		<Parameter
            direction="in" eval="constant" name="CheckTransition"
            type="string">false</Parameter>
		<Parameter direction="in"
            eval="constant" name="MoveTo"
            type="string">Step1</Parameter>
		<Parameter direction="in"
            eval="constant" name="Key1"
            type="string">ImportMasterCatalogInternalApproval</Parameter>
		<Parameter
            direction="in" eval="xpath" name="Key2"
            source="/Message/Body/Document/BusinessDocument/CatalogAction/CatalogActionHeader/ThisDocID/DocID/IDNumber/text()"
            type="string">workDoc</Parameter>
		<Parameter
            direction="out" eval="variable" name="OutDocument"
            type="document">workDoc</Parameter>
		<Parameter
            direction="out" eval="variable" name="ConversationState"
        type="string">InternalApprovalNextState</Parameter>
	</Activity>
	<Activity
            Name="ImpInternalApprovalWorkitem">
		<Action>CreateWorkItem</Action>
		<Description
            lang="en">Create a workitem for import approval</Description>
		<Execution>SYNCHR</Execution>
		<Parameter
            direction="in" eval="constant" name="eventState"
            type="string">IMPORTAPPROVALWORKITEM</Parameter>
		<Parameter
            direction="in" eval="variable" name="ReferenceStepID"
            type="long">pl2</Parameter>
		<Parameter direction="in"
            eval="rule" name="ParticipantID" source="Import Approval"
            type="long">workDoc</Parameter>
		<Parameter direction="in"
            eval="rule" name="ParticipantType" source="Import Approval"
            type="string">workDoc</Parameter>
		<Parameter
            direction="in" eval="constant" name="Form"
            type="string">standard/forms/fm26ca.xml</Parameter>
		<Parameter
            direction="in" eval="constant" name="MailPresentation" type="string">
  com.tibco.mdm.ui.workflow.engine.emailtemplates.EmailImportApprovalWorkItem</Parameter>
		<Parameter
            direction="in" eval="constant"
            name="ReassignMailPresentation"             type="string">
com.tibco.mdm.ui.workflow.engine.emailtemplates.EmailReassignWorkItem</Parameter>
		<Parameter
            direction="in" eval="constant"
            name="DelegationMailPresentation"             type="string">
com.tibco.mdm.ui.workflow.engine.emailtemplates.EmailWorkItemDelegationNotification</Parameter>
		<Parameter
            direction="in" eval="constant" name="FormPresentation"             type="string">
com.tibco.mdm.ui.workflow.engine.workitem.templates.CatalogImportApproval</Parameter>
		<Parameter
            direction="in" eval="constant" name="TaskType"
            type="string">CATALOGIMPORTRECORD</Parameter>
		<Parameter
            direction="in" eval="variable" name="InDocument"
            type="document">workDoc</Parameter>
		<Parameter
            direction="in" eval="constant" name="ExpiryType"
            type="string">RELATIVE</Parameter>
		<Parameter
            direction="in" eval="constant" name="ExpiryDate"
            type="string">1:0:0:0</Parameter>
		<Parameter
            direction="out" eval="variable" name="OutDocument"
            type="document">wiDoc</Parameter>
		<Parameter
            direction="out" eval="variable" name="WorkItemCreated"
            type="boolean">approvalFlag</Parameter>
		<Parameter
            direction="out" eval="variable" name="MergedDocument"
            type="boolean">workDoc</Parameter>
		<Parameter
            direction="out" eval="variable" name="StepID"
        type="long">pl1</Parameter>
	</Activity>
	<Activity
            Name="InternalApprovalMoveToNext">
		<Action>StateTransition</Action>
		<Description
            lang="en">Set workflow to next step</Description>
		<Parameter
            direction="in" eval="constant" name="eventState"
            type="string">STATETRANSITION</Parameter>
		<Parameter
            direction="in" eval="variable" name="InDocument"
            type="document">workDoc</Parameter>
		<Parameter
            direction="in" eval="constant" name="ConversationAction"
            type="string">connect</Parameter>
		<Parameter
            direction="in" eval="constant" name="CheckTransition"
            type="string">false</Parameter>
		<Parameter direction="in"
            eval="rule" name="MoveTo" source="Import Approval"
            type="string">workDoc</Parameter>
		<Parameter
            direction="in" eval="constant" name="MoveTo"
            type="string">Done</Parameter>
		<Parameter direction="in"
            eval="constant" name="Key1"
            type="string">ImportMasterCatalogInternalApproval</Parameter>
		<Parameter
            direction="in" eval="xpath" name="Key2"
            source="/Message/Body/Document/BusinessDocument/CatalogAction/CatalogActionHeader/ThisDocID/DocID/IDNumber/text()"
            type="string">workDoc</Parameter>
		<Parameter
            direction="out" eval="variable" name="OutDocument"
            type="document">workDoc</Parameter>
		<Parameter
            direction="out" eval="variable" name="ConversationState"
            type="string">InternalApprovalNextState</Parameter>
		<Parameter
            direction="out" eval="variable" name="CouldMove"
        type="string">approvalCouldMove</Parameter>
	</Activity>
	<Activity
            Name="UpdateRecordStateAsRejected">
		<Action>UpdateRecordState</Action>
		<Description
            lang="en">Set record status as rejected for all records, import is not approved</Description>
		<Parameter
            direction="in" eval="constant" name="eventState"
            type="string">UPDATERECORDSTATUS</Parameter>
		<Parameter
            direction="in" eval="constant" name="Status"
            type="string">REJECTED</Parameter>
		<Parameter
            direction="in" eval="variable" name="InDocument"
        type="document">inDoc</Parameter>
		<!--Parameter direction="in" name="RecordPerAsyncCall" type="long" eval="constant">10</Parameter-->
		<!--Parameter direction="in" name="AsynProcessIndicator" type="boolean" eval="constant">true</Parameter-->
	</Activity>
	<Activity
            Name="UpdateRecordStateAsRejected1">
		<Action>UpdateRecordState</Action>
		<Description
            lang="en">Set record status as rejected for records which failed validations</Description>
		<Parameter
            direction="in" eval="constant" name="eventState"
            type="string">UPDATERECORDSTATUS</Parameter>
		<Parameter
            direction="in" eval="constant" name="Status"
            type="string">REJECTED</Parameter>
		<Parameter
            direction="in" eval="variable" name="InDocument"
            type="document">inDoc</Parameter>
		<!--Parameter direction="in" name="RecordPerAsyncCall" type="long" eval="constant">10</Parameter-->
		<!--Parameter direction="in" name="AsynProcessIndicator" type="boolean" eval="constant">true</Parameter-->
		<!-- Failed record list is input -->
		<Parameter
            direction="in" eval="variable" name="InRecordList"
        type="recordlist">workRecordList1</Parameter>
	</Activity>
	<Activity
            Name="UpdateRecordStateAsRejected2">
		<Action>UpdateRecordState</Action>
		<Description
            lang="en">Set record status as rejected as these records failed in bundling</Description>
		<Parameter
            direction="in" eval="constant" name="eventState"
            type="string">UPDATERECORDSTATUS</Parameter>
		<Parameter
            direction="in" eval="constant" name="Status"
            type="string">REJECTED</Parameter>
		<Parameter
            direction="in" eval="variable" name="InDocument"
            type="document">inDoc</Parameter>
		<!-- Failed record list is input -->
		<Parameter
            direction="in" eval="variable" name="InRecordList"
        type="recordlist">rejectRecordList</Parameter>
		<!--Parameter direction="in" name="RecordPerAsyncCall" type="long" eval="constant">10</Parameter-->
		<!--Parameter direction="in" name="AsynProcessIndicator" type="boolean" eval="constant">true</Parameter-->
	</Activity>
	<Activity
            Name="UpdateRecordStateAsRejected3">
		<Action>UpdateRecordState</Action>
		<Description
            lang="en">Set record status as rejected for records which failed validations</Description>
		<Parameter
            direction="in" eval="constant" name="eventState"
            type="string">UPDATERECORDSTATUS</Parameter>
		<Parameter
            direction="in" eval="constant" name="Status"
            type="string">REJECTED</Parameter>
		<Parameter
            direction="in" eval="variable" name="InDocument"
        type="document">inDoc</Parameter>
		<!--Parameter direction="in" name="RecordPerAsyncCall" type="long" eval="constant">10</Parameter-->
		<!--Parameter direction="in" name="AsynProcessIndicator" type="boolean" eval="constant">true</Parameter-->
		<!-- No need to specify a record collection -->
		<!--Parameter direction="in" name="InRecordList" type="recordlist" eval="variable">workRecordList1</Parameter-->
	</Activity>
	<Activity
            Name="UpdateRecordStateAsRejected5">
		<Action>UpdateRecordState</Action>
		<Description
            lang="en">Set record status as rejected as these records failed in bundling</Description>
		<Parameter
            direction="in" eval="constant" name="eventState"
            type="string">UPDATERECORDSTATUS</Parameter>
		<Parameter
            direction="in" eval="constant" name="Status"
            type="string">REJECTED</Parameter>
		<Parameter
            direction="in" eval="variable" name="InDocument"
            type="document">inDoc</Parameter>
		<!-- Failed record list is input -->
		<Parameter
            direction="in" eval="variable" name="InRecordList"
        type="recordlist">rejectRecordList</Parameter>
		<!--Parameter direction="in" name="RecordPerAsyncCall" type="long" eval="constant">10</Parameter-->
		<!--Parameter direction="in" name="AsynProcessIndicator" type="boolean" eval="constant">true</Parameter-->
	</Activity>
	<Activity
            Name="UpdateRecordStateAsCancelled">
		<Action>UpdateRecordState</Action>
		<Description
            lang="en">Set record status as rejected and update logs</Description>
		<Parameter
            direction="in" eval="constant" name="eventState"
            type="string">UPDATERECORDSTATUS</Parameter>
		<Parameter
            direction="in" eval="constant" name="Status"
            type="string">REJECTED</Parameter>
		<Parameter
            direction="in" eval="variable" name="InDocument"
        type="document">inDoc</Parameter>
		<!--Parameter direction="in" name="RecordPerAsyncCall" type="long" eval="constant">10</Parameter-->
		<!--Parameter direction="in" name="AsynProcessIndicator" type="boolean" eval="constant">true</Parameter-->
	</Activity>
	<!-- Confirm with override, only those records which passed validations -->
	<Activity
            Name="UpdateRecordStateAsConfirmed">
		<Action>UpdateRecordState</Action>
		<Description
            lang="en">Set record status as confirmed</Description>
		<Parameter
            direction="in" eval="constant" name="OverrideConflict"
            type="boolean">true</Parameter>
		<Parameter direction="in"
            eval="constant" name="eventState"
            type="string">UPDATERECORDSTATUS</Parameter>
		<Parameter
            direction="in" eval="constant" name="Status"
            type="string">CONFIRMED</Parameter>
		<Parameter
            direction="in" eval="variable" name="InDocument"
            type="document">inDoc</Parameter>
		<Parameter
            direction="in" eval="variable" name="InRecordList"
        type="recordlist">workRecordList</Parameter>
		<!--Parameter direction="in" name="RecordPerAsyncCall" type="long" eval="constant">10</Parameter-->
		<!--Parameter direction="in" name="AsynProcessIndicator" type="boolean" eval="constant">true</Parameter-->
	</Activity>
	<Activity
            Name="SpawnWorkflow">
		<Action>SpawnWorkflow</Action>
		<Description
            lang="en">Spawn individual WorkFlow for each record bundle</Description>
		<Execution>ASYNCHR</Execution>
		<Parameter
            direction="in" eval="constant" name="eventState"
            type="string">SPAWNWORKFLOW</Parameter>
		<Parameter
            direction="in" eval="variable" name="InDocument"
            type="document">inDoc</Parameter>
		<Parameter
            direction="in" eval="variable" name="InRecordList"
            type="recordlist">workRecordList</Parameter>
		<Parameter
            direction="in" eval="constant" name="ProcessID"
            type="string">standard/workflow/wfin26catsourceimportv2</Parameter>
		<Parameter
            direction="in" eval="constant" name="DocumentTemplate"
            type="string">standard/template/tm26catimportv1.xml</Parameter>
		<Parameter
            direction="in" eval="constant" name="Form"
            type="string">standard/forms/fm26importtemplatev1.xml</Parameter>
		<Parameter
            direction="in" eval="constant" name="DefaultDomain"
            type="string">MartQuestNet</Parameter>
		<Parameter
            direction="in" eval="xpath" name="SenderCredential"
            source="/Message/Header/MessageHeader[@origin='Receiver']/Member/PartyID/DBID/text()"
            type="long">inDoc</Parameter>
		<Parameter direction="in"
            eval="xpath" name="ChannelCredential"
            source="/Message/Header/MessageHeader[@origin='Receiver']/Member/PartyID/DBID/text()"
            type="long">inDoc</Parameter>
		<Parameter direction="in"
            eval="xpath" name="TradingPartnerCredential"
            source="/Message/Header/MessageHeader[@origin='Receiver']/Member/PartyID/DBID/text()"
            type="long">inDoc</Parameter>
		<Parameter direction="in"
            eval="xpath" name="MasterCatalog"
            source="/Message/Body/Document/BusinessDocument/CatalogAction/CatalogActionHeader/MasterCatalog/RevisionID/DBID/text()"
        type="long">inDoc</Parameter>
		<!--Parameter direction="in" name="RelationshipName" type="string" eval="constant">Contains</Parameter-->
		<!--Parameter direction="in" name="RecordPerAsyncCall" type="long" eval="constant">10</Parameter-->
		<!--Parameter direction="in" name="AsynProcessIndicator" type="boolean" eval="constant">true</Parameter-->
	</Activity>
	<Activity
            Name="InternalApprovalResultEmail">
		<Action>Send</Action>
		<Description
            lang="en">Send internal approval result email</Description>
		<Execution>ASYNCHR</Execution>
		<Parameter
            direction="in" eval="constant" name="eventState"
            type="string">SENDAPPROVALEMAIL</Parameter>
		<Parameter
            direction="in" eval="rule" name="Protocol"
            source="Message or Workflow Completion"
            type="string">workDoc</Parameter>
		<Parameter
            direction="in" eval="rule" name="Address"
            source="Message or Workflow Completion"
            type="long">workDoc</Parameter>
		<Parameter direction="in"
            eval="variable" name="InDocument"
            type="document">workDoc</Parameter>
		<Parameter
            direction="in" eval="constant" name="Sender"
            type="string">support@tibco.com</Parameter>
		<Parameter
            direction="in" eval="constant" name="Form"
            type="string">standard/forms/fm26ca.xml</Parameter>
		<Parameter
            direction="in" eval="constant" name="Subject"
            type="string">Import Approval Status</Parameter>
		<Parameter
            direction="in" eval="constant" name="Presentation"             type="string">
com.tibco.mdm.ui.workflow.engine.emailtemplates.EmailImportApprovalStatus</Parameter>
	</Activity>
	<Activity
            Name="SourceSuccessEmail">
		<Action>Send</Action>
		<Description
            lang="en">Send Success email</Description>
		<Execution>ASYNCHR</Execution>
		<Parameter
            direction="in" eval="constant" name="eventState"
            type="string">SENDSUCCESSEMAIL</Parameter>
		<Parameter
            direction="in" eval="rule" name="Protocol"
            source="Message or Workflow Completion"
            type="string">inDoc</Parameter>
		<Parameter direction="in"
            eval="rule" name="Address"
            source="Message or Workflow Completion"
            type="string">inDoc</Parameter>
		<Parameter direction="in"
            eval="constant" name="Sender"
            type="string">support@tibco.com</Parameter>
		<Parameter
            direction="in" eval="constant" name="Presentation"
            type="string">com.tibco.mdm.ui.workflow.engine.emailtemplates.EmailSourceMessage</Parameter>
		<Parameter
            direction="in" eval="constant" name="Form"
            type="string">standard/forms/fm26ca.xml</Parameter>
		<Parameter
            direction="in" eval="variable" name="InDocument"
            type="document">inDoc</Parameter>
		<Parameter
            direction="in" eval="constant" name="OperationStatus"
            type="string">succeeded</Parameter>
		<Parameter
            direction="in" eval="constant" name="Message"
        type="string">The catalog upload/import operation succeeded.</Parameter>
	</Activity>
	<Activity
            Name="SourceErrorEmail">
		<Action>Send</Action>
		<Description
            lang="en">Send Error email</Description>
		<Execution>ASYNCHR</Execution>
		<Parameter
            direction="in" eval="constant" name="eventState"
            type="string">SENDERROREMAIL</Parameter>
		<Parameter
            direction="in" eval="rule" name="Protocol"
            source="Message or Workflow Completion"
            type="string">inDoc</Parameter>
		<Parameter direction="in"
            eval="rule" name="Address"
            source="Message or Workflow Completion"
            type="string">inDoc</Parameter>
		<Parameter direction="in"
            eval="constant" name="Sender"
            type="string">support@tibco.com</Parameter>
		<Parameter
            direction="in" eval="constant" name="Presentation"
            type="string">com.tibco.mdm.ui.workflow.engine.emailtemplates.EmailSourceMessage</Parameter>
		<Parameter
            direction="in" eval="constant" name="Form"
            type="string">standard/forms/fm26ca.xml</Parameter>
		<Parameter
            direction="in" eval="variable" name="InDocument"
            type="document">inDoc</Parameter>
		<Parameter
            direction="in" eval="constant" name="OperationStatus"
            type="string">failed</Parameter>
		<Parameter direction="in"
            eval="property" name="Message"
        type="string">error.Text</Parameter>
	</Activity>
	<Activity
            Name="SetStatusToSuccess">
		<Action>UpdateEvent</Action>
		<Description
            lang="en">Set the event status to Success/Done</Description>
		<Parameter
            direction="in" eval="constant" name="eventStatus"
            type="string">SUCCESS</Parameter>
		<Parameter
            direction="in" eval="constant" name="eventState"
        type="string">DONE</Parameter>
	</Activity>
	<Activity
            Name="SetStatusToError">
		<Action>UpdateEvent</Action>
		<Description
            lang="en">Set the event status to Error/Done</Description>
		<Parameter
            direction="in" eval="constant" name="eventStatus"
            type="string">ERROR</Parameter>
		<Parameter direction="in"
            eval="constant" name="eventState"
        type="string">DONE</Parameter>
	</Activity>
	<Activity
            Name="SetStatusToTimedout">
		<Action>UpdateEvent</Action>
		<Description
            lang="en">Set the event status to Timedout/Done</Description>
		<Parameter
            direction="in" eval="constant" name="eventStatus"
            type="string">TIMEOUT</Parameter>
		<Parameter
            direction="in" eval="constant" name="eventState"
        type="string">TIMEOUT</Parameter>
	</Activity>
	<Activity
            Name="SendTimeOutEmailForApprovalWorkItem">
		<Action>Send</Action>
		<Description>Send email - record approval work item has timed out</Description>
		<Execution>ASYNCHR</Execution>
		<Parameter
            direction="in" eval="constant" name="eventState"
            type="string">SENDTIMEOUTEMAIL</Parameter>
		<Parameter
            direction="in" eval="rule" name="Protocol"
            source="Message or Workflow Completion"
            type="string">workDoc</Parameter>
		<Parameter
            direction="in" eval="rule" name="Address"
            source="Message or Workflow Completion"
            type="string">workDoc</Parameter>
		<Parameter
            direction="in" eval="constant" name="Sender"
            type="string">support@tibco.com</Parameter>
		<Parameter
            direction="in" eval="constant" name="Form"
            type="string">standard/forms/fm26ca.xml</Parameter>
		<Parameter
            direction="in" eval="variable" name="InDocument"
            type="document">workDoc</Parameter>
		<Parameter
            direction="in" eval="constant" name="Presentation"
            type="string">com.tibco.mdm.ui.workflow.engine.emailtemplates.EmailProductEditTimeOut
</Parameter>
		<Parameter
            direction="in" eval="variable" name="Approver"
        type="string">ParticipantName</Parameter>
	</Activity>
	<Activity
            Name="RejectDueToWorkflowError">
		<Action>Send</Action>
		<Description
            lang="en">Error occured during workflow processing</Description>
		<Execution>ASYNCHR</Execution>
		<Parameter
            direction="in" eval="constant" name="eventState"
            type="string">REJECTDUETOWFERROR</Parameter>
		<Parameter
            direction="in" eval="rule" name="Protocol"
            source="Message or Workflow Completion"
            type="string">inDoc</Parameter>
		<Parameter direction="in"
            eval="rule" name="Address"
            source="Message or Workflow Completion"
            type="long">inDoc</Parameter>
		<Parameter direction="in"
            eval="constant" name="Sender"
            type="string">support@tibco.com</Parameter>
		<Parameter
            direction="in" eval="constant" name="Presentation"
            type="string">
com.tibco.mdm.ui.workflow.engine.emailtemplates.EmailUploadImportWorkflowError</Parameter>
		<Parameter
            direction="in" eval="constant" name="Form"
            type="string">standard/forms/fm26ca.xml</Parameter>
		<Parameter
            direction="in" eval="variable" name="InDocument"
        type="document">inDoc</Parameter>
	</Activity>
	<!-- Handle cancellation of event -->
	<Activity
            Name="SetStatusToCancel">
		<Action>UpdateEvent</Action>
		<Description
            lang="en">Set the event status to Cancelled/Done</Description>
		<Parameter
            direction="in" eval="constant" name="eventStatus"
            type="string">CANCELLED</Parameter>
		<Parameter
            direction="in" eval="constant" name="eventState"
        type="string">DONE</Parameter>
	</Activity>
	<!-- * * * T R A N S I T I O N S  * * * -->
	<!-- Same workflow is used for data source upload and import. -->
	<Transition
        FromActivity="AddMsgInfoToEvent"
            ToActivity="ImportCatalog">
		<Description
                lang="en">If type is Import only, skip directly to Import</Description>
		<Rule>
			<Parameter
                direction="in" eval="xpath" name="subdoctype"
                source="/Message/Body/Document/@subtype"
                type="string">inDoc</Parameter>
			<Parameter
                direction="out" name="result"
                type="boolean"/>
			<Condition
        format="bsh"><![CDATA[
            result = subdoctype.equalsIgnoreCase("CatSourceImport");
                </Condition>
		</Rule>
	</Transition>
	<!-- Data source upload needs to be done first -->
	<Transition
        FromActivity="AddMsgInfoToEvent"
        ToActivity="UploadDataSource"/>
	<Transition
        FromActivity="UploadDataSource"
            ToActivity="SourceErrorEmail">
		<Description
                lang="en">If process record return no error then create edit workitem</Description>
		<Rule>
			<Parameter
                direction="in" eval="variable" name="totalRowsAttempted"
                type="long">totalRowsAttempted</Parameter>
			<Parameter
                direction="in" eval="variable"
                name="totalRowsWithErrors"
                type="long">totalRowsWithErrors</Parameter>
			<Parameter
                direction="out" name="result"
                type="boolean"/>
			<Condition
        format="bsh"><![CDATA[
                result =  ((totalRowsAttempted != null && totalRowsAttempted >0) && (totalRowsWithErrors == totalRowsAttempted))  ;
            </Condition>
		</Rule>
	</Transition>
	<!-- Datasource Upload failed, end the workflow -->
	<Transition
        FromActivity="SourceErrorEmail"
        ToActivity="SetStatusToError"/>
	<!-- Upload was successful, inform the user and continue -->
	<Transition
        FromActivity="UploadDataSource"
            ToActivity="SourceSuccessEmail">
		<Description
                lang="en">If type is Upload only then Import Catalog.</Description>
		<Rule>
			<Parameter
                direction="in" eval="xpath" name="subdoctype"
                source="/Message/Body/Document/@subtype"
                type="string">inDoc</Parameter>
			<Parameter
                direction="out" name="result"
                type="boolean"/>
			<Condition
        format="bsh"><![CDATA[
            result = subdoctype.equalsIgnoreCase("CatSourceLoad");
                </Condition>
		</Rule>
	</Transition>
	<!-- End of data source upload workflow -->
	<Transition
        FromActivity="SourceSuccessEmail"
        ToActivity="SetStatusToSuccess"/>
	<!-- Import specific workflow starts now -->
	<Transition
        FromActivity="UploadDataSource"
        ToActivity="ImportCatalog"/>
	<!-- If there are no records imported, no need to continue. Not informing user by email?  -->
	<Transition
        FromActivity="ImportCatalog"
            ToActivity="SetStatusToError">
		<Description
                lang="en">If there are no records to process, end with error.</Description>
		<Rule>
			<Parameter
                direction="in" eval="variable" name="recordsSuccess"
                type="long">recordsSuccess</Parameter>
			<Parameter
                direction="in" eval="variable" name="catalogsWithError"
                type="long">catalogsWithError</Parameter>
			<Parameter
                direction="out" name="result"
                type="boolean"/>
			<Condition
        format="bsh"><![CDATA[
            result = (recordsSuccess == 0 && catalogsWithError > 0 ) ;
            </Condition>
		</Rule>
	</Transition>
	<Transition
        FromActivity="ImportCatalog"
            ToActivity="SetStatusToSuccess">
		<Description
                lang="en">If there are no records to process, end with error.</Description>
		<Rule>
			<Parameter
                direction="in" eval="variable" name="recordsSuccess"
                type="long">recordsSuccess</Parameter>
			<Parameter
                direction="in" eval="variable" name="catalogsWithError"
                type="long">catalogsWithError</Parameter>
			<Parameter
                direction="out" name="result"
                type="boolean"/>
			<Condition
        format="bsh"><![CDATA[
            result = (recordsSuccess == 0 && catalogsWithError == 0 ) ;
            </Condition>
		</Rule>
	</Transition>
	<!-- Some records were imported, create bundles out of these. If bundling option is not specified, this
    woul just create a record collection -->
	<!-- ************************* Handle direct load first ************************************ -->
	<Transition
        FromActivity="ImportCatalog"
            ToActivity="ManageRecordCollectionDirectLoad">
		<Description
                lang="en">Create dummy bundles.</Description>
		<Rule>
			<Parameter
                direction="in" eval="xpath" name="SplitImportBatch"
                source="/Message/Body/Document/BusinessDocument/CatalogAction/CatalogActionHeader/MasterCatalog/Extension[@name='SplitImportBatch']/Value/text()"
                type="string">inDoc</Parameter>
			<Parameter
                direction="out" name="result"
                type="boolean"/>
			<Condition
        format="bsh"><![CDATA[
            result = (SplitImportBatch.equalsIgnoreCase("Direct Load"));
                </Condition>
		</Rule>
	</Transition>
	<Transition
        FromActivity="ManageRecordCollectionDirectLoad"
            ToActivity="UpdateRecordStateAsRejected5">
		<Description
                lang="en">Check if there are any rejected records.</Description>
		<Rule>
			<Parameter
                direction="in" eval="variable" name="rc"
                type="recordlist">rejectRecordList</Parameter>
			<Parameter
                direction="out" name="result"
                type="boolean"/>
			<Condition
        format="bsh"><![CDATA[
            result = (rc != null);
                </Condition>
		</Rule>
	</Transition>
	<Transition
        FromActivity="UpdateRecordStateAsRejected5"
            ToActivity="EvaluateRulebaseDirectLoad">
		<Description
                lang="en">Check if there are any good records to validate.</Description>
		<Rule>
			<Parameter
                direction="in" eval="variable" name="rc"
                type="recordlist">workRecordList</Parameter>
			<Parameter
                direction="out" name="result"
                type="boolean"/>
			<Condition
        format="bsh"><![CDATA[
            result = (rc != null);
                </Condition>
		</Rule>
	</Transition>
	<!-- No good records, end the workflow -->
	<Transition
        FromActivity="UpdateRecordStateAsRejected5"
        ToActivity="SetStatusToError"/>
	<Transition
        FromActivity="ManageRecordCollectionDirectLoad"
            ToActivity="EvaluateRulebaseDirectLoad">
		<Description
                lang="en">Check if there are any good records to validate.</Description>
		<Rule>
			<Parameter
                direction="in" eval="variable" name="rc"
                type="recordlist">workRecordList</Parameter>
			<Parameter
                direction="out" name="result"
                type="boolean"/>
			<Condition
        format="bsh"><![CDATA[
            result = (rc != null);
                </Condition>
		</Rule>
	</Transition>
	<!-- No good records, end the workflow -->
	<Transition
        FromActivity="ManageRecordCollectionDirectLoad"
        ToActivity="SetStatusToError"/>
	<Transition
        FromActivity="EvaluateRulebaseDirectLoad"
            ToActivity="UpdateRecordStateAsRejected3">
		<Description
                lang="en">Transition if success list is null.</Description>
		<Rule>
			<Parameter
                direction="in" eval="variable" name="rc"
                type="recordlist">workRecordList</Parameter>
			<Parameter
                direction="out" name="result"
                type="boolean"/>
			<Condition
        format="bsh"><![CDATA[
            result = (rc == null);
                </Condition>
		</Rule>
	</Transition>
	<!-- At this point, there is atleast one record to approve -->
	<Transition
        FromActivity="EvaluateRulebaseDirectLoad"
        ToActivity="InternalApprovalMoveToFirst"/>
	<!-- ********** Direct load handling now joins the main workflow ************* -->
	<Transition
        FromActivity="ImportCatalog"
        ToActivity="ManageRecordCollection"/>
	<!-- Lets first eliminate the records which failed bundling. -->
	<!--Go to rejected 2 only if rejectRecordList is not null and it has atleast one record. -->
	<Transition
        FromActivity="ManageRecordCollection"
            ToActivity="UpdateRecordStateAsRejected2">
		<Description
                lang="en">Transition if null.</Description>
		<Rule>
			<Parameter
                direction="in" eval="variable" name="rc"
                type="recordlist">rejectRecordList</Parameter>
			<Parameter
                direction="out" name="result"
                type="boolean"/>
			<Condition
        format="bsh"><![CDATA[
            result = (rc != null);
                </Condition>
		</Rule>
	</Transition>
	<!-- Now check if there is atleast one bundle. Otherwise, end the workflow -->
	<Transition
        FromActivity="UpdateRecordStateAsRejected2"
            ToActivity="SetStatusToError">
		<Description
                lang="en">Transition if null.</Description>
		<Rule>
			<Parameter
                direction="in" eval="variable" name="rc"
                type="recordlist">workRecordList</Parameter>
			<Parameter
                direction="out" name="result"
                type="boolean"/>
			<Condition
        format="bsh"><![CDATA[
            result = (rc == null);
                </Condition>
		</Rule>
	</Transition>
	<!-- Not likely to happen that you have no records in reject list and none in success list -->
	<Transition
        FromActivity="ManageRecordCollection"
            ToActivity="SetStatusToError">
		<Description
                lang="en">Transition if there not even one bundle created.</Description>
		<Rule>
			<Parameter
                direction="in" eval="variable" name="rc"
                type="recordlist">workRecordList</Parameter>
			<Parameter
                direction="out" name="result"
                type="boolean"/>
			<Condition
        format="bsh"><![CDATA[
            result = (rc == null);
                </Condition>
		</Rule>
	</Transition>
	<!-- Continue after rejecting the records which failed validation as there is atleast one valid bundle -->
	<Transition
        FromActivity="UpdateRecordStateAsRejected2"
        ToActivity="EvaluateRuleBase"/>
	<!-- At this point we are sure that there is at least one bundle to be processed. Validate it -->
	<!-- Continue with those records which were bundled successfully -->
	<!-- No bundle to reject, go straight to validations-->
	<Transition
        FromActivity="ManageRecordCollection"
        ToActivity="EvaluateRuleBase"/>
	<!-- If no records passed validation, reject all and end the workflow. Not informing user?-->
	<Transition
        FromActivity="EvaluateRuleBase"
            ToActivity="UpdateRecordStateAsRejected3">
		<Description
                lang="en">Transition if success list is null.</Description>
		<Rule>
			<Parameter
                direction="in" eval="variable" name="rc"
                type="recordlist">workRecordList</Parameter>
			<Parameter
                direction="out" name="result"
                type="boolean"/>
			<Condition
        format="bsh"><![CDATA[
            result = (rc == null);
                </Condition>
		</Rule>
	</Transition>
	<!-- All records rejected, end the workflow -->
	<Transition
        FromActivity="UpdateRecordStateAsRejected3"
        ToActivity="SetStatusToError"/>
	<!-- At this point, there is atleast one record to approve -->
	<Transition
        FromActivity="EvaluateRuleBase"
        ToActivity="InternalApprovalMoveToFirst"/>
	<Transition
        FromActivity="InternalApprovalMoveToFirst"
        ToActivity="ImpInternalApprovalWorkitem"/>
	<Transition
        FromActivity="ImpInternalApprovalWorkitem"
            ToActivity="ImpInternalApprovalWorkitem">
		<Description
                lang="en">Test that all created Import Approval workitems have been completed or someone has rejected workitem.</Description>
		<Rule>
			<Parameter
                direction="in" eval="variable" name="wicreated"
                type="boolean">approvalFlag</Parameter>
			<Parameter
                direction="in" eval="variable" name="numberCreated"
                type="long">NumberCreated</Parameter>
			<Parameter
                direction="in" eval="variable" name="numberCompleted"
                type="long">NumberCompleted</Parameter>
			<Parameter
                direction="in" eval="variable" name="response"
                type="string">FormResult</Parameter>
			<!-- Parameter name="response" type="string" eval="xpath" source="/Message/Body/Document/BusinessDocument/CatalogAction/CatalogActionHeader/CatalogActionHeaderAck[last()]/AcknowledgmentCode/Code/Value/text()" direction="in">workDoc</Parameter -->
			<Parameter
                direction="out" name="result"
                type="boolean"/>
			<Condition
        format="bsh"><![CDATA[
            result = ((wicreated) &&
                      (numberCompleted < numberCreated) &&
                                  (!((response != null) && (response.equalsIgnoreCase("Reject")))));
            </Condition>
		</Rule>
	</Transition>
	<Transition
        FromActivity="ImpInternalApprovalWorkitem"
        ToActivity="InternalApprovalMoveToNext"/>
	<Transition
        FromActivity="InternalApprovalMoveToNext"
            ToActivity="ImpInternalApprovalWorkitem">
		<Description
                lang="en">If not done, loop</Description>
		<Rule>
			<Parameter
                direction="in" eval="variable" name="state"
                type="string">InternalApprovalNextState</Parameter>
			<Parameter
                direction="in" eval="variable" name="status"
                type="string">FormResult</Parameter>
			<!-- Parameter name="status" type="string" eval="xpath" source="/Message/Body/Document/BusinessDocument/CatalogAction/CatalogActionHeader/CatalogActionHeaderAck[last()]/AcknowledgmentCode/Code/Value/text()" direction="in">workDoc</Parameter -->
			<Parameter
                direction="out" name="result"
                type="boolean"/>
			<Condition
        format="bsh"><![CDATA[
                    result =  (state != null)  && (!state.equalsIgnoreCase("Done"))
                                  && (status != null) && status.equalsIgnoreCase("Accept")  ;
            </Condition>
		</Rule>
	</Transition>
	<!-- If not approved, reject the batch and continue -->
	<Transition
        FromActivity="InternalApprovalMoveToNext"
            ToActivity="UpdateRecordStateAsRejected">
		<Description
                lang="en">If accept, send catalog.</Description>
		<Rule>
			<Parameter
                direction="in" eval="variable" name="status"
                type="string">FormResult</Parameter>
			<!-- Parameter name="status" type="string" eval="xpath" source="/Message/Body/Document/BusinessDocument/CatalogAction/CatalogActionHeader/CatalogActionHeaderAck[last()]/AcknowledgmentCode/Code/Value/text()" direction="in">workDoc</Parameter -->
			<Parameter
                direction="out" name="result"
                type="boolean"/>
			<Condition
        format="bsh"><![CDATA[
                result =  (status != null) && status.equalsIgnoreCase("Reject")  ;
            </Condition>
		</Rule>
	</Transition>
	<!-- Inform user of approval/ rejection -->
	<Transition
        FromActivity="UpdateRecordStateAsRejected"
        ToActivity="InternalApprovalResultEmail"/>
	<!-- After approval, reject those records which failed the validation -->
	<Transition
        FromActivity="InternalApprovalMoveToNext"
            ToActivity="UpdateRecordStateAsRejected1">
		<Description
                lang="en">Transition if there are any records which failed validations.</Description>
		<Rule>
			<Parameter
                direction="in" eval="variable" name="rc"
                type="recordlist">workRecordList1</Parameter>
			<Parameter
                direction="out" name="result"
                type="boolean"/>
			<Condition
        format="bsh"><![CDATA[
            result = (rc != null);
                </Condition>
		</Rule>
	</Transition>
	<!-- If no workitem, then reject the failed bundles.-->
	<Transition
        FromActivity="ImpInternalApprovalWorkitem"
            ToActivity="UpdateRecordStateAsRejected1">
		<Description
                lang="en">Transition if there are any records which failed validations.</Description>
		<Rule>
			<Parameter
                direction="in" eval="variable" name="rc"
                type="recordlist">workRecordList1</Parameter>
			<Parameter
                direction="out" name="result"
                type="boolean"/>
			<Condition
        format="bsh"><![CDATA[
            result = (rc != null);
                </Condition>
		</Rule>
	</Transition>
	<Transition
        FromActivity="InternalApprovalMoveToNext"
        ToActivity="InternalApprovalResultEmail"/>
	<!-- Send email first, before spawn -->
	<Transition
        FromActivity="UpdateRecordStateAsRejected1"
        ToActivity="InternalApprovalResultEmail"/>
	<!-- End of workflow if direct load. -->
	<Transition
        FromActivity="InternalApprovalResultEmail"
            ToActivity="UpdateRecordStateAsConfirmed">
		<Description
                lang="en">If Direct load, end of workflow.</Description>
		<Rule>
			<Parameter
                direction="in" eval="xpath" name="SplitImportBatch"
                source="/Message/Body/Document/BusinessDocument/CatalogAction/CatalogActionHeader/MasterCatalog/Extension[@name='SplitImportBatch']/Value/text()"
                type="string">inDoc</Parameter>
			<Parameter
                direction="out" name="result"
                type="boolean"/>
			<Condition
        format="bsh"><![CDATA[
					result = (SplitImportBatch.equalsIgnoreCase("Direct Load"));
             </Condition>
		</Rule>
	</Transition>
	<!-- Spawn workflows if approval was obtained. -->
	<Transition
        FromActivity="InternalApprovalResultEmail"
            ToActivity="SpawnWorkflow">
		<Description
                lang="en">If accept, send catalog.</Description>
		<Rule>
			<Parameter
                direction="in" eval="variable" name="status"
                type="string">FormResult</Parameter>
			<!-- Parameter name="status" type="string" eval="xpath" source="/Message/Body/Document/BusinessDocument/CatalogAction/CatalogActionHeader/CatalogActionHeaderAck[last()]/AcknowledgmentCode/Code/Value/text()" direction="in">workDoc</Parameter -->
			<Parameter
                direction="out" name="result"
                type="boolean"/>
			<Condition
        format="bsh"><![CDATA[
                result =  (status == null) || status.equalsIgnoreCase("Accept")  ;
            </Condition>
		</Rule>
	</Transition>
	<!-- If user did not approve of batch, all products are rejected. Send email and end the event -->
	<Transition
        FromActivity="InternalApprovalResultEmail"
        ToActivity="SetStatusToSuccess"/>
	<Transition
        FromActivity="UpdateRecordStateAsConfirmed"
            ToActivity="SetStatusToTimedout">
		<Description
                lang="en">If there Update Product Status process is TimeOut, end with Timedout.</Description>
		<Rule>
			<Parameter
                direction="in" eval="variable" name="nextCommand"
                type="string">UpdateProductStatusNextCommand</Parameter>
			<Parameter
                direction="out" name="result"
                type="boolean"/>
			<Condition
        format="bsh"><![CDATA[
            result = (nextCommand !=null && (nextCommand.equalsIgnoreCase("TIMEOUT") ||  nextCommand.equalsIgnoreCase("ABORT"))) ;
            </Condition>
		</Rule>
	</Transition>
	<Transition
        FromActivity="UpdateRecordStateAsConfirmed"
        ToActivity="SetStatusToSuccess"/>
	<Transition
        FromActivity="SpawnWorkflow"
        ToActivity="SetStatusToSuccess"/>
	<!-- ERROR Handling Transitions -->
	<Transition
        FromActivity="Any" ToActivity="RejectDueToWorkflowError"
        type="error"/>
	<Transition
        FromActivity="RejectDueToWorkflowError"
        ToActivity="SetStatusToError"/>
	<!-- CANCEL transitions -->
	<Transition
        FromActivity="Any" ToActivity="UpdateRecordStateAsCancelled"
        type="cancel"/>
	<Transition
        FromActivity="UpdateRecordStateAsCancelled"
        ToActivity="SetStatusToCancel"/>
	<Transition FromActivity="Any"
            ToActivity="SetStatusToTimedout">
		<Description
                lang="en">If there Any Activity is TimeOut, end with Timedout.</Description>
		<Rule>
			<Parameter
                direction="in" eval="variable" name="nextCommand"
                type="string">AnyNextCommand</Parameter>
			<Parameter
                direction="out" name="result"
                type="boolean"/>
			<Condition format="bsh"><![CDATA[
            result = (nextCommand !=null && (nextCommand.equalsIgnoreCase("TIMEOUT") ||  nextCommand.equalsIgnoreCase("ABORT"))) ;
            </Condition>
		</Rule>
	</Transition>
</Workflow>
************** Executing START activity : AddMsgInfoToEvent ***************
Activity Input parameters
-------------------------
WorkflowState: 21 unique keys
  eventDescriptor:CatSourceLoad
  Action:UpdateEvent
  ProcessStep:1
  ProcessInstanceID:67072
  LOCALSTATEVARS:ProcessName***EVENTID***ProcessStep***isSubFlow***ProcessInstanceID***
  OrgID:35317
  dbDirectLoadDump:N
  ACTIVITYNAME:AddMsgInfoToEvent
  OrgType:SUPPLIER
  inDoc:Work/2008/May/14/14/mlXML_0A61616B_8AE1E1EB19E5A2FF0119E6BC6C07012F.xml
  ProcessName:wfin26catsourcev4
  Suspend:false
  EVENTID:85072
  ProcessLogID:67073
  eventState:START
  deploymentMode:Production
  RepeatLastActivity:false
  isSubFlow:false
  Queued:false
  OrgName:testOrg
  eventType:CAT
Activity Result
---------------
WorkflowState: 21 unique keys
  eventDescriptor:CatSourceLoad
  Action:UpdateEvent
  ProcessStep:1
  ProcessInstanceID:67072
  LOCALSTATEVARS:ProcessName***EVENTID***ProcessStep***isSubFlow***ProcessInstanceID***
  OrgID:35317
  dbDirectLoadDump:N
  ACTIVITYNAME:AddMsgInfoToEvent
  OrgType:SUPPLIER
  inDoc:Work/2008/May/14/14/mlXML_0A61616B_8AE1E1EB19E5A2FF0119E6BC6C07012F.xml
  ProcessName:wfin26catsourcev4
  Suspend:false
  EVENTID:85072
  ProcessLogID:67073
  eventState:START
  deploymentMode:Production
  RepeatLastActivity:false
  isSubFlow:false
  Queued:false
  OrgName:testOrg
  eventType:CAT
*************** Time taken for activity execution : 15ms
Additional Details
------------------
	ConversionID = 0
	ProcessLogID = 67073
	ProcessInstID = 67072
	Step = 1
	Action = UpdateEvent
	ActionName = Initialize event info
	EventId = 85072
	EventState = START
	Result = null
	Status = SUCCESS
Activity Flags: suspend = false, repeat = false, processSuspend = false
======================================================================================================
Looking for Transition FromActivity = AddMsgInfoToEvent
Transition condition
--------------------
            result = subdoctype.equalsIgnoreCase("CatSourceImport");
Input parameters of transition
------------------------------
	subdoctype = CatSourceLoad
Transtion condition evaluted to false
Transition selected from AddMsgInfoToEvent to UploadDataSource
******* Time taken for transition evaluation : 0ms
*************** Executing activity : UploadDataSource ***************
Activity Input parameters
-------------------------
WorkflowState: 25 unique keys
  eventDescriptor:CatSourceLoad
  Action:UploadDataSource
  LOCALSTATEVARS:deploymentMode***eventType***eventDescriptor***dbDirectLoadDump***eventState***ProcessStep***ACTIVITYNAME***Action***ProcessLogID***RepeatLastActivity***StepID***
  OrgID:35317
  dbDirectLoadDump:N
  OrgType:SUPPLIER
  StepID:67073
  EVENTID:85072
  deploymentMode:Production
  eventState:UPLOAD
  DataSource:TEST_DATASOURCE
  ProcessStep:2
  ProcessInstanceID:67072
  inDoc:Work/2008/May/14/14/mlXML_0A61616B_8AE1E1EB19E5A2FF0119E6BC6C07012F.xml
  ACTIVITYNAME:UploadDataSource
  Suspend:false
  ProcessName:wfin26catsourcev4
  InDocument:Work/2008/May/14/14/mlXML_0A61616B_8AE1E1EB19E5A2FF0119E6BC6C07012F.xml
  RepeatLastActivity:false
  ProcessLogID:67074
  isSubFlow:false
  MaxNumberOfErrors:50
  Queued:false
  OrgName:testOrg
  eventType:CAT
Activity Result
---------------
WorkflowState: 28 unique keys
  eventDescriptor:CatSourceLoad
  Action:UploadDataSource
  TotalRecordsWithErrors:0
  LOCALSTATEVARS:deploymentMode***eventType***eventDescriptor***dbDirectLoadDump***eventState***ProcessStep***ACTIVITYNAME***Action***ProcessLogID***RepeatLastActivity***StepID***
  OrgID:35317
  dbDirectLoadDump:N
  OrgType:SUPPLIER
  StepID:67073
  EVENTID:85072
  deploymentMode:Production
  eventState:UPLOAD
  TotalRecordsAttempted:1
  DataSource:TEST_DATASOURCE
  DataSourcesWithErrors:0
  ProcessStep:2
  ProcessInstanceID:67072
  inDoc:Work/2008/May/14/14/mlXML_0A61616B_8AE1E1EB19E5A2FF0119E6BC6C07012F.xml
  ACTIVITYNAME:UploadDataSource
  Suspend:false
  ProcessName:wfin26catsourcev4
  InDocument:Work/2008/May/14/14/mlXML_0A61616B_8AE1E1EB19E5A2FF0119E6BC6C07012F.xml
  RepeatLastActivity:false
  ProcessLogID:67074
  isSubFlow:false
  MaxNumberOfErrors:50
  Queued:false
  OrgName:testOrg
  eventType:CAT
*************** Time taken for activity execution : 13091ms
Additional Details
------------------
	ConversionID = 0
	ProcessLogID = 67074
	ProcessInstID = 67072
	Step = 2
	Action = UploadDataSource
	ActionName = Upload data source summary
	EventId = 85072
	EventState = UPLOAD
	Result = null
	Status = SUCCESS
Activity Flags: suspend = false, repeat = false, processSuspend = false
======================================================================================================
Looking for Transition FromActivity = UploadDataSource
Transition condition
--------------------
                result =  ((totalRowsAttempted != null && totalRowsAttempted >0) && (totalRowsWithErrors == totalRowsAttempted))  ;
Input parameters of transition
------------------------------
	totalRowsAttempted = 1
	totalRowsWithErrors = 0
Transtion condition evaluted to false
Transition condition
--------------------
            result = subdoctype.equalsIgnoreCase("CatSourceLoad");
Input parameters of transition
------------------------------
	subdoctype = CatSourceLoad
Transtion condition evaluted to true
Transition selected from UploadDataSource to SourceSuccessEmail
******* Time taken for transition evaluation : 0ms
*************** Executing activity : SourceSuccessEmail ***************
Activity Input parameters
-------------------------
WorkflowState: 35 unique keys
  eventDescriptor:CatSourceLoad
  totalRowsWithErrors:0
  Action:Send
  TotalRecordsWithErrors:0
  LOCALSTATEVARS:DataSource***InDocument***MaxNumberOfErrors***eventState***ProcessStep***ACTIVITYNAME***Action***ProcessLogID***DataSourcesWithErrors***TotalRecordsAttempted***TotalRecordsWithErrors***RepeatLastActivity***StepID***totalRowsAttempted***totalRowsWithErrors***
  OrgID:35317
  dbDirectLoadDump:N
  Message:The catalog upload/import operation succeeded.
  OrgType:SUPPLIER
  StepID:67074
  EVENTID:85072
  eventState:SENDSUCCESSEMAIL
  deploymentMode:Production
  Form:standard/forms/fm26ca.xml   Presentation:com.tibco.mdm.ui.workflow.engine.emailtemplates.EmailSourceMessage
  TotalRecordsAttempted:1
  DataSource:TEST_DATASOURCE
  DataSourcesWithErrors:0
  ProcessStep:3
  ProcessInstanceID:67072
  inDoc:Work/2008/May/14/14/mlXML_0A61616B_8AE1E1EB19E5A2FF0119E6BC6C07012F.xml
  ACTIVITYNAME:SourceSuccessEmail
  OperationStatus:succeeded
  Suspend:false
  ProcessName:wfin26catsourcev4
  InDocument:Work/2008/May/14/14/mlXML_0A61616B_8AE1E1EB19E5A2FF0119E6BC6C07012F.xml
  RepeatLastActivity:false
  ProcessLogID:67076
  isSubFlow:false
  MaxNumberOfErrors:50
  Queued:false
  Sender:support@tibco.com
  OrgName:testOrg
  eventType:CAT
  totalRowsAttempted:1
Activity Result
---------------
WorkflowState: 35 unique keys
  eventDescriptor:CatSourceLoad
  totalRowsWithErrors:0
  Action:Send
  TotalRecordsWithErrors:0
  LOCALSTATEVARS:DataSource***InDocument***MaxNumberOfErrors***eventState***ProcessStep***ACTIVITYNAME***Action***ProcessLogID***DataSourcesWithErrors***TotalRecordsAttempted***TotalRecordsWithErrors***RepeatLastActivity***StepID***totalRowsAttempted***totalRowsWithErrors***
  OrgID:35317
  dbDirectLoadDump:N
  Message:The catalog upload/import operation succeeded.
  OrgType:SUPPLIER
  StepID:67074
  EVENTID:85072
  eventState:SENDSUCCESSEMAIL
  deploymentMode:Production
  Form:standard/forms/fm26ca.xml   Presentation:com.tibco.mdm.ui.workflow.engine.emailtemplates.EmailSourceMessage
  TotalRecordsAttempted:1
  DataSource:TEST_DATASOURCE
  DataSourcesWithErrors:0
  ProcessStep:3
  ProcessInstanceID:67072
  inDoc:Work/2008/May/14/14/mlXML_0A61616B_8AE1E1EB19E5A2FF0119E6BC6C07012F.xml
  ACTIVITYNAME:SourceSuccessEmail
  OperationStatus:succeeded
  Suspend:false
  ProcessName:wfin26catsourcev4
  InDocument:Work/2008/May/14/14/mlXML_0A61616B_8AE1E1EB19E5A2FF0119E6BC6C07012F.xml
  RepeatLastActivity:false
  ProcessLogID:67076
  isSubFlow:false
  MaxNumberOfErrors:50
  Queued:false
  Sender:support@tibco.com
  OrgName:testOrg
  eventType:CAT
  totalRowsAttempted:1
*************** Time taken for activity execution : 0ms
Additional Details
------------------
	ConversionID = 0
	ProcessLogID = 67076
	ProcessInstID = 67072
	Step = 3
	Action = Send
	ActionName = Send Success email
	EventId = 85072
	EventState = SENDSUCCESSEMAIL
	Result = null
	Status = SUCCESS
Activity Flags: suspend = false, repeat = false, processSuspend = false
======================================================================================================
Looking for Transition FromActivity = SourceSuccessEmail
Transition selected from SourceSuccessEmail to SetStatusToSuccess
******* Time taken for transition evaluation : 0ms
*************** Executing activity : SetStatusToSuccess ***************
Activity Input parameters
-------------------------
WorkflowState: 33 unique keys
  totalRowsWithErrors:0
  Action:UpdateEvent
  TotalRecordsWithErrors:0
  LOCALSTATEVARS:Form***Sender***Message***Presentation***OperationStatus***InDocument***eventState***ProcessStep***ACTIVITYNAME***Action***ProcessLogID***RepeatLastActivity***StepID***
  OrgID:35317
  dbDirectLoadDump:N
  Message:The catalog upload/import operation succeeded.
  OrgType:SUPPLIER
  StepID:67076
  eventStatus:SUCCESS
  EVENTID:85072
  eventState:DONE
  Form:standard/forms/fm26ca.xml   Presentation:com.tibco.mdm.ui.workflow.engine.emailtemplates.EmailSourceMessage
  TotalRecordsAttempted:1
  DataSource:TEST_DATASOURCE
  DataSourcesWithErrors:0
  ProcessStep:4
  ProcessInstanceID:67072
  inDoc:Work/2008/May/14/14/mlXML_0A61616B_8AE1E1EB19E5A2FF0119E6BC6C07012F.xml
  ACTIVITYNAME:SetStatusToSuccess
  OperationStatus:succeeded
  Suspend:false
  ProcessName:wfin26catsourcev4
  InDocument:Work/2008/May/14/14/mlXML_0A61616B_8AE1E1EB19E5A2FF0119E6BC6C07012F.xml
  RepeatLastActivity:false
  ProcessLogID:67077
  isSubFlow:false
  MaxNumberOfErrors:50
  Queued:false
  Sender:support@tibco.com
  OrgName:testOrg
  totalRowsAttempted:1
Activity Result
---------------
WorkflowState: 33 unique keys
  totalRowsWithErrors:0
  Action:UpdateEvent
  TotalRecordsWithErrors:0
  LOCALSTATEVARS:Form***Sender***Message***Presentation***OperationStatus***InDocument***eventState***ProcessStep***ACTIVITYNAME***Action***ProcessLogID***RepeatLastActivity***StepID***
  OrgID:35317
  dbDirectLoadDump:N
  Message:The catalog upload/import operation succeeded.
  OrgType:SUPPLIER
  StepID:67076
  eventStatus:SUCCESS
  EVENTID:85072
  eventState:DONE
  Form:standard/forms/fm26ca.xml   Presentation:com.tibco.mdm.ui.workflow.engine.emailtemplates.EmailSourceMessage
  TotalRecordsAttempted:1
  DataSource:TEST_DATASOURCE
  DataSourcesWithErrors:0
  ProcessStep:4
  ProcessInstanceID:67072
  inDoc:Work/2008/May/14/14/mlXML_0A61616B_8AE1E1EB19E5A2FF0119E6BC6C07012F.xml
  ACTIVITYNAME:SetStatusToSuccess
  OperationStatus:succeeded
  Suspend:false
  ProcessName:wfin26catsourcev4
  InDocument:Work/2008/May/14/14/mlXML_0A61616B_8AE1E1EB19E5A2FF0119E6BC6C07012F.xml
  RepeatLastActivity:false
  ProcessLogID:67077
  isSubFlow:false
  MaxNumberOfErrors:50
  Queued:false
  Sender:support@tibco.com
  OrgName:testOrg
  totalRowsAttempted:1
*************** Time taken for activity execution : 16ms
Additional Details
------------------
	ConversionID = 0
	ProcessLogID = 67077
	ProcessInstID = 67072
	Step = 4
	Action = UpdateEvent
	ActionName = Set the event status to Success/Done
	EventId = 85072
	EventState = DONE
	Result = null
	Status = SUCCESS
Activity Flags: suspend = false, repeat = false, processSuspend = false
======================================================================================================
Looking for Transition FromActivity = SetStatusToSuccess
Transition condition
--------------------
            result = (nextCommand !=null && (nextCommand.equalsIgnoreCase("TIMEOUT") ||  nextCommand.equalsIgnoreCase("ABORT"))) ;
Input parameters of transition
------------------------------
	nextCommand = null
Transtion condition evaluted to false
******* Time taken for transition evaluation : 15ms
*************** Process instance ended at activity SetStatusToSuccess