Passing Structures to Operations

Structures hold complex datatypes (for example a string list, class or MBO object, or a list of objects) that enhance interactions with certain enterprise information systems (EIS) data sources, such as SAP and Web services, where the mobile business object (MBO) requires complex operation parameters.

An Unwired WorkSpace project includes an example MBO that is bound to a Web service data source that includes a create operation that takes a structure as an operation parameter. MBOs differ depending on the data source, configuration, and so on, but the principles are similar.

The SimpleCaseList MBO contains a create operation that has a number of parameters, including a parameter named _HEADER_ that is a structure datatype named AuthenticationInfo, defined as:
AuthenticationInfo
   userName: String
   password: String
   authentication: String
   locale: String
   timeZone: String
Structures are implemented as classes, so the parameter _HEADER_ is an instance of the AuthenticationInfo class. The generated Java code for the create operation is:
public  void Create(Authentication _HEADER_,string escalated,string hotlist,
string orig_Submitter,string pending,string workLog);
This example demonstrates how to initialize the AuthenticationInfo class instance and pass them, along with the other operation parameters, to the create operation:
AuthenticationInfo authen = new AuthenticationInfo();
           authen.UserName = "Demo";

           
            SimpleCaseList newCase = new SimpleCaseList();
            newCase.Case_Type = "Incident";
            newCase.Category = "Networking";
            newCase.Department = "Marketing";
            newCase.Description = "A new help desk case.";
            newCase.Item = "Configuration";
            newCase.Office = "#3 Sybase Drive";
            newCase.Submitted_By = "Demo";
            newCase.Phone_Number = "#0861023242526";
            newCase.Priority = "High";
            newCase.Region = "USA";
            newCase.Request_Urgency = "High";
            newCase.Requester_Login_Name = "Demo";
            newCase.Requester_Name = "Demo";
            newCase.Site = "25 Bay St, Mountain View, CA";
            newCase.Source = "Requester";
            newCase.Status = "Assigned";
            newCase.Summary = "MarkHellous was here Fix it.";
            newCase.Type = "Access to Files/Drives";
            newCase.Create_Time = System.DateTime.Now;

            newCase.Create (authen, “Other”, “Other”, “false”, “work log”);
            newCase.SubmitPending();