2022 June Release

Customization Point FSCOWSWF@1.1001:CPMobileAppMapping Permanent link for this heading

This customization point is used to support the web service WSExecuteWorkItem. When a work item is implemented by a virtual application, it can not be executed regularly.
This customization point can provide a mapping for a vApp with complimentary execution done by a web service.
Only simple vApps can be re-implemented using this technique.
The customization point can define inputparams which will be evaluated by WSGetWorkItems.
(see WorkItemEntry with WorkItemApplicationMapping and wiamparams)
These parameters can then be used by the web service client to do some processing.
When the web service client has finished its work, the web service method WSExecuteWorkItem might be called.
The parameter dictionary executeparams by WSExecuteWorkItem will then again be passed as parameters to this customization point executeexpr.
So this customization point can provide parameters for a client and do again some work with other parameters provided by a client.
The client can further be steered by defining a special view via mobileapplication which can be interpreted by a client to know what is the intended work.

The Fabasoft Apps (Fabasoft Cloud, Fabasoft) currently support these views to perform actions on the device:
  • Empty - nothing is shown in the app
    No inputparams can be sent to the device. Nothing will be passed to the executeexpr.
    If you want that the work item should not appear in the app at all you may hide it by using IsWorkItemCalledByWebservice in its precondition. Here is a sample:
    
    activity ConfTravelExpenseReport {
      ...
      step OpenContentTravelExpenseReport required multiple {
        execute = OpenContent;
        precond = expression {
          // hide this work item in the mobile worklist app
          return !activity.IsWorkItemCalledByWebservice();
        }
      }
      ...
    }
    
  • OpenObject - the document of the object may be opened in an app on the device
    No inputparams can be sent to the device. Nothing will be passed to the executeexpr.
    There is a default configuration available for OpenObject and OpenContentObjectApp.

  • RemarkObject - a view for entering a remark is shown in the app on the device
    A dictionary with the following members may be provided as inputparams:
    • boolean mustremark - if true the user must enter a remark on the device.
    • content remarks - the remarks that should be displayed on the device in a format as stored in boremarks

    In the executeexpr you will find the following parameters in the global scope:
    • string remark - The remark entered by the user on the device.
    You may use #TV.WFVAR_THIS.boenterremark = ::remark; to store the remark on the object.

  • SignObject - a view for signing the object is shown in the app on the device
    A dictionary with the following members may be provided as inputparams (You may use EvaluateSignatureSettings to get these parameters from the current signature configuration.):
    • SignatureVerification verification - can define modifications for forms.
      The Fabasoft Worklist Apps only support SIGNVER_PASSWORD by showing and transmitting a password field.
    • boolean useremark - if true the user may enter a remark on the device.
    • boolean mustremark - if true the user must enter a remark on the device.
    • SignatureList[] signatures - a list of signatures already assigned to the object.
    In the executeexpr you will find the following parameters in the global scope:
    • string password - The password entered by the user on the device
    • string remark - The remark entered by the user on the device
    • PDFSignature[] pdfsignatures - The list of pdf signatures entered by the user on the device
    You may use coouser.SignObjectWithType(#TV.WFVAR_THIS, <signtype>, ::remark, ::password, ::pdfsignatures); to sign the object in the executeexpr.

  • UploadFiles - a view for uploading files is shown in the app on the device
    A dictionary with the following members may be provided as inputparams:
    • sys_object - when not specified, the main object of the process will be used for performing the upload
    • sys_view - when not specified, the default view according to CMIS implementation will be used for performing the upload.
      Only relevant when object for which the upload will be performed is an instance of CompoundObject.
    The executeexpr will contain no extra information, as the actual uploads will already be performed by the app on the device.

    Depending on the object class of the main object of the process it will be available to upload just a single file or a bunch of files.
    Following actions may be available:
    • Browse local files
    • Take photo by camera
    • Take video by camera
    • Paste from clipboard
    • Create textfile
    When the object for which the view is opened is an instance of A progress bar is shown for each file being uploaded.
    The view will be blocking and can only be left after successfully uploading all selected files or by canceling the view.
    Note: Cancel the view will not undo successful uploads.



Sample configuration:

customize CPMobileAppMapping <OpenObject> {
  mobileapplication = "OpenObject";
  inputparams = expression {
  }
  executeexpr = expression {
  }
}
customize CPMobileAppMapping <ObjectSignAcceptApproval> {
  mobileapplication = "SignObject";
  inputparams = expression {
    dictionary dict = coouser.EvaluateSignatureSettings(#TV.WFVAR_THIS, #SIGN_DIGITAL);
    if (#TV.WFVAR_ACTIVITY.actinstremark) {
      dict.actinstremark = #TV.WFVAR_ACTIVITY.actinstremark;
    }
    return dict;
  }
  executeexpr = expression {
    coouser.SignObjectWithType(#TV.WFVAR_THIS, #SIGN_DIGITAL, ::remark, ::password, ::pdfsignatures);
  }
}
customize CPMobileAppMapping<AddRemark> {
  mobileapplication = "RemarkObject";
  inputparams = expression {
    return {
      useremark: true,
      mustremark: true,
      remarks: #TV.WFVAR_THIS.boremarks
    };
  }
  executeexpr = expression {
    if (::remark) {
      #TV.WFVAR_THIS.ObjectLock(true, true);
      #TV.WFVAR_THIS.boenterremark = ::remark;
    }
  }
}
customize CPMobileAppMapping <ObjectWFUpload> {
  mobileapplication = "UploadFiles";
  inputparams = expression {
    if (#TV.WFVAR_THIS.HasAttribute(cootx, #content)) {
      // do not provide sys_view for content object
      return;
    }
    // provide first drop target
    Object[] attrdefs = #TV.WFVAR_THIS.GetDropTargets();
    object viewattrdef = (count(attrdefs) == 1 && #TV.WFVAR_THIS.CheckSetAccess(cootx, attrdefs)) ? attrdefs[0] : null;
    if (viewattrdef) {
      return {
        sys_view : viewattrdef.GetAddress()
      }
    }
  }
}

void FSCOWSWF@1.1001:CPMobileAppMapping(
  key ComponentObject application,
  out direct string mobileapplication,
  out dictionary inputparams,
  out any executeexpr)

Name

Description

application

Can be an action (to override all mapped virtual applications, e.g.: OpenObject) or the direct application which should be implemented.

mobileapplication

The reference of the view that should be shown on the device.
  • "Empty" - nothing is shown in the app
  • "OpenObject" - the document of the object may be opened in an app on the device
  • "RemarkObject" - a view for entering a remark is shown in the app on the device
  • "SignObject" - a view for signing the object is shown in the app on the device
  • "UploadFiles" - a view for uploading files is shown in the app on the device

inputparams

Defines a dictionary to transport data to the mobile application.
Either return some global configurations or access the actual activity through transaction variables:

executeexpr

This expression will be executed when WSExecuteWorkItem is called for a work item which actually requires a GUI, but can also be executed as expression when the relevant user information has been entered.
Please check the required parameters - they should be available in the global scope.
The information for the activity is again available through transaction variables: but also in the local scope:
  • this.object - the main object, may be a list when process operates on multiple objects at once
  • this.process - the whole process object
  • this.activity - the current activity
  • this.workitem - the index of the current work item

Additional Information