02.05.2014 Views

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

CoreandServices.book - Ocean - Schlumberger

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Custom Worksteps<br />

You need to tell <strong>Ocean</strong> that there is a UI factory to create UI’s for your argument package.<br />

Add your UI factory as a service with your argument package type as the source type. See<br />

Chapter 3, “<strong>Ocean</strong> Services,” on page 3-55.<br />

Add the service in the module’s Integrate method.<br />

public void Integrate ()<br />

{<br />

MyUpscalingWorkstep.UIFactory f;<br />

f = new MyUpscalingWorkstep.UIFactory();<br />

Type sourceType = typeof(MyUpscalingWorkstep.Args);<br />

Type serviceType = typeof(WorkflowEditorUIFactory);<br />

CoreSystem.Services.AddService(sourceType, serviceType, f);<br />

...<br />

}<br />

The system will see that there is a UI factory available for your argument package and will<br />

call your CreateUI method to get your custom UI whenever it needs the dialog UI for<br />

your workstep.<br />

Step 8 - Add the Workstep to Petrel<br />

You must add your workstep to the Petrel Workflow editor to make it available to the end<br />

user. Use the IWorkflowEditor interface available from the<br />

PetrelSystem.WorkflowEditor property.<br />

Add the workstep in the module’s Integrate method:<br />

public void Integrate ()<br />

{<br />

...<br />

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

PetrelSystem.WorkflowEditor.Add(w);<br />

}<br />

6-320 <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!