This is yet another simple implementation. I, here share you the idea how we would create and bring in a custom PxControl in either Workflow manager or Session Manager UI.
First, you decide and design your UI for the PxControl the very normal way you would design for a windows form application. Once you are done with your design all you need to do is to refer your form instance in a class file, which really implements the IMMPxControl interface. Yes, create a class file which implements IMMPxControl and add all the methods implicitly or explicitly and there you go, you are done with your PxContorl.
Please mind to register your PxControl :) as below with [ComRegisterFunction()]
MMProcessMgrControl.Register() and MMProcessMgrControl.UnRegister()
Other Methods would be as below
public bool Enable
{
get { return anyBoolValue;}
set { value= anyBoolValue;}
}
I use InitData to initialize my IMMPxApplication
public void IMMPxControl.Initialize(object vInitData)
{
IMMPxApplication pxApplication = vInitData as IMMPxApplication;
}
The node which is getting into picture at the runtime
public IMMPxNode Node
{
set { IMMPxNode pxNode= value;}
}
Sets the PxControl's Visibility, return your form's visibility.
public bool Visible
{
get { return YouWindowsForm.Visible; }
set {YouWindowsForm.Visible = value;}
}
Return your form's Handle value
public int hWnd
{
get{ return YouWindowsForm.Handle.ToInt32();}
}
Also, you can implement IMMPxDisplayName for your PxConrol, which gives the specific name for your PxControl, used to select in ProcessFrameWork Administration Tool.
public string IMMPxDisplayName.DisplayName
{
get { return "My New PxControl"; }
}
Once after all these, build your application and your PxControl should get registered and ready for you to configure. Log into your PFA->STATES tab-> Select the NODE TYPE as SESSION (if you want this PxControl for a Session), If you are interested to show your PxControl only on a particular SESSION's STATE-> Select a state and and under CONTROL click on the right end of the text box you will get drop down and choose your PxControl( "My New PxControl"). Next the BITMAP-> if you wish to have a unique icon for your sessions, you can add and use them.
If you do not find your PxControl listed in the drop down, am sure something has not went well with you code or registration. Save your settings and log into your session manager and and click on any of your session and make sure your session is in the state you have configured in PFA tool for your PxControl.
Happy Coding
Rajesh K
First, you decide and design your UI for the PxControl the very normal way you would design for a windows form application. Once you are done with your design all you need to do is to refer your form instance in a class file, which really implements the IMMPxControl interface. Yes, create a class file which implements IMMPxControl and add all the methods implicitly or explicitly and there you go, you are done with your PxContorl.
Please mind to register your PxControl :) as below with [ComRegisterFunction()]
MMProcessMgrControl.Register() and MMProcessMgrControl.UnRegister()
Other Methods would be as below
public bool Enable
{
get { return anyBoolValue;}
set { value= anyBoolValue;}
}
I use InitData to initialize my IMMPxApplication
public void IMMPxControl.Initialize(object vInitData)
{
IMMPxApplication pxApplication = vInitData as IMMPxApplication;
}
The node which is getting into picture at the runtime
public IMMPxNode Node
{
set { IMMPxNode pxNode= value;}
}
Sets the PxControl's Visibility, return your form's visibility.
public bool Visible
{
get { return YouWindowsForm.Visible; }
set {YouWindowsForm.Visible = value;}
}
Return your form's Handle value
public int hWnd
{
get{ return YouWindowsForm.Handle.ToInt32();}
}
Also, you can implement IMMPxDisplayName for your PxConrol, which gives the specific name for your PxControl, used to select in ProcessFrameWork Administration Tool.
public string IMMPxDisplayName.DisplayName
{
get { return "My New PxControl"; }
}
Once after all these, build your application and your PxControl should get registered and ready for you to configure. Log into your PFA->STATES tab-> Select the NODE TYPE as SESSION (if you want this PxControl for a Session), If you are interested to show your PxControl only on a particular SESSION's STATE-> Select a state and and under CONTROL click on the right end of the text box you will get drop down and choose your PxControl( "My New PxControl"). Next the BITMAP-> if you wish to have a unique icon for your sessions, you can add and use them.
If you do not find your PxControl listed in the drop down, am sure something has not went well with you code or registration. Save your settings and log into your session manager and and click on any of your session and make sure your session is in the state you have configured in PFA tool for your PxControl.
This is the default PxControl, similarly one can design his own PxControl.
Happy Coding
Rajesh K
Hi, have you ever implemented custom filter? I try to do it but I have a trouble with ID8List and Controls. I'll be very greatful if you could answer me.
ReplyDeleteThis comment has been removed by the author.
ReplyDelete