Process Mapping Logo

Process Mapping - Forums

Sharing 19 years of knowledge and experience

 
Metastorm BPM forums
Sign up Latest Topics
 
 
 


Reply
  Author   Comment  
TiredDeveloper

Member
Registered:
Posts: 23
Reply with quote  #1 
My business user has an application which periodically creates a .csv file containing various data fields.  When this file is created, he'd like a MBPM process to start which reads in the data from the .csv file, populates a Form and then starts an approval process.

The application is old and has very limited API functionality and so I don't think I can utilize a web service.

My initial thoughts were to create a solution in which a timed action checks every 5mins to see if a csv file is available in the file transfer folder and if so, kicks off a new folder, reads in the data from the file and then deletes the file.

Does anyone have any experience of this type of scenario and if so, any advice?
0
BMellert

Guru
Registered:
Posts: 688
Reply with quote  #2 
I haven't done this, but a "check regularly" process could in theory work.  However, I'd like take the approach of a batch or other script kicked off by the Windows Task Manager which checks for files.  Then if there is a file (perhaps) move it to a "processing" directory so it doesn't get "found" again if it hasn't been processed by the time the check is done then.  Once a file is ready/available, then kick off the MBPM process using a flagged action, passing in the file name.  The process then does what it does and removes (or archives as a temporary backup) the file when its ready.  (You could even possibly load the original file as an attachment to the process so its all archived together.)
0
TiredDeveloper

Member
Registered:
Posts: 23
Reply with quote  #3 
Thanks, I'm actually having problem handling the files.  I'm trying to use the class System.IO.FileInfo and whilst the Designer is okay with my code, it falls over when I run it as it seems to be missing the Assembly Reference.  I thought this was a basic class to use as it is in mscorlib.dll  Am I doing something wrong or just missing an Assembly Reference somewhere?
0
BMellert

Guru
Registered:
Posts: 688
Reply with quote  #4 
I only use the following System.IO.File. methods:  Copy(), Delete() and WriteAllBytes() to write/create a files.  I have not used System.IO.FileInfo within MBPM but I didn't have to add any references over the defaults when creating a server script within MBPM.  (I have no idea if tying to do directly in action code, verses a server script, makes a difference, though I did have some issues (don't recall exactly what) which drove some of my scripting into server scripts instead.)

Otherwise I have used built in Mstm.DeleteAttachment(), Mstm.GetAttachment() and Mstm.NewAttachment() for my file I/O but that's working with attachments (delete, read, create) from MBPM itself.

Any try/catch around the code to try to get a better reference of the actual error message?
0
TiredDeveloper

Member
Registered:
Posts: 23
Reply with quote  #5 
Hi, thanks for the info.  It seems that my code doesn't even run or get near the try, catch code.  I'm getting the following error when the Timed Action tries to run:

Details:Failed to execute
'system action'. The type
'Metastorm.Runtime.Models.Approval_Process.Approval_Process,Metastorm.Runtime.Models.CS.Approval_Process,
Version=2.0.5599.23318, Culture=neutral, PublicKeyToken=null', or one of its
dependencies, could not be found.

Sometimes it does actually work for a bit and then it keels over with the above error.  I'm not sure where the problem is as I've tried to deconstruct the code line by line to no available.  if anyone could shed some light on what this error means, then I'd be very grateful
0
BMellert

Guru
Registered:
Posts: 688
Reply with quote  #6 
I hate that dependencies message, though usually we don't get it suddenly after its been working for a while .. unless there was a code change.  At times I've found redeploying and/or restarting the engine clears that one -- both hacks IMO.  If I think of something else to check I'll repost.
0
Previous Topic | Next Topic
Print
Reply

Quick Navigation:


Create your own forum with Website Toolbox!