Mattersphere Developers Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Go down
avatar
Lynne Harding
Posts : 335
Join date : 2018-12-20

Add Event On Milestone Change Empty Add Event On Milestone Change

Mon 3 Feb 2020 - 9:20
I am trying to add an event when a milestone gets checked but I am getting an object not set to an instance of an object error.
It is because I am trying to use FWBS.OMS.OMSFile when in the DataBuilder I am usingFWBS.OMS.Milestones_OMS2K which does not have the AddEvent as part of the class.
I have tried referencing FWBS.OMS but am still getting the error. What can I do to get this to work?
avatar
Lynne Harding
Posts : 335
Join date : 2018-12-20

Add Event On Milestone Change Empty Re: Add Event On Milestone Change

Mon 3 Feb 2020 - 9:21
The MilestoneEvent is intended to be acted upon with a FilemanagementApplication (aka taskflow). In the Application events node there is a entry OnMilestoneEvent. This event isn't related to OMSFile.AddEvent(..). AddEvent adds a row to the table [dbo].[dbFileEvents].
avatar
Lynne Harding
Posts : 335
Join date : 2018-12-20

Add Event On Milestone Change Empty Re: Add Event On Milestone Change

Mon 3 Feb 2020 - 9:21
Is there a way to use the addevent to add a row to dbfileevents when a milestone is ticked or unticked. I want to put some logging around when these are changed and I cannot think of a better way.
If you have a better idea then please let me know.
avatar
Lynne Harding
Posts : 335
Join date : 2018-12-20

Add Event On Milestone Change Empty Re: Add Event On Milestone Change

Mon 3 Feb 2020 - 9:21
In your Filemanagement script you code add something similar to:


.csharpcode, .csharpcode pre
{
font-size: small; color: black;
font-family: Consolas, “Courier New”, Courier, Monospace; background-color: #ffffff;
/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #a31515; }

.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt
{
background-color: #f4f4f4; width: 100%;
margin: 0em;
}
.csharpcode .lnum { color: #606060; }


public override void OnMilestoneEvent(FWBS.OMS.Extensibility.ObjectEventArgs e, ref bool Handled)
{
FWBS.OMS.ValueChangedEventArgs args = e.Arguments as FWBS.OMS.ValueChangedEventArgs;

if (args == null) return;

if (args.Name.StartsWith(“MSStage”) && args.Name.EndsWith(“Achieved”))
{
CurrentFile.AddEvent(“STGCOMP”, “Stage complete”, args.Name);
}
}



avatar
Lynne Harding
Posts : 335
Join date : 2018-12-20

Add Event On Milestone Change Empty Re: Add Event On Milestone Change

Mon 3 Feb 2020 - 9:22
I have tried this and am getting CurrentFile does not exist in the current context. What Class am I missing?
At the moment I have namespace OMS.Scriptlets { using System;
using System.Windows.Forms; using FWBS.Common.UI; using FWBS.Common;
using FWBS.OMS.UI.Windows; using FWBS.OMS;
using FWBS.OMS.Extensibility; Thanks for all your help.
Sponsored content

Add Event On Milestone Change Empty Re: Add Event On Milestone Change

Back to top
Permissions in this forum:
You cannot reply to topics in this forum