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 Processes<br />

<strong>Ocean</strong> provides the WorkstepProcessWrapper convenience class to make this easy. It<br />

creates a Process from your Workstep.<br />

WorkstepProcessWrapper<br />

custom Workstep<br />

Fig. 6-62 Workstep Wrapped to Become a Process<br />

There are four steps to create a process from an existing workstep.<br />

1 Create a process from your workstep using WorkstepProcessWrapper.<br />

2 When you have a custom UI, enhance the UI behavior.<br />

3 Implement persistence on the workstep argument package.<br />

4 Add your process to the Petrel Process diagram.<br />

Step 1 - Create Process via WorkstepProcess-Wrapper<br />

The <strong>Ocean</strong> class WorkstepProcessWrapper creates a process from your workstep.<br />

public class WorkstepProcessWrapper : Process<br />

{<br />

public WorkstepProcessWrapper(Workstep workstep);<br />

public object ArgumentPackage { get; }<br />

public Workstep Workstep { get; }<br />

protected override Control CreateUICore();<br />

}<br />

public sealed class Context : WorkflowContext { ... }<br />

Pass an instance of the workstep to the wrapper class constructor.<br />

MyUpscalingWorkstep w = new MyUpscalingWorkstep();<br />

Process p = new WorkstepProcessWrapper(w);<br />

6-340 <strong>Ocean</strong> Application Development Framework 2008.1<br />

<strong>Schlumberger</strong> Private

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

Saved successfully!

Ooh no, something went wrong!