Oracle Tracking Participant (WF 4) Fails w/ key error

Oracle Tracking Participant (WF 4) Fails w/ key error

Postby kmoren » Wed 11 Jan 2012 23:13

We altered our IIS hosting approach for the time being to accomodate the fact that the DevArt tracking participant isn't able to be config enabled (unlike the persistence instance store). To do this, each xamlx workflow service we created is file-less dynamic activated in our config file, , which calls a factory that is derived from the base workflow service host factory. This custom factory essentially adds the DevArt persistence and tracking components.

host.Description.Behaviors.Add(new OracleInstanceStoreBehavior
{
ConnectionString = "omitted;",
InstanceEncodingOption = InstanceEncodingOption.GZip,
InstanceCompletionAction = InstanceCompletionAction.DeleteAll,
InstanceLockedExceptionAction = InstanceLockedExceptionAction.BasicRetry,
HostLockRenewalPeriod = new TimeSpan(00, 00, 30),
RunnableInstancesDetectionPeriod = new TimeSpan(00, 00, 05)
});

OracleTrackingParticipant oracleTracking = new OracleTrackingParticipant("omitted;");
System.Activities.Tracking.TrackingProfile profile = new System.Activities.Tracking.TrackingProfile();
profile.Name = "nmdTrackingAll";
oracleTracking.TrackingProfile = profile;
host.WorkflowExtensions.Add(oracleTracking);

The instance store works this way but the tracking participant does not. When we run a workflow service from the WCF test client, the WF trace log indicates the following DevArt tracking participant error.

0: WorkflowInstance "WorkSpec V1 State Machine" is Started
1: Activity [null] "null" scheduled child activity [1] "WorkSpec V1 State Machine"
2: Activity [1] "WorkSpec V1 State Machine" is Executing
{
Variables
varWorkSpecSaidHandle: System.ServiceModel.Activities.CorrelationHandle
varWorkSpecSaid:
varWorkFlowInstanceId: 00000000-0000-0000-0000-000000000000
varWorkflowIsComplete: False
}
3: Activity [1] "WorkSpec V1 State Machine" scheduled child activity [3] "CancellationScope"
4: Activity [3] "CancellationScope" is Executing
5: Activity [3] "CancellationScope" scheduled child activity [5] "State Machine"
6: Activity [5] "State Machine" is Executing
7: Activity [5] "State Machine" scheduled child activity [53] "Initialize Instance (w/ endpoint)"
8: Activity [53] "Initialize Instance (w/ endpoint)" is Executing
9: Activity [53] "Initialize Instance (w/ endpoint)" scheduled child activity [61] "Initializer"
10: Activity [61] "Initializer" is Executing
{
Arguments
CorrelatesWith:
Parameter0: System.ServiceModel.Activities.CorrelationHandle
}
11: Activity [61] "Initializer" scheduled child activity [61.1] "Sequence"
12: Activity [61.1] "Sequence" is Executing
{
Variables
RequestMessage:
ReceiveNoPersistHandle: System.Activities.NoPersistHandle
}
13: Activity [61.1] "Sequence" scheduled child activity [61.6] "InternalReceiveMessage"
14: Activity [61.6] "InternalReceiveMessage" is Executing
{
Arguments
CorrelatesWith:
noPersistHandle: System.Activities.NoPersistHandle
Parameter0: System.ServiceModel.Activities.CorrelationHandle
}
15: WorkflowInstance "WorkSpec V1 State Machine" is Idle
16: Bookmark "Init|IInit" resumed with payload owner [61.6] "InternalReceiveMessage"
19: WorkflowInstance Aborted [WorkSpec V1 State Machine] Reason "An error occurred while calling tracking participants causing the instance to be aborted. See the inner exception for more details. InnerException Message: The given key was not present in the dictionary."

Is this a known issue and does DevArt have any guidance on configuring this participant in the event the above code base configuration of it is incorrect?
kmoren
 
Posts: 11
Joined: Sat 07 Jan 2012 20:07

Postby Shalex » Fri 13 Jan 2012 17:53

We will investigate the issue and post here about the results.
Shalex
Devart Team
 
Posts: 7530
Joined: Thu 14 Aug 2008 12:44

