PMF Workflow Script APIs
PMF Workflow Script APIs
*It is able to run C# script in Workflow nodes.
Example 1 – Send Email:
SendEmail(“[email protected]”, null, null, “Test Email”, “This is a test email”, false);
return true;
Example 2 – Write form data into a database table:
Database.Row row = new Database.Row();
row.Add(“company”, “Scilligence”);
row.Add(“website”, “www.scilligence.com”);
InsertDB(“Data Source=(local);Initial Catalog=CompanyDB;User ID=sa;Password=;”, “Companies”, row);
return true;
Example 3 – Call SOAP Web Service:
Database.Row row = new Database.Row();
row.Add(“company”, “Scilligence”);
row.Add(“website”, “www.scilligence.com”);
string ret = CallSoap(“http://server/app/service.asmx”, “http://namespace.company.com”, “AddCompany”, row);
return ret;
Properties:
- this.data (Database.Row): contains workflow form data
- this.requestid (long): the current requestid
- this.CurrentUserID: the current user ID
- this.CurrentUserEmail: the current user email
Methods supported:
- bool SendEmail(string to, string cc, string bcc, string subject, string body, bool html)
- long CreateRequest(string form, Database.Row data, bool submit, string notes)
- long CreateRequestCopyData(string form, string keys, bool submit, long userid)
- bool SetFieldValues(Database.Row data)
- bool InsertDB(string connectionstring, string table, Database.Row row)
- bool UpdateDB(string connectionstring, string table, Database.Row row, string where)
- Database.Row ReadDB(string connectionstring, string sql)
- string ReadFile(string path, string credential)
- void WriteFile(string path, string contents, string credential)
- string CallWebService(string url, Database.Row postdata, string username, string password, int timeout)
- string CallSoap(string url, string ns, string method, Database.Row data)
- byte[] ReadFileStore(string s, string source)
- string ReadFileStoreAsText(string s, string source)
- string GetProjectCode()
- string GetCompanyCode()
- long CreateProject(string company, string parentproject, string projectcode, string name, Database.Row row)
- long CreateTask(string projectcode, long parenttaskid, string title, Database.Row row)
- bool DoAction(long requestid, string cmd, Database.Row items)
- bool SetFieldValue(string key, string value)
- bool SetFieldValues(Database.Row data)