0

I have a custom Ocean workstep in Petrel, but I cannot succeed in persisting my arguments package. My package contains PillarGrid objects (Gird, Property, Zone) as shown below :

[Archivable(Version = 1, Release = "2013.6")]
public class MyArguments : DescribedArgumentsByReflection, IIdentifiable
{
    [Archived]
    private Grid grid = Grid.NullObject;

    [Archived]
    private int seedNumber;

    [Archived]
    private int numberRealizations = 1;

    [Archived]
    private Zone regionZone = Zone.NullObject;

    [Archived]
    private Property property = Property.NullObject;

    [Archived]
    private Droid droid = Droid.Empty;

    ...

    public DeeSseArguments()
        : base()
    {
        // adding this to datasource
        IDataSourceManager dsManager = DataManager.DataSourceManager;
        string DataSourceId = DeeSseDataSourceFactory.DataSourceId;
        StructuredArchiveDataSource dataSource = dsManager.GetSource(DataSourceId) as StructuredArchiveDataSource;
        this.droid = dataSource.GenerateDroid();
        dataSource.AddItem(this.droid, this);
    }

}

I created a DataSourceFactory based on a StructuredArchiveDataSource :

public class MyDataSourceFactory : DataSourceFactory
{
    public static string DataSourceId = "MyArgsPackId";

    public override Slb.Ocean.Core.IDataSource GetDataSource()
    {
        return new StructuredArchiveDataSource(DataSourceId, new[] { typeof(MyArguments) });
    }
}

I registered this DataSourceFactory in he module method "integrate".

When I try to save my project in Petrel, I have the following error message : "System.Exception: MyArgsPackId: Not an archivable type 'Slb.Ocean.Petrel.DomainObject.PillarGrid.Property'"

How can I manage this persistence please ?

Eric David
  • 261
  • 3
  • 14

1 Answers1

1

PillarGrid and other complex types cannot be persisted in this manner.

For IIdentifiable objects you should persist their DROID.

Later you can then retrieve the object from said DROID using DataManager.Resolve.

Chippy

Chippy
  • 81
  • 1
  • Thx. And how can I do that ? Should I create my own DataSource or is it possible to use the StructuredarchiveDataSource ? Furthermore, Zone is not a IIdentifiable object... – Eric David May 24 '13 at 08:32
  • Finally, I simply add the droids of my complex objects in my argpack. I archive the droid but not the object. When loading the object I use DataManager.Resolve() to build it. For the zone, I archive its name, topk and basek. And I rebuild the zone while loading the project. – Eric David May 28 '13 at 07:05