As of version 6.30, dotConnect for Oracle implements Oracle Workflow Instance Store. To use Oracle Workflow Instance Store you need Oracle server 9 or higher.
Before using Oracle Workflow Instance Store, you need to create a database that is used to persist workflow instances. dotConnect for Oracle provides the scripts for creating this database. They are placed to the WF Services subfolder of the dotConnect for Oracle installation folder. By default it is %ProgramFiles%\Devart\dotConnect\Oracle\WF Services\. Note that there are two versions of scripts - for .NET Framework 4.5, and for previous versions of .NET Framework.
If you target .NET Framework 4.5, execute the OracleInstanceStoreSchema45.sql script first and then execute OracleInstanceStoreLogic45.sql. If you target .NET Framework 3.0, 3.5, or 4.0, execute the OracleInstanceStoreSchema.sql script first and then execute OracleInstanceStoreLogic.sql. You may use these scripts to clean up the persistence database to have a fresh database in the same way, just execute them in the same order.
To enable persistence for self-hosted workflows that use WorkflowApplication, perform the following steps:
Specify the using directive:
Create OracleInstanceStore and assign the following code to the InstanceStore property of WorkflowApplication:
To enable persistence using the OracleInstanceStoreBehavior class, perform the following steps:
Add the following statement at the top of the source file after the existing "using" statements.
Create an instance of the WorkflowServiceHost and add endpoints for the workflow service.
Construct an OracleInstanceStoreBehavior object and to set properties of the behavior object.
Open the workflow service host.
To configure Oracle Instance Store by using the oracleInstanceStore behavior element in a configuration file, perform the following steps:
Add the following behavior extension element to the Machine.config file so that you can use the <oracleInstanceStore> service behavior element in the configuration files of your applications to configure persistence for your services:
<configuration> <system.serviceModel> <extensions> <behaviorExtensions> <add name="oracleInstanceStore" type="Devart.Data.Oracle.Activities.Configuration.OracleInstanceStoreElement, Devart.Data.Oracle.WorkflowFoundation, Version=8.4.215.0, Culture=neutral, PublicKeyToken=09af7300eec23701" /> </behaviorExtensions> </extensions> </system.serviceModel> </configuration>
Note: Replace 8.4.215.0 in the code with your actual version.
Configure Oracle Instance Store by using the oracleInstanceStore behavior element in a configuration file of your application:
<configuration> <system.serviceModel> <behaviors> <serviceBehaviors> <behavior name=""> <oracleInstanceStore connectionString="User Id=Scott;Password=tiger;Data Source=Ora;" instanceEncodingOption="GZip | None" instanceCompletionAction="DeleteAll | DeleteNothing" instanceLockedExceptionAction="NoRetry | BasicRetry |AggressiveRetry" hostLockRenewalPeriod="00:00:30" runnableInstancesDetectionPeriod="00:00:05" /> </behavior> </serviceBehaviors> </behaviors> </system.serviceModel> </configuration>