Published at: 2025-10-30

1.4 Integration Case: ShareCRM Tasks with Weaver OA


Weaver OA Pending Task Integration and SSO Guide

Implementation Overview of Pending Task Integration

When a user submits a workflow to an approver node in ShareCRM, the system automatically pushes a pending task to the approver’s OA system task list. Clicking the task in the OA system redirects the approver directly to the CRM workflow approval interface.

Prerequisites from the OA System

  1. The OA system must enable the OAuth 2.0 authentication module.
  2. The pending task integration module must be activated (both are non-standard modules; the Account must purchase them separately from the OA provider).

Environment Requirements

  • The OA system must allow external network access.
  • A test environment must be provided for integration development and testing.

Weaver OAuth 2.0 Configuration

  1. Enable OAuth 2.0 Authentication
    Navigate to:
    Backend Application Center → Integration Center → Unified Authentication Center → Authentication Service Management → OAuth2 Authentication
    Enable the service.

picture coming soon:

  1. Register Authentication Application
    Navigate to:
    Backend Application Center → Integration Center → Unified Authentication Center → Authentication Service Management → Authentication Application Management
    • Click Register.
    • Select OAUTH2 as the authentication method.
    • Set an application name.
    • Enter the business system URL: https://www.fxiaoke.com.
    • For account mapping, select Employee ID. Save to apply.

picture coming soon:

  1. Configure Unified Task Center
    Navigate to:
    Backend Application Center → Integration Center → Functional Integration → Unified Task Center Settings
    • Click Register and enter integration details.
    • For the PC address, use the OA unified authentication interface with the following parameters:
      http://www.yumin.ltd:9090/sso/oauth2.0/authorize?client_id=39b2e3359e&response_type=code&redirect_uri=https://www.fxiaoke.com/erp/syncdata/open/oa/authorize/common
      • client_id: The application ID from Step 2.
    • Set Employee ID as the personnel mapping rule.
    • Enable:
      • Auto-create workflow type
      • Edit workflow type
      • Receive workflow data
      • Display on PC/mobile
    • Add the workflow types to integrate.

picture coming soon:


CRM-Side OA Task Connector Configuration

  1. Initial Setup
    Navigate to Connector Settings and follow the Integration Platform OA Connector Guide to configure parameters.

picture coming soon:

  1. Scenario Parameter Configuration
    Set pending task message parameters:
    • syscode: The OA task integration system identifier (configured in Step 3).
    • Use CRM placeholders for other parameters.
    • The task notification URL is provided by the OA system.

picture coming soon:

  1. Custom Functions for Tasks
    Use these to dynamically set task parameters (e.g., workflow name, timestamp conversion) when default placeholders are insufficient. Refer to the Integration Platform guide for syntax.

picture coming soon:

  1. Account Binding
    Bind accounts using Employee ID (matching the OA-side mapping rule).

picture coming soon:


OA Single Sign-On (SSO) Integration

  1. SSO Authentication Function
    Configure this in the Account Binding page (under the extension button next to New). It enables seamless login when users click a task in OA to access CRM.

picture coming soon:

  1. SSO Workflow
    When a user clicks a task in OA:
    • The system passes a temporary ticket to the CRM authentication endpoint.
    • The SSO function uses this ticket to call the OA accesstoken API, retrieves a token, and fetches user details (e.g., Employee ID) via the OA profile API.
    • Matching the Employee ID with the bound account completes the login.

Code Examples:

OA Interface Configuration (Toolkit):
java // Weaver OA API prefix (required) private static String PREFIX_URL="http://www.yumin.ltd:43410/" // Application ID (required) private static String CLIENTID="39b2e3be-b4ca-4e7a259e" // Application secret (required) private static String CLIENTSECRET="slatwgyHoIGWRd36p" // ShareCRM callback URL (required) private static String redirect_uri = "https://www.fxiaoke.com/oauth/sp/callback"

Access Token Retrieval:
java public static Map accessToken(String code) { String final_url = PREFIX_URL + "sso/oauth2.0/accessToken?client_id=" + CLIENTID + "&client_secret=" + CLIENTSECRET + "&code=" + code + "&grant_type=authorization_code&redirect_uri=" + redirect_uri; Map returnMap = OAuthUtils.post(final_url, [:], [:]) return returnMap }

User Profile Retrieval:
java public static Integer openId2userId(String accessToken) { HttpResult o = (HttpResult) http.get(PREFIX_URL + "sso/oauth2.0/profile?access_token=" + accessToken, ["access_token": accessToken]).getData(); String user = o.content["attributes"]["loginid"].toString(); QueryResult data = (QueryResult) object.find("PersonnelObj", [["employee_number": user]], 2, 0).getData(); return data.dataList[0]["employee_number"].toString() as Integer; }

SSO Function:
java String ticket = syncArg["params"]["requestParams"]["ticket"] as String; String token = Tools.getAccessToken(ticket); Integer userId = Tools.openId2userId(token); syncArg.put("oaUser", userId); // Return the bound account key return syncArg;

Submit Feedback