02.05.2014 Views

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Custom Worksteps<br />

The argument package is passed in to the method. You access the input and output<br />

arguments via the argument package properties.<br />

class MyUpscalingWorkstep : Workstep<br />

{<br />

...<br />

protected override void<br />

InvokeSimpleCore(MyUpscalingWorkstep.Args argPack)<br />

{<br />

...<br />

// access input data<br />

Property myProperty =<br />

argPack.Grid.PropertyCollection.CreateProperty(...);<br />

myProperty.Name = argPack.WellLog.Borehole.Description.Name;<br />

// process data<br />

int cellsProcessed = 0;<br />

...<br />

}<br />

}<br />

// write output data<br />

argPack.Property = myProperty;<br />

argPack.NumberOfCells = cellsProcessed;<br />

We will not go into the details of the processing algorithm because it uses the Petrel data<br />

domain API extensively and provides no further insight into worksteps.<br />

If you have an execution problem while the workstep is being run, you need to be able to<br />

notify the end user without it being treated as an error. In this case, use the <strong>Ocean</strong> class<br />

WorkstepException.<br />

public class WorkstepException : Exception<br />

{<br />

public WorkstepException();<br />

public WorkstepException(string message);<br />

public WorkstepException(string message, Exception innerException);<br />

protected WorkstepException(SerializationInfo info,<br />

StreamingContext context);<br />

}<br />

<strong>Schlumberger</strong> Private<br />

Workflow 6-307

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!