Question

Cloud 22R2 - Fetch Work Status from mWO Service to a Custom Field

  • 12 April 2023
  • 5 replies
  • 168 views

Badge +12

Hello,

I would like to fetch the Work Status of the technician from an attribute in baseline entity (ResLatestLogonStatus) to a custom attribute in another baseline entity (JtExecutionInstance). From mobile (mWO Service) when the technician changes the Work Status, it should reflect in the Custom Attribute in JtExecutionInstance. 

I’ve tried creating a custom attribute in JtExecutionInstance with PL/SQL expression but receive the below error while Publishing. The expression used in the attribute: Res_Latest_Logon_Status_API.Get_Logon_Status(resource_seq)

Can we use Custom Events and Actions to achieve this logic? Any inputs or work arounds would be appreciated.

 

Kind Regards

Priyanka Cecilia


5 replies

Userlevel 6
Badge +15

@Navinth Bakmeedeniya  F Y A

Userlevel 6
Badge +12

@Priyanka Cecilia V 

In this expression, we do not support using columns of the entity. PL/SQL functions without any parameters or passing any fixed values as parameters are supported here. Or we support expressions here that can be independently evaluated.

There could be a possibility of achieving this functionality through custom events using Workflow type event actions. Perhaps defining the custom event on the base table & setting up the desired value to custom attribute using a workflow? @Lahirumala de Mel is this something possible to achieve through workflows? 

Userlevel 3
Badge +7

 You can use a projection call to read the logon status using a workflow, giving resource_seq as a parameter, if there is a projection existing as such. Then you can copy that to a custom attribute using the workflow. But then each time the logon status updates custom attribute should be updated as well if you need the custom attribute to keep integrity.

Badge +12

Hi @Lahirumala de Mel,

Thank you for the inputs. I tried using workflows and have a follow up query. I’m able to fetch the Logon Status value but the workflow does not trigger if we have a Projection call on entity ‘JtExecutionInstance’ but works for ‘JtTask’. We are unable to update a custom attribute in ‘JtExecutionInstance’ entity as well using workflows.

Based on our scenario, we will need the workflow to trigger when a Status change is done in a work assignment. Is this a limitation or am I missing something? Please advise.

Kind Regards

Priyanka Cecilia

Userlevel 3
Badge +7

If you refer the API documentation for WorkTaskHandling API, updates are probably not supported for JtExecutionInstance entityset. That could be the reason you cannot update a custom attribute there. 
State change is not an update to a projection and the workflow is not expected to trigger when it’s suppose to trigger for updates. Action type of a state change is CALL not DATA. It’s considered as a call to a bound function than an attribute change in a projection. If you use an event action to trigger the workflow then it might trigger if the event action is configured to trigger for updates because in database perspective state change is ultimately a data change in the table.

Reply