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 system will create a new argument package when needed for a workstep run by<br />

calling CreateArgumentPackageCore from the Workstep.<br />

public abstract class Workstep : Workstep<br />

where TArgPack : new ()<br />

{<br />

protected virtual void CreateArgumentPackageCore ()<br />

{ return new TArgPack(); }<br />

...<br />

}<br />

• • • • • •<br />

Note:<br />

The implementation simply creates a new argument package using its default<br />

public constructor. You can override this method and create the argument<br />

package yourself. This lets you use any of your argument package<br />

constructors.<br />

Step 2c - Override Argument Package Copying<br />

Different aspects of the system need to be able to copy worksteps including copy/paste in<br />

the workflow editor and running the workflow. To support this functionality, we must<br />

implement a copy for our argument package from one to another. We do this by<br />

overriding the protected method CopyArgumentPackageCore from the Workstep<br />

base class.<br />

public class MyUpscalingWorkstep : Workstep<br />

{<br />

...<br />

protected override void CopyArgumentPackageCore(Args from, Args to)<br />

{<br />

to.WellLog = from.WellLog;<br />

to.Grid = from.Grid;<br />

to.Prop = from.Prop;<br />

to.NumCells = from.NumCells;<br />

}<br />

...<br />

}<br />

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

Workflow 6-305

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

Saved successfully!

Ooh no, something went wrong!