Postby kmoren » Fri 13 Jan 2012 21:37

Thanks. Regarding the tracking participant, we are investigating as well but it appears that another tracking participant supplied by Microsoft, workflowServiceTrace, may have been producing the above errors. We will follow-up.

However, it would be great to get more information on your tracking participant as tracking is vital. Also, does your tracking participant allow the profile(s) to be specified in the config file or must they be specified in code?
kmoren
 
Posts: 11
Joined: Sat 07 Jan 2012 20:07

Postby kmoren » Mon 16 Jan 2012 21:28

By trial and error and a little deductive reasoning, we determined that the tracking participant by DevArt doesn't support configuration based profiles. We suspected this because it doesn't support config based behavior extensions and behaviors for tracking, unlike it's instance store.

As a result, we turned to creating profiles imperatively in code and this worked, mostly. After this, we also discovered some documentation by DevArt on creating a tracking participant for a workflow application @ http://www.devart.com/dotconnect/oracle ... cking.html

What we have discovered is that the DevArt tracking participant works but not apparently for all tracking record types. We can get it to work for all tracking record types except custom tracking and bookmark resumption. Custom tracking is a key one for us since we need this to add additional dynamic metadata to our tracking for reporting purposes. Can DevArt please verify that custom tracking records are supported and tested and if so, help us to resolve the reason why the profile definition below fails to create custom tracking records with the error of

ORA-01403: no data found
ORA-06512: at "NMDR_WF.WF_TRACKING", line 17
ORA-06512: at "NMDR_WF.WF_TRACKING", line 331

ORA-06512: at line 2 at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at System.ServiceModel.Activities.Dispatcher.WorkflowServiceInstance.OnEndFlushTrackingRecords(IAsyncResult result)
at System.Activities.Runtime.WorkItem.OnTrackingComplete(IAsyncResult result)
Devart.Data.Oracle.OracleException (0x80004005): ORA-01403: no data found
ORA-06512: at "NMDR_WF.WF_TRACKING", line 17
ORA-06512: at "NMDR_WF.WF_TRACKING", line 331
ORA-06512: at line 2


Code: Select all
TrackingProfile codeProfile = new TrackingProfile()
            {
                Name = "nmdTrackingAllViaCode",
                ImplementationVisibility = System.Activities.Tracking.ImplementationVisibility.All,
                ActivityDefinitionId = "*"
            };
            // TODO: use config value to determine profile queries
            codeProfile.Queries.Add(new WorkflowInstanceQuery { States = { "*" } });
            codeProfile.Queries.Add(new ActivityStateQuery { States = { "*" } });
            codeProfile.Queries.Add(new ActivityScheduledQuery());
            codeProfile.Queries.Add(new BookmarkResumptionQuery() { Name = "*" });
            codeProfile.Queries.Add(new CancelRequestedQuery() { ActivityName = "*", ChildActivityName = "*" });
            codeProfile.Queries.Add(new CustomTrackingQuery() { ActivityName = "*", Name = "*" });
            codeProfile.Queries.Add(new FaultPropagationQuery() { FaultSourceActivityName = "*", FaultHandlerActivityName = "*" });
kmoren
 
Posts: 11
Joined: Sat 07 Jan 2012 20:07

Postby Shalex » Wed 18 Jan 2012 16:46

kmoren wrote:we determined that the tracking participant by DevArt doesn't support configuration based profiles.

We are working on the issue. We will post here when it is implemented.

kmoren wrote:InnerException Message: The given key was not present in the dictionary.

Please send us a small test project to reproduce the issue in our environment.

kmoren wrote:Can DevArt please verify that custom tracking records are supported and tested and if so, help us to resolve the reason why the profile definition below fails to create custom tracking records with the error of
ORA-01403: no data found

Please send us a small test project to reproduce the issue in our environment.

Thank you for your assistance.
Shalex
Devart Team
 
Posts: 7530
Joined: Thu 14 Aug 2008 12:44

Postby kmoren » Wed 18 Jan 2012 21:21

Based on the Oracle error provided above, we put a trace on the bind variables coming in and discovered that when custom tracking records are enabled (codeProfile.Queries.Add(new CustomTrackingQuery() { ActivityName = "*", Name = "*" });) the record type name being passed in from the DevArt tracking participant is ReceiveMessageRecord instead of CustomTrackingRecord. As a result, calls to insert_custom_record funciton have the incorrect p_record_type_name which fails on the call within the function to p_record_id := insert_tracking_record(p_record_number, p_record_type_name, p_instance_id, p_trace_level,
p_event_time, p_annotation_key, p_annotation). Insert_tracking_record functions first statement is a select into of ( select seq_wf_tracking_record.nextval, type_id into p_record_id, p_record_type
from wf_record_type
where type_name = p_record_type_name;) which naturally fails because the wf_record_type reference table doesn't have a value of ReceiveMessageRecord
kmoren
 
Posts: 11
Joined: Sat 07 Jan 2012 20:07

Postby Shalex » Thu 19 Jan 2012 11:56

Please run this script after executing %ProgramFiles%\Devart\dotConnect\Oracle\WF Services\OracleTrackingSchema.sql in your environment and notify us about the results (does it fix the issue?):
Code: Select all
insert into wf_record_type(type_id, type_name) values (12, 'StateMachineStateRecord');
insert into wf_record_type(type_id, type_name) values (13, 'InteropTrackingRecord');
insert into wf_record_type(type_id, type_name) values (14, 'ReceiveMessageRecord');
insert into wf_record_type(type_id, type_name) values (15, 'SendMessageRecord');
Shalex
Devart Team
 
Posts: 7530
Joined: Thu 14 Aug 2008 12:44

Postby kmoren » Thu 19 Jan 2012 21:07

We implemented the suggested fix which fixed the custom tracking records issue but not the bookmark resumption issue. Bookmark resumption tracking records error out differently with this exception found in the WCF trace log (emitted by workflow service host)...

"An error occurred while calling tracking participants causing the
instance to be aborted. See the inner exception for more details.

System.NullReferenceException: Object reference not set to an instance of an
object.". at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at
System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl.EndFlushT
rackingRecords(IAsyncResult result)
at
System.ServiceModel.Activities.Dispatcher.WorkflowServiceInstance.OnEndFlush
TrackingRecords(IAsyncResult result)
at System.Activities.Runtime.WorkItem.OnTrackingComplete(IAsyncResult
result)
--- End of inner exception stack trace ---
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at
System.ServiceModel.Activities.Dispatcher.ControlOperationInvoker.InvokeEnd(
Object instance, Object[]& outputs, IAsyncResult result)
at
System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeEnd(MessageRpc
& rpc)
at
System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage7(Mess
ageRpc& rpc)
at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean
isOperationContextSet)Syste
m.NullReferenceException, mscorlib, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089
Object reference not
set to an instance of an object.
at
System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at
System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl.EndFlushT
rackingRecords(IAsyncResult result)
at
System.ServiceModel.Activities.Dispatcher.WorkflowServiceInstance.OnEndFlush
TrackingRecords(IAsyncResult result)
at System.Activities.Runtime.WorkItem.OnTrackingComplete(IAsyncResult
result)
System.NullReferenceException: Object
reference not set to an instance of an object.
at System.Runtime.AsyncResult.End[TAsyncResult](IAsyncResult result)
at
System.Activities.Hosting.WorkflowInstance.WorkflowInstanceControl.EndFlushT
rackingRecords(IAsyncResult result)
at
System.ServiceModel.Activities.Dispatcher.WorkflowServiceInstance.OnEndFlush
TrackingRecords(IAsyncResult result)
at System.Activities.Runtime.WorkItem.OnTrackingComplete(IAsyncResult
result)
kmoren
 
Posts: 11
Joined: Sat 07 Jan 2012 20:07

Postby Shalex » Fri 20 Jan 2012 13:33

The bug with NRE when using bookmark resumption tracking records in Workflow Tracking is fixed. Look forward to the next build of dotConnect for Oracle. We will post here when it is available for download.
Shalex
Devart Team
 
Posts: 7530
Joined: Thu 14 Aug 2008 12:44

Postby Shalex » Fri 27 Jan 2012 14:03

New version of dotConnect for Oracle 6.70 is released!
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=23260 .
Shalex
Devart Team
 
Posts: 7530
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle