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

Step 7b – Derive from UI Factory<br />

Derive from the convenience class WorkflowEditorUIFactory to provide your custom<br />

UI to <strong>Ocean</strong> when needed.<br />

public abstract class WorkflowEditorUIFactory<br />

{<br />

protected WorkflowEditorUIFactory();<br />

}<br />

public Control CreateDialogUI( Workstep w,<br />

object argPackage, WorkflowContext context);<br />

protected abstract Control CreateDialogUICore(Workstep w,<br />

object argPackage, WorkflowContext context);<br />

The WorkflowContext provides a method to call when the argument package has been<br />

changed.<br />

public class WorkflowContext<br />

{<br />

...<br />

public void OnArgumentPackageChanged(object sender,<br />

WorkflowContext.ArgumentPackageChangedEventArgs e);<br />

public class ArgumentPackageChangedEventArgs : EventArgs<br />

{<br />

public ArgumentPackageChangedEventArgs();<br />

}<br />

}<br />

CreateDialogUICore is passed the workstep, the argument package, and the<br />

workflow context. The custom UI will need some of this information to do its job. The<br />

custom UI initializes itself from the values in the argument package when it is created and<br />

sets the values the user has entered back into the argument package when the user is<br />

finished. It needs the workflow context in order to notify others that the argument<br />

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