E10 BPM export data

E10 BPM

I have an updatable dashboard, when I have a field changed from the dashboard I would like some data to export to a simple file.

I am trying to use a BPM to export the data, but I do not know how to get data to export to a file after the conditional statement is met within the BPM.

Is this the best way to get the export file, if so what are the commands? If there is a better way to get the export file, please let me know.

Sounds like you’re trying to, on a Update method of whatever BO your dashboard is triggering, write something to a file?
You’ll want to execute a custom code block and potentially use the System.IO.File.WriteAllText method from your LINQ results to write the data you’ve gathered to a file.

I’d hesitate to go down this path unless there is a good business reason to do so. What are you actually trying to accomplish by exporting some data when the Update method of your BO is triggered? There might be a better solution.

Is this for some sort of a change log?
This can be done however be extremely weary of performance. IO Is one of the slowest operation a computer can do so hanging a synchronous write operation of any BO will heavily affect performance.
You can use what @Aaron_Moreng suggested to write to the file, remember that all BPM’s run server side so any file will likely have to be written to a network share or a location on the server.

minding what the previous two posters mentioned about performance etc… and if possible, go asynchronous with this, but if your business needs warrant the file here is an example of how to do that from a post process update in an baq method update. Also, you’ll need an entry on the usings tab System.IO;

/* Initiate Maintenance Labor Activity */           
 string header = "ReqDueDate|DueDate|StartDate|Assigned|JobHead_JobNum|EquipmentID|Priority|RequestID|ReqByID|ReqByName|ProdEquipDown|SafetyIssue|Type|AssignGrp|Engineered|Released|IssueTopicsSearch|Description|Email|StartJob|EndJob|Comments|Topic|MeterReading|CloseJob|UserID|ActiveLabor|OpDesc|JobOper_JobNum|JobOper_AssemblySeq|OperSeq|JobAsmbl_JobNum|JobAsmbl_AssemblySeq"; 
            string s = null;
            /* Execute some BS here */
            foreach (var ttResult in ttResults)
            {
                s += String.Format("{0}{1}|{2}|{3}|{4}|{5}|{6}|{7}|{8}|{9}|{10}|{11}|{12}|{13}|{14}|{15}|{16}|{17}|{18}|{19}|{20}|{21}|{22}|{23}|{24}|{25}|{26}|{27}|{28}|{29}|{30}|{31}|{32}|{33}", Environment.NewLine, ttResult.JobHead_ReqDueDate.Value.ToString("dd/MM/yyyy"), ttResult.JobHead_DueDate.Value.ToString("dd/MM/yyyy"),
                    ttResult.JobHead_StartDate.Value.ToString("dd/MM/yyyy"), ttResult.JobHead_ShortChar02, ttResult.JobOper_JobNum, ttResult.JobHead_EquipID, ttResult.JobHead_SchedCode,
                    ttResult.MaintReq_ReqID, ttResult.MaintReq_ShortChar01, ttResult.MaintReq_ShortChar02, ttResult.MaintReq_CheckBox01, ttResult.MaintReq_CheckBox02, ttResult.Calculated_Type,
                    ttResult.Calculated_AssignGrp, ttResult.JobHead_JobEngineered, ttResult.JobHead_JobReleased, ttResult.JobHead_IssueTopics, ttResult.JobHead_PartDescription,
                    ttResult.JobHead_ShortChar20, ttResult.JobHead_CheckBox04, ttResult.JobHead_CheckBox06, ttResult.JobHead_Character01, ttResult.JobHead_ShortChar01, ttResult.JobHead_Number02,
                    ttResult.JobHead_CheckBox07, ttResult.JobHead_ShortChar03, ttResult.JobHead_CheckBox08, ttResult.JobOper_OpDesc, ttResult.JobOper_JobNum, ttResult.JobOper_AssemblySeq,
                    ttResult.JobOper_OprSeq, ttResult.JobAsmbl_JobNum, ttResult.JobAsmbl_AssemblySeq);
            }
            File.WriteAllText(@"\\YourServer\Public\Service Connect E10\Maintenance\Labor\" + Guid.NewGuid().ToString()+".csv", header + s);
4 Likes

We are trying to export material lines from a job we have inventory available at a 3rd party.

This file will then be used to retrieve the inventory from 3rd party